Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a script to merge records of multiple databases #455

Merged
merged 9 commits into from
Apr 12, 2024

Conversation

joergsteffens
Copy link
Contributor

After my approach to extend the webui to offer some access to other user records (#449) got rejected, I abandoned this approach. As a workaround, I created an external script to merge the record tables of multiple users together.

The timetagger-mergedatabases.py is intended to merge TimeTagger record tables of multiple user databases into one user database, replacing the existing records. Extends the records by user information.

This can be used as a workaround to create a unified view of the records of all or a group of users.
Currently I run this script periodically via cron.

Feel free to merge it, or reject it. As an external script, it is quite easy maintainable by itself.

The timetagger-mergedatabases.py is intended to merge
TimeTagger record tables of multiple user databases
into one user database, replacing the existing records.
Extends the records by user information.

This can be used as a workaround to create a unified view
of the records of all or a group of users.
@almarklein
Copy link
Owner

Thanks! I guess it's time for a folder with user-contributed stuff. Let's create a folder contrib in the root of the repo, and move this script there.

@joergsteffens
Copy link
Contributor Author

Excellent. I'll adapt the PR soon and possible add another feature to the script.

@joergsteffens
Copy link
Contributor Author

Added some more features to the script, moved it to contrib and added to the package. Adding to the package has been done in a separate commit. Remove it, if you want.

... to be able to replace text in the descriptions during merging.
setup.py Outdated Show resolved Hide resolved
@almarklein almarklein merged commit 3a381b0 into almarklein:main Apr 12, 2024
9 checks passed
@almarklein
Copy link
Owner

Thanks! I just fixed some linting issues.

stavros-k referenced this pull request in truecharts/public May 1, 2024
…v24.4.1@5f4c178 by renovate (#21018)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/almarklein/timetagger](https://togithub.com/almarklein/timetagger)
| major | `v23.11.4-nonroot` -> `v24.4.1-nonroot` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>almarklein/timetagger (ghcr.io/almarklein/timetagger)</summary>

###
[`v24.4.1`](https://togithub.com/almarklein/timetagger/releases/tag/v24.4.1)

[Compare
Source](https://togithub.com/almarklein/timetagger/compare/v23.11.4...v24.4.1)

##### App

- Fixes iOS zoom issue by
[@&#8203;axelknock](https://togithub.com/axelknock) in
[https://github.com/almarklein/timetagger/pull/456](https://togithub.com/almarklein/timetagger/pull/456)
- Add option for Monday-Friday week by
[@&#8203;staddi99](https://togithub.com/staddi99) in
[https://github.com/almarklein/timetagger/pull/458](https://togithub.com/almarklein/timetagger/pull/458)
- More shortcuts by [@&#8203;Tagirijus](https://togithub.com/Tagirijus)
in
[https://github.com/almarklein/timetagger/pull/467](https://togithub.com/almarklein/timetagger/pull/467)
- Enable notifications by
[@&#8203;almarklein](https://togithub.com/almarklein) in
[https://github.com/almarklein/timetagger/pull/470](https://togithub.com/almarklein/timetagger/pull/470)

##### For self-hosters

- Pass an import string rather than a function reference to enable
multi-worker and reload support. by
[@&#8203;michaellenaghan](https://togithub.com/michaellenaghan) in
[https://github.com/almarklein/timetagger/pull/457](https://togithub.com/almarklein/timetagger/pull/457)
- add a script to merge records of multiple databases by
[@&#8203;joergsteffens](https://togithub.com/joergsteffens) in
[https://github.com/almarklein/timetagger/pull/455](https://togithub.com/almarklein/timetagger/pull/455)

##### New Contributors

- [@&#8203;michaellenaghan](https://togithub.com/michaellenaghan) made
their first contribution in
[https://github.com/almarklein/timetagger/pull/457](https://togithub.com/almarklein/timetagger/pull/457)
- [@&#8203;axelknock](https://togithub.com/axelknock) made their first
contribution in
[https://github.com/almarklein/timetagger/pull/456](https://togithub.com/almarklein/timetagger/pull/456)
- [@&#8203;staddi99](https://togithub.com/staddi99) made their first
contribution in
[https://github.com/almarklein/timetagger/pull/458](https://togithub.com/almarklein/timetagger/pull/458)
- [@&#8203;joergsteffens](https://togithub.com/joergsteffens) made their
first contribution in
[https://github.com/almarklein/timetagger/pull/455](https://togithub.com/almarklein/timetagger/pull/455)
- [@&#8203;Tagirijus](https://togithub.com/Tagirijus) made their first
contribution in
[https://github.com/almarklein/timetagger/pull/467](https://togithub.com/almarklein/timetagger/pull/467)

##### Personal note

I'm rather occupied with other projects, so I find that I don't have as
much time to work on TimeTagger as I want to. In the last days I did
some work on timetagger.app to refactor things into more components with
specific tasks, which will make room for future improvements such as
teams ...

**Full Changelog**:
almarklein/timetagger@v23.11.4...v24.4.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMDkuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMwOS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInVwZGF0ZS9kb2NrZXIvZ2VuZXJhbC9tYWpvciJdfQ==-->

Signed-off-by: Stavros Kois <[email protected]>
Co-authored-by: Stavros Kois <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants