tricount-extractor 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. tricount_extractor-0.2.1/.github/dependabot.yml +27 -0
  2. tricount_extractor-0.2.1/.github/workflows/format.yml +30 -0
  3. tricount_extractor-0.2.1/.github/workflows/publish.yml +52 -0
  4. tricount_extractor-0.2.1/.github/workflows/run_tests.yml +47 -0
  5. tricount_extractor-0.2.1/.gitignore +207 -0
  6. tricount_extractor-0.2.1/.pre-commit-config.yaml +16 -0
  7. tricount_extractor-0.2.1/CHANGELOG.md +50 -0
  8. tricount_extractor-0.2.1/LICENSE +674 -0
  9. tricount_extractor-0.2.1/PKG-INFO +152 -0
  10. tricount_extractor-0.2.1/README.md +124 -0
  11. tricount_extractor-0.2.1/pyproject.toml +52 -0
  12. tricount_extractor-0.2.1/tricount_extractor/__init__.py +0 -0
  13. tricount_extractor-0.2.1/tricount_extractor/client/__init__.py +0 -0
  14. tricount_extractor-0.2.1/tricount_extractor/client/client.py +161 -0
  15. tricount_extractor-0.2.1/tricount_extractor/client/keys.py +29 -0
  16. tricount_extractor-0.2.1/tricount_extractor/main.py +70 -0
  17. tricount_extractor-0.2.1/tricount_extractor/models/__init__.py +0 -0
  18. tricount_extractor-0.2.1/tricount_extractor/models/allocation.py +43 -0
  19. tricount_extractor-0.2.1/tricount_extractor/models/amount.py +13 -0
  20. tricount_extractor-0.2.1/tricount_extractor/models/entry.py +130 -0
  21. tricount_extractor-0.2.1/tricount_extractor/models/member.py +29 -0
  22. tricount_extractor-0.2.1/tricount_extractor/models/pagination.py +18 -0
  23. tricount_extractor-0.2.1/tricount_extractor/models/registry.py +125 -0
  24. tricount_extractor-0.2.1/tricount_extractor/parse_args.py +23 -0
  25. tricount_extractor-0.2.1/tricount_extractor/saver.py +28 -0
  26. tricount_extractor-0.2.1/tricount_extractor/tests/__init__.py +0 -0
  27. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/attachment_test_4.xlsx +0 -0
  28. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/custom_category_trip_8.xlsx +0 -0
  29. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/dinner_group_3.xlsx +0 -0
  30. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/duplicate_names_9.xlsx +0 -0
  31. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/euro_trip_2.xlsx +0 -0
  32. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/foreign_currency_trip_6.xlsx +0 -0
  33. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/income_trip_7.xlsx +0 -0
  34. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/multi_attachment_test_5.xlsx +0 -0
  35. tricount_extractor-0.2.1/tricount_extractor/tests/data/expected_results/test_trip_1.xlsx +0 -0
  36. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/basic_registries.json +46 -0
  37. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/no_registries.json +13 -0
  38. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registries_with_reimboursement.json +55 -0
  39. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_custom_category.json +71 -0
  40. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_duplicate_member_names.json +182 -0
  41. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_foreign_currency.json +69 -0
  42. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_income.json +93 -0
  43. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_multiple_attachments.json +54 -0
  44. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/registry_with_single_attachment.json +47 -0
  45. tricount_extractor-0.2.1/tricount_extractor/tests/data/responses/unequal_registries.json +42 -0
  46. tricount_extractor-0.2.1/tricount_extractor/tests/test_client.py +124 -0
  47. tricount_extractor-0.2.1/tricount_extractor/tests/test_main.py +448 -0
  48. tricount_extractor-0.2.1/uv.lock +627 -0
@@ -0,0 +1,27 @@
1
+ version: 2
2
+ updates:
3
+ # Enable version updates for Python dependencies
4
+ - package-ecosystem: "uv"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "monday"
9
+ time: "10:00"
10
+ timezone: "America/New_York"
11
+ open-pull-requests-limit: 5
12
+ commit-message:
13
+ prefix: "deps"
14
+ include: "scope"
15
+
16
+ # Enable version updates for GitHub Actions
17
+ - package-ecosystem: "github-actions"
18
+ directory: "/"
19
+ schedule:
20
+ interval: "weekly"
21
+ day: "monday"
22
+ time: "10:00"
23
+ timezone: "America/New_York"
24
+ open-pull-requests-limit: 3
25
+ commit-message:
26
+ prefix: "ci"
27
+ include: "scope"
@@ -0,0 +1,30 @@
1
+ name: Check format
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - "*"
7
+
8
+ jobs:
9
+ format:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Get the project
14
+ uses: actions/checkout@v7
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v7
20
+ with:
21
+ enable-cache: true
22
+ cache-dependency-glob: "uv.lock"
23
+
24
+ - name: Install development requirements
25
+ run: uv sync --group lint
26
+
27
+ - name: Check via pre-commit
28
+ run: |
29
+ uv run pre-commit install
30
+ uv run pre-commit run --files $(git diff --name-only origin/${{ github.base_ref }}...origin/${{ github.head_ref }}) --show-diff-on-failure
@@ -0,0 +1,52 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Get the project
13
+ uses: actions/checkout@v7
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v7
17
+
18
+ - name: Check the tag matches the package version
19
+ run: |
20
+ version=$(uv version --short)
21
+ if [ "v${version}" != "${{ github.event.release.tag_name }}" ]; then
22
+ echo "Tag ${{ github.event.release.tag_name }} does not match version ${version}"
23
+ exit 1
24
+ fi
25
+
26
+ - name: Build
27
+ run: uv build
28
+
29
+ - name: Upload distributions
30
+ uses: actions/upload-artifact@v7
31
+ with:
32
+ name: dist
33
+ path: dist/
34
+
35
+ publish:
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment:
39
+ name: pypi
40
+ url: https://pypi.org/project/tricount-extractor/
41
+ permissions:
42
+ id-token: write
43
+
44
+ steps:
45
+ - name: Download distributions
46
+ uses: actions/download-artifact@v8
47
+ with:
48
+ name: dist
49
+ path: dist/
50
+
51
+ - name: Publish
52
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,47 @@
1
+ name: Run Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ pytest:
11
+ name: pytest (${{ matrix.python-version }})
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: [ "3.12", "3.13", "3.14" ]
17
+
18
+ steps:
19
+ - name: Get the project
20
+ uses: actions/checkout@v7
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v7
24
+ with:
25
+ enable-cache: true
26
+ cache-dependency-glob: "uv.lock"
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --group dev
31
+
32
+ - name: Pytest
33
+ run: uv run pytest --verbose
34
+
35
+ # Single required status check for branch protection, whatever the matrix.
36
+ tests:
37
+ needs: pytest
38
+ if: always()
39
+ runs-on: ubuntu-latest
40
+
41
+ steps:
42
+ - name: Check all Python versions passed
43
+ run: |
44
+ if [ "${{ needs.pytest.result }}" != "success" ]; then
45
+ echo "pytest matrix result: ${{ needs.pytest.result }}"
46
+ exit 1
47
+ fi
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,16 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: check-docstring-first
6
+ - id: check-merge-conflict
7
+ - id: check-toml
8
+ - id: requirements-txt-fixer
9
+ - id: trailing-whitespace
10
+ - id: end-of-file-fixer
11
+ - repo: https://github.com/astral-sh/ruff-pre-commit
12
+ rev: v0.12.7
13
+ hooks:
14
+ - id: ruff
15
+ args: [--fix, --show-fixes]
16
+ - id: ruff-format
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.1] - 2026-09-26
9
+
10
+ ### Added
11
+
12
+ - Published on PyPI: `pip install tricount-extractor`.
13
+ - Support for Python 3.12 and 3.13 (previously 3.14 only). ([#79])
14
+ - Package metadata (README, `GPL-3.0-or-later` license, project URLs). Tests are
15
+ no longer shipped in the wheel.
16
+
17
+ ## [0.2.0] - 2026-09-26
18
+
19
+ ### Added
20
+
21
+ - New `transaction_ledger` sheet: one row per entry with its date, description,
22
+ category, type (`Expense`, `Income` or `Transfer`), cost and currency, plus one
23
+ column per member holding their net position for that entry (positive = owed).
24
+ Each member column sums to their value on the `balances` sheet. ([#73])
25
+ - New `is_income` column on the `entries` and `allocations` sheets. ([#72])
26
+
27
+ ### Fixed
28
+
29
+ - Balances are now correct for registries containing income entries. Amounts
30
+ used to be taken as absolute values, which treated money received by the group
31
+ like an expense. The sign convention is unchanged (positive = owed, negative =
32
+ owes), but **exports of registries with income will show different balances
33
+ than with 0.1.0**. ([#71])
34
+ - Members sharing a display name are no longer merged on the `balances` sheet.
35
+ Members are now tracked by id; when a display name is shared, or matches a
36
+ `transaction_ledger` column name, the member id is appended to the label,
37
+ e.g. `Alex (#301)`. ([#76])
38
+
39
+ ## [0.1.0]
40
+
41
+ - Initial version: export Tricount registries to Excel with `members`, `entries`,
42
+ `allocations`, `attachments` and `balances` sheets.
43
+
44
+ [0.2.1]: https://github.com/wenceslas-sanchez/tricount-extractor/releases/tag/v0.2.1
45
+ [0.2.0]: https://github.com/wenceslas-sanchez/tricount-extractor/releases/tag/v0.2.0
46
+ [#71]: https://github.com/wenceslas-sanchez/tricount-extractor/pull/71
47
+ [#72]: https://github.com/wenceslas-sanchez/tricount-extractor/pull/72
48
+ [#73]: https://github.com/wenceslas-sanchez/tricount-extractor/pull/73
49
+ [#76]: https://github.com/wenceslas-sanchez/tricount-extractor/pull/76
50
+ [#79]: https://github.com/wenceslas-sanchez/tricount-extractor/pull/79