ledgerkit 1.0.0.dev1__py3-none-any.whl

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.
@@ -0,0 +1,203 @@
1
+ Metadata-Version: 2.4
2
+ Name: ledgerkit
3
+ Version: 1.0.0.dev1
4
+ Summary: Python parser and library for hledger journal files — CLI tools, DataFrame export, and a clean data model for the Python ecosystem
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/ctosullivan/ledgerkit
7
+ Project-URL: Repository, https://github.com/ctosullivan/ledgerkit
8
+ Project-URL: Bug Tracker, https://github.com/ctosullivan/ledgerkit/issues
9
+ Project-URL: Changelog, https://github.com/ctosullivan/ledgerkit/blob/main/CHANGELOG.md
10
+ Keywords: hledger,ledger,accounting,plain-text-accounting,finance,pandas
11
+ Classifier: Topic :: Office/Business :: Financial :: Accounting
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Development Status :: 5 - Production/Stable
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Intended Audience :: End Users/Desktop
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Provides-Extra: pandas
25
+ Requires-Dist: pandas>=1.3; extra == "pandas"
26
+ Dynamic: license-file
27
+
28
+ # ledgerkit
29
+
30
+ [![Tests](https://github.com/ctosullivan/ledgerkit/actions/workflows/tests.yml/badge.svg)](https://github.com/ctosullivan/ledgerkit/actions/workflows/tests.yml)
31
+
32
+ A Python implementation of the [hledger](https://hledger.org) plain-text accounting tool.
33
+
34
+ ## Features
35
+
36
+ - Parse `.journal` files compatible with the hledger 1.52 format
37
+ - Comprehensive directive support: `include`, `account`, `commodity`, `payee`,
38
+ `alias`, `P`, `Y`, `D`, `apply account`
39
+ - Core CLI commands: `balance`, `register`, `print`, `accounts`, `stats`, `check`
40
+ - Strict mode (`-s`) and balance assertions
41
+ - Multi-commodity balances with tree rollup
42
+ - Commodity display style inference and `-c` override flag
43
+ - Optional pandas DataFrame export (`pip install ledgerkit[pandas]`)
44
+ - Editor-integration layer: lenient parser, round-trip writer, `EditorDocument`
45
+ - Pure Python — no third-party runtime dependencies
46
+ - Python 3.8–3.12
47
+
48
+ ## Requirements
49
+
50
+ - Python 3.8+
51
+
52
+ ## Installation
53
+
54
+ ```bash
55
+ pip install ledgerkit
56
+ ```
57
+
58
+ With optional pandas support:
59
+
60
+ ```bash
61
+ pip install ledgerkit[pandas]
62
+ ```
63
+
64
+ ### Development install
65
+
66
+ ```bash
67
+ git clone https://github.com/ctosullivan/ledgerkit.git
68
+ cd ledgerkit
69
+ pip install -e ".[pandas]"
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### CLI
75
+
76
+ ```bash
77
+ ledgerkit balance myfile.journal
78
+ ledgerkit register myfile.journal
79
+ ledgerkit accounts myfile.journal
80
+ ledgerkit print myfile.journal
81
+ ledgerkit stats myfile.journal
82
+ ```
83
+
84
+ You can also invoke ledgerkit as a Python module:
85
+
86
+ ```bash
87
+ python -m ledgerkit balance myfile.journal
88
+ ```
89
+
90
+ ### Python library
91
+
92
+ ```python
93
+ import ledgerkit
94
+
95
+ journal = ledgerkit.load("myfile.journal")
96
+ accounts = journal.accounts()
97
+ balance = journal.balance()
98
+ ```
99
+
100
+ See [docs/python-api.md](docs/python-api.md) for the full library reference.
101
+
102
+ ## Documentation
103
+
104
+ | Guide | Description |
105
+ |---|---|
106
+ | [docs/getting-started.md](docs/getting-started.md) | Installation, first run, verification |
107
+ | [docs/usage.md](docs/usage.md) | CLI commands with examples |
108
+ | [docs/journal-format.md](docs/journal-format.md) | Supported journal syntax with annotated examples |
109
+ | [docs/python-api.md](docs/python-api.md) | Python library reference |
110
+
111
+ ## Python ecosystem (pandas)
112
+
113
+ Install the optional pandas extra for DataFrame export:
114
+
115
+ ```bash
116
+ pip install ledgerkit[pandas]
117
+ ```
118
+
119
+ Then:
120
+
121
+ ```python
122
+ import ledgerkit
123
+
124
+ journal = ledgerkit.load("myfile.journal")
125
+
126
+ # Export all postings to a DataFrame
127
+ df = journal.to_dataframe()
128
+ print(df.groupby("account")["amount"].sum())
129
+
130
+ # Or export directly from a report object
131
+ balance_df = journal.balance().to_dataframe()
132
+ register_df = journal.register().to_dataframe()
133
+ accounts_df = journal.accounts().to_dataframe()
134
+ ```
135
+
136
+ ## Development
137
+
138
+ ```bash
139
+ # Run all tests
140
+ python -m unittest discover -s tests -t . -v
141
+ ```
142
+
143
+ See [dev-docs/architecture.md](dev-docs/architecture.md) for module design and
144
+ [dev-docs/api-spec.md](dev-docs/api-spec.md) for the full API specification.
145
+
146
+ ## Hledger Compatibility
147
+
148
+ See [dev-docs/hledger-compatibility.md](dev-docs/hledger-compatibility.md) for which
149
+ hledger journal features are supported in v1.
150
+
151
+ ## Contributing
152
+
153
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for pull request guidelines, commit
154
+ message format, and branch naming. This project follows the
155
+ [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
156
+
157
+ ### With AI tooling (Claude Code)
158
+
159
+ Clone the full repository including AI-workflow files:
160
+
161
+ ```bash
162
+ git clone https://github.com/ctosullivan/ledgerkit.git
163
+ ```
164
+
165
+ ### Without AI tooling
166
+
167
+ Use sparse checkout to clone only the source code, tests, and human docs
168
+ (excludes `CLAUDE.md`, `dev-docs/`, `CHANGELOG.md`, `ROADMAP.md`):
169
+
170
+ ```bash
171
+ git clone --filter=blob:none --sparse https://github.com/ctosullivan/ledgerkit.git
172
+ cd ledgerkit
173
+ git sparse-checkout set ledgerkit tests docs README.md LICENSE pyproject.toml
174
+ ```
175
+
176
+ ## Acknowledgements
177
+
178
+ ledgerkit is a Python implementation inspired by two pioneering plain-text
179
+ accounting projects. We gratefully acknowledge their authors and contributors.
180
+
181
+ ### Ledger
182
+
183
+ **John Wiegley** created Ledger, the original plain-text double-entry accounting
184
+ tool, which established the journal file format and accounting model that this
185
+ ecosystem is built upon.
186
+
187
+ https://github.com/ledger/ledger
188
+
189
+ ### hledger
190
+
191
+ **Simon Michael** created hledger, a Haskell implementation of Ledger's concepts,
192
+ which has since evolved its own rich feature set and extensive documentation.
193
+ ledgerkit's journal format support is modelled primarily on the hledger 1.52
194
+ specification.
195
+
196
+ https://github.com/simonmichael/hledger
197
+
198
+ A full list of hledger contributors can be found at:
199
+
200
+ https://github.com/simonmichael/hledger/blob/main/doc/CREDITS.md
201
+
202
+ Their work — and the broader plain-text accounting community — makes ledgerkit
203
+ possible.
@@ -0,0 +1,18 @@
1
+ ledgerkit/__init__.py,sha256=6l33losA02wxNjAJWrAdRAv0y5w-AAqyt6N7kwcJPk4,1281
2
+ ledgerkit/__main__.py,sha256=68wUcZXMn3fYTe0n2zzQ0sg0s0KRzKnMqbb7T67BgLQ,240
3
+ ledgerkit/_pandas_compat.py,sha256=ASEirFGvrw0wMIgnWUtUvJPZidi8hUD8w1faS7RuOBU,589
4
+ ledgerkit/checks.py,sha256=cM6HmPeDkeRKBf4Mf_SGXLqMZp4qUDGGe9R9LE-u-8g,22032
5
+ ledgerkit/cli.py,sha256=Snx8_TfHk1JhxawuLybhU1nQGeJPyLNurusDySNbkVw,17237
6
+ ledgerkit/commodity_style.py,sha256=xAUnGgvST_o5-GP0XifP1JiRgje95iW6nsxDSX_0Z4c,10722
7
+ ledgerkit/editor_model.py,sha256=e5X-mKrwkWZR4O9yK7eHfoHARijRHlu9GIpjbFbtyIM,7646
8
+ ledgerkit/loader.py,sha256=BqLAyXhJNjeEsMmE597H0QqfZTArtSybnZBSijUKoa0,11621
9
+ ledgerkit/models.py,sha256=vudnOUDg5uqGrvvFXQHjaptoo73ICn-p15T4GHzXURM,18359
10
+ ledgerkit/parser.py,sha256=_Xnhfpnzp5cUgSLX5BHCEFt7tQBli8tUjuGD-Uak9G0,72345
11
+ ledgerkit/reports.py,sha256=02U6WijQ14wQu11IdOY_T_U2RWNAD_umJ-4qZMlfR7U,21397
12
+ ledgerkit/writer.py,sha256=1bNl98zzw3Bik8UuKpdIZots1McOqR8W8QqlCXXYGgY,3492
13
+ ledgerkit-1.0.0.dev1.dist-info/licenses/LICENSE,sha256=oDlmh6VEazQw2Sla3nlLCrOZFAPyZnMHRhrjdRPaWks,1074
14
+ ledgerkit-1.0.0.dev1.dist-info/METADATA,sha256=5mEMBO6hMi6i0OMjqweBhVyN31cQJsBqNNoUOLS_UZU,5969
15
+ ledgerkit-1.0.0.dev1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
16
+ ledgerkit-1.0.0.dev1.dist-info/entry_points.txt,sha256=Psg1xTHAIr7PlAU71Yj8KdX9d-3jwUUf5NibQWHX1TQ,49
17
+ ledgerkit-1.0.0.dev1.dist-info/top_level.txt,sha256=tIZC8R0iyHNf8lZ6f1xXW0RqD8BA4OVAKz1RFFG3KFg,10
18
+ ledgerkit-1.0.0.dev1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ledgerkit = ledgerkit.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cormac O' Sullivan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ ledgerkit