beancount-ast 0.0.1a0__tar.gz → 0.0.1a2__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 (29) hide show
  1. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/workflows/tests.yml +3 -0
  2. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.gitignore +2 -0
  3. beancount_ast-0.0.1a2/AGENTS.md +47 -0
  4. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/Cargo.lock +10 -0
  5. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/Cargo.toml +1 -1
  6. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/PKG-INFO +1 -1
  7. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/py-src/beancount_ast/__init__.py +6 -2
  8. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/py-src/beancount_ast/_ast.pyi +99 -8
  9. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/pyproject.toml +1 -1
  10. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/src/lib.rs +571 -440
  11. beancount_ast-0.0.1a2/tests/__snapshots__/test_parse_snapshots.ambr +100 -0
  12. beancount_ast-0.0.1a2/tests/test_parse_snapshots.py +102 -0
  13. beancount_ast-0.0.1a0/.github/copilot-instructions.md +0 -6
  14. beancount_ast-0.0.1a0/tests/__snapshots__/test_parse_snapshots.ambr +0 -20
  15. beancount_ast-0.0.1a0/tests/test_parse_snapshots.py +0 -36
  16. beancount_ast-0.0.1a0/uv.lock +0 -172
  17. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/renovate.json +0 -0
  18. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/workflows/_build_wheels.yaml +0 -0
  19. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/workflows/autofix.yaml +0 -0
  20. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/workflows/ci.yml +0 -0
  21. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.github/workflows/release.yaml +0 -0
  22. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/.pre-commit-config.yaml +0 -0
  23. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/README.md +0 -0
  24. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/dprint.json +0 -0
  25. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/py-src/beancount_ast/py.typed +0 -0
  26. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/scripts/generate_ast_stubs.py +0 -0
  27. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/src/bin/stub_gen.rs +0 -0
  28. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/taskfile.yaml +0 -0
  29. {beancount_ast-0.0.1a0 → beancount_ast-0.0.1a2}/tests/__init__.py +0 -0
@@ -43,6 +43,9 @@ jobs:
43
43
  - windows-11-arm
44
44
  - ubuntu-24.04
45
45
  - ubuntu-24.04-arm
46
+ exclude:
47
+ - platform: windows-11-arm
48
+ python: '3.10'
46
49
  steps:
47
50
  - uses: actions/checkout@v6
48
51
 
@@ -8,6 +8,7 @@
8
8
  *~
9
9
  .cache
10
10
  .idea
11
+ .vscode/
11
12
  .noseids
12
13
  .pytest_cache/*
13
14
  TAGS
@@ -25,3 +26,4 @@ experiments/v3/arrow/*.arrow
25
26
  .aider*
26
27
  .env
27
28
  target
29
+ uv.lock
@@ -0,0 +1,47 @@
1
+ # Copilot instructions (beancount-ast)
2
+
3
+ ## Project overview
4
+ - This repo provides Python bindings (PyO3) for the Rust `beancount-parser` directive AST.
5
+ - The Python API intentionally exposes the **parser AST** (directives + spans + raw tokens), not Beancount’s semantic `beancount.core` model.
6
+
7
+ ## Key layout
8
+ - `src/lib.rs`: the PyO3 module `beancount_ast._ast`.
9
+ - Registers all exposed Python classes in `#[pymodule(name = "_ast")]`.
10
+ - Converts Rust parser nodes (`beancount_parser::ast::*`) into `Py*` structs.
11
+ - Public Python entrypoints are `parse_string` and `parse_file`.
12
+ - `py-src/beancount_ast/__init__.py`: re-exports symbols from `beancount_ast._ast`.
13
+ - `py-src/beancount_ast/_ast.pyi`: stubs of `src/lib.rs`, when you change any interface, you should also update it.
14
+ - `tests/test_parse_snapshots.py`: snapshot-style API tests using `pytest` + `syrupy`.
15
+
16
+ ## Workflows (local + CI-aligned)
17
+ - Python deps / test env are managed with `uv` (see `.github/workflows/tests.yml`).
18
+ - Setup: `uv sync --dev --no-install-project`
19
+ - Run tests: `uv run pytest`
20
+ - Rust checks mirror CI (`.github/workflows/ci.yml`):
21
+ - Format: `cargo fmt --all -- --check`
22
+ - Lint: `cargo clippy --workspace --all-targets --all-features -- -D warnings`
23
+
24
+ ## Conventions to follow when changing Rust bindings
25
+ - Avoid `unwrap()` / `expect()`; the crate denies them (`src/lib.rs` has `#![deny(clippy::unwrap_used, clippy::expect_used)]`).
26
+ - Python-facing data structures are thin, mostly immutable “record” types:
27
+ - Define a `Py*` struct with `#[pyclass(..., get_all)]` and `pyderive` derives (`PyNew`, `PyRepr`, `PyStr`, and sometimes `PyEq`).
28
+ - If the type should appear in stubs, add `#[cfg_attr(feature = "stub-gen", ...gen_stub_pyclass)]`.
29
+ - When adding a new directive/type:
30
+ 1) Add the `Py*` struct.
31
+ 2) Register it in the `_ast` module init.
32
+ 3) Extend the conversion layer (e.g. `directive_to_py(...)`).
33
+ 4) Update the `Directive` type alias used for stubs (see the `stub-gen` block at the end of `src/lib.rs`).
34
+
35
+ ## Stub generation
36
+ - The stub generator binary is `src/bin/stub_gen.rs` and is only available with the `stub-gen` feature.
37
+ - Typical command:
38
+ - `cargo run --bin stub_gen --features stub-gen`
39
+ - The generated output updates `py-src/beancount_ast/_ast.pyi`.
40
+
41
+ ## Formatting / linting
42
+ - Non-code config formatting uses `dprint` (see `dprint.json`) and is enforced via pre-commit.
43
+ - Python formatting/linting uses `ruff` + `black` (see `.pre-commit-config.yaml`).
44
+
45
+ ## Release notes (when relevant)
46
+ - CI builds wheels via `maturin` (see `.github/workflows/_build_wheels.yaml`).
47
+ - Tags `v*` publish to PyPI (see `.github/workflows/release.yaml`).
@@ -648,6 +648,7 @@ version = "0.27.2"
648
648
  source = "registry+https://github.com/rust-lang/crates.io-index"
649
649
  checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
650
650
  dependencies = [
651
+ "python3-dll-a",
651
652
  "target-lexicon",
652
653
  ]
653
654
 
@@ -721,6 +722,15 @@ dependencies = [
721
722
  "syn 2.0.114",
722
723
  ]
723
724
 
725
+ [[package]]
726
+ name = "python3-dll-a"
727
+ version = "0.2.14"
728
+ source = "registry+https://github.com/rust-lang/crates.io-index"
729
+ checksum = "d381ef313ae70b4da5f95f8a4de773c6aa5cd28f73adec4b4a31df70b66780d8"
730
+ dependencies = [
731
+ "cc",
732
+ ]
733
+
724
734
  [[package]]
725
735
  name = "quote"
726
736
  version = "1.0.44"
@@ -20,7 +20,7 @@ required-features = ["stub-gen"]
20
20
  [dependencies]
21
21
  beancount-parser = { git = "https://github.com/trim21/beancount.git", rev = "8b4e3311258194fe3127862dd4132028e97cc01d" }
22
22
  pyderive = "0.9.2"
23
- pyo3 = { version = "0.27.2", features = ["abi3-py310", "multiple-pymethods"] }
23
+ pyo3 = { version = "0.27.2", features = ["abi3-py310", "multiple-pymethods", "generate-import-lib"] }
24
24
  pyo3-stub-gen = { git = "https://github.com/Jij-Inc/pyo3-stub-gen", rev = "42dfdd813900015f6dbb7946f9a5878ceadb3fa3", optional = true }
25
25
  pyo3-stub-gen-derive = { git = "https://github.com/Jij-Inc/pyo3-stub-gen", rev = "42dfdd813900015f6dbb7946f9a5878ceadb3fa3", optional = true }
26
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beancount_ast
3
- Version: 0.0.1a0
3
+ Version: 0.0.1a2
4
4
  Summary: Parse Beancount content into AST
5
5
  Home-Page: https://github.com/trim21/beancount-ast
6
6
  Requires-Python: >=3.10
@@ -1,3 +1,5 @@
1
+ from typing import TYPE_CHECKING
2
+
1
3
  from ._ast import Amount
2
4
  from ._ast import Balance
3
5
  from ._ast import Close
@@ -33,11 +35,14 @@ from ._ast import SpannedPriceOperator
33
35
  from ._ast import SpannedStr
34
36
  from ._ast import Tag
35
37
  from ._ast import Transaction
36
- from ._ast import TransactionExtra
37
38
  from ._ast import parse_file
38
39
  from ._ast import parse_string
39
40
 
41
+ if TYPE_CHECKING:
42
+ from ._ast import Directive
43
+
40
44
  __all__ = [
45
+ "Directive",
41
46
  "Amount",
42
47
  "Balance",
43
48
  "Close",
@@ -73,7 +78,6 @@ __all__ = [
73
78
  "SpannedStr",
74
79
  "Tag",
75
80
  "Transaction",
76
- "TransactionExtra",
77
81
  "parse_file",
78
82
  "parse_string",
79
83
  ]
@@ -18,6 +18,7 @@ __all__ = [
18
18
  "Directive",
19
19
  "Document",
20
20
  "Event",
21
+ "File",
21
22
  "Headline",
22
23
  "Include",
23
24
  "KeyValue",
@@ -42,7 +43,6 @@ __all__ = [
42
43
  "SpannedStr",
43
44
  "Tag",
44
45
  "Transaction",
45
- "TransactionExtra",
46
46
  "parse_file",
47
47
  "parse_string",
48
48
  ]
@@ -70,6 +70,15 @@ Directive: TypeAlias = (
70
70
  | Headline
71
71
  )
72
72
 
73
+ @typing.final
74
+ class File:
75
+ @property
76
+ def filename(self) -> builtins.str: ...
77
+ @property
78
+ def content(self) -> builtins.str: ...
79
+ @property
80
+ def directives(self) -> builtins.list[Directive]: ...
81
+
73
82
  @typing.final
74
83
  class Amount:
75
84
  @property
@@ -78,6 +87,7 @@ class Amount:
78
87
  def number(self) -> NumberExpr: ...
79
88
  @property
80
89
  def currency(self) -> typing.Optional[SpannedStr]: ...
90
+ def dump(self) -> builtins.str: ...
81
91
 
82
92
  @typing.final
83
93
  class Balance:
@@ -86,6 +96,8 @@ class Balance:
86
96
  @property
87
97
  def span(self) -> Span: ...
88
98
  @property
99
+ def file(self) -> File: ...
100
+ @property
89
101
  def date(self) -> SpannedStr: ...
90
102
  @property
91
103
  def account(self) -> SpannedStr: ...
@@ -97,6 +109,7 @@ class Balance:
97
109
  def comment(self) -> typing.Optional[SpannedStr]: ...
98
110
  @property
99
111
  def key_values(self) -> builtins.list[KeyValue]: ...
112
+ def dump(self) -> builtins.str: ...
100
113
 
101
114
  @typing.final
102
115
  class Close:
@@ -105,6 +118,8 @@ class Close:
105
118
  @property
106
119
  def span(self) -> Span: ...
107
120
  @property
121
+ def file(self) -> File: ...
122
+ @property
108
123
  def date(self) -> SpannedStr: ...
109
124
  @property
110
125
  def account(self) -> SpannedStr: ...
@@ -112,6 +127,7 @@ class Close:
112
127
  def comment(self) -> typing.Optional[SpannedStr]: ...
113
128
  @property
114
129
  def key_values(self) -> builtins.list[KeyValue]: ...
130
+ def dump(self) -> builtins.str: ...
115
131
 
116
132
  @typing.final
117
133
  class Comment:
@@ -120,7 +136,10 @@ class Comment:
120
136
  @property
121
137
  def span(self) -> Span: ...
122
138
  @property
139
+ def file(self) -> File: ...
140
+ @property
123
141
  def text(self) -> SpannedStr: ...
142
+ def dump(self) -> builtins.str: ...
124
143
 
125
144
  @typing.final
126
145
  class Commodity:
@@ -129,6 +148,8 @@ class Commodity:
129
148
  @property
130
149
  def span(self) -> Span: ...
131
150
  @property
151
+ def file(self) -> File: ...
152
+ @property
132
153
  def date(self) -> SpannedStr: ...
133
154
  @property
134
155
  def currency(self) -> SpannedStr: ...
@@ -136,6 +157,7 @@ class Commodity:
136
157
  def comment(self) -> typing.Optional[SpannedStr]: ...
137
158
  @property
138
159
  def key_values(self) -> builtins.list[KeyValue]: ...
160
+ def dump(self) -> builtins.str: ...
139
161
 
140
162
  @typing.final
141
163
  class CostAmount:
@@ -160,6 +182,7 @@ class CostSpec:
160
182
  def merge(self) -> typing.Optional[SpannedBool]: ...
161
183
  @property
162
184
  def is_total(self) -> SpannedBool: ...
185
+ def dump(self) -> builtins.str: ...
163
186
 
164
187
  @typing.final
165
188
  class Custom:
@@ -168,6 +191,8 @@ class Custom:
168
191
  @property
169
192
  def span(self) -> Span: ...
170
193
  @property
194
+ def file(self) -> File: ...
195
+ @property
171
196
  def date(self) -> SpannedStr: ...
172
197
  @property
173
198
  def name(self) -> SpannedStr: ...
@@ -177,6 +202,7 @@ class Custom:
177
202
  def comment(self) -> typing.Optional[SpannedStr]: ...
178
203
  @property
179
204
  def key_values(self) -> builtins.list[KeyValue]: ...
205
+ def dump(self) -> builtins.str: ...
180
206
 
181
207
  @typing.final
182
208
  class CustomValue:
@@ -188,6 +214,7 @@ class CustomValue:
188
214
  def number(self) -> typing.Optional[NumberExpr]: ...
189
215
  @property
190
216
  def amount(self) -> typing.Optional[Amount]: ...
217
+ def dump(self) -> builtins.str: ...
191
218
 
192
219
  @typing.final
193
220
  class Document:
@@ -196,6 +223,8 @@ class Document:
196
223
  @property
197
224
  def span(self) -> Span: ...
198
225
  @property
226
+ def file(self) -> File: ...
227
+ @property
199
228
  def date(self) -> SpannedStr: ...
200
229
  @property
201
230
  def account(self) -> SpannedStr: ...
@@ -211,6 +240,7 @@ class Document:
211
240
  def comment(self) -> typing.Optional[SpannedStr]: ...
212
241
  @property
213
242
  def key_values(self) -> builtins.list[KeyValue]: ...
243
+ def dump(self) -> builtins.str: ...
214
244
 
215
245
  @typing.final
216
246
  class Event:
@@ -219,6 +249,8 @@ class Event:
219
249
  @property
220
250
  def span(self) -> Span: ...
221
251
  @property
252
+ def file(self) -> File: ...
253
+ @property
222
254
  def date(self) -> SpannedStr: ...
223
255
  @property
224
256
  def event_type(self) -> SpannedStr: ...
@@ -228,6 +260,7 @@ class Event:
228
260
  def comment(self) -> typing.Optional[SpannedStr]: ...
229
261
  @property
230
262
  def key_values(self) -> builtins.list[KeyValue]: ...
263
+ def dump(self) -> builtins.str: ...
231
264
 
232
265
  @typing.final
233
266
  class Headline:
@@ -236,7 +269,10 @@ class Headline:
236
269
  @property
237
270
  def span(self) -> Span: ...
238
271
  @property
272
+ def file(self) -> File: ...
273
+ @property
239
274
  def text(self) -> SpannedStr: ...
275
+ def dump(self) -> builtins.str: ...
240
276
 
241
277
  @typing.final
242
278
  class Include:
@@ -245,7 +281,10 @@ class Include:
245
281
  @property
246
282
  def span(self) -> Span: ...
247
283
  @property
284
+ def file(self) -> File: ...
285
+ @property
248
286
  def filename(self) -> SpannedStr: ...
287
+ def dump(self) -> builtins.str: ...
249
288
 
250
289
  @typing.final
251
290
  class KeyValue:
@@ -254,9 +293,12 @@ class KeyValue:
254
293
  @property
255
294
  def span(self) -> Span: ...
256
295
  @property
296
+ def file(self) -> File: ...
297
+ @property
257
298
  def key(self) -> SpannedStr: ...
258
299
  @property
259
300
  def value(self) -> typing.Optional[SpannedKeyValueValue]: ...
301
+ def dump(self) -> builtins.str: ...
260
302
 
261
303
  @typing.final
262
304
  class KeyValueValue:
@@ -283,6 +325,8 @@ class Note:
283
325
  @property
284
326
  def span(self) -> Span: ...
285
327
  @property
328
+ def file(self) -> File: ...
329
+ @property
286
330
  def date(self) -> SpannedStr: ...
287
331
  @property
288
332
  def account(self) -> SpannedStr: ...
@@ -292,6 +336,7 @@ class Note:
292
336
  def comment(self) -> typing.Optional[SpannedStr]: ...
293
337
  @property
294
338
  def key_values(self) -> builtins.list[KeyValue]: ...
339
+ def dump(self) -> builtins.str: ...
295
340
 
296
341
  @typing.final
297
342
  class NumberExpr:
@@ -300,6 +345,8 @@ class NumberExpr:
300
345
  @property
301
346
  def span(self) -> Span: ...
302
347
  @property
348
+ def file(self) -> File: ...
349
+ @property
303
350
  def literal(self) -> typing.Optional[SpannedStr]: ...
304
351
  @property
305
352
  def left(self) -> typing.Optional[NumberExpr]: ...
@@ -307,6 +354,7 @@ class NumberExpr:
307
354
  def op(self) -> typing.Optional[SpannedBinaryOp]: ...
308
355
  @property
309
356
  def right(self) -> typing.Optional[NumberExpr]: ...
357
+ def dump(self) -> builtins.str: ...
310
358
 
311
359
  @typing.final
312
360
  class Open:
@@ -315,6 +363,8 @@ class Open:
315
363
  @property
316
364
  def span(self) -> Span: ...
317
365
  @property
366
+ def file(self) -> File: ...
367
+ @property
318
368
  def date(self) -> SpannedStr: ...
319
369
  @property
320
370
  def account(self) -> SpannedStr: ...
@@ -326,6 +376,7 @@ class Open:
326
376
  def comment(self) -> typing.Optional[SpannedStr]: ...
327
377
  @property
328
378
  def key_values(self) -> builtins.list[KeyValue]: ...
379
+ def dump(self) -> builtins.str: ...
329
380
 
330
381
  @typing.final
331
382
  class Option:
@@ -334,9 +385,12 @@ class Option:
334
385
  @property
335
386
  def span(self) -> Span: ...
336
387
  @property
388
+ def file(self) -> File: ...
389
+ @property
337
390
  def key(self) -> SpannedStr: ...
338
391
  @property
339
392
  def value(self) -> SpannedStr: ...
393
+ def dump(self) -> builtins.str: ...
340
394
 
341
395
  @typing.final
342
396
  class Pad:
@@ -345,6 +399,8 @@ class Pad:
345
399
  @property
346
400
  def span(self) -> Span: ...
347
401
  @property
402
+ def file(self) -> File: ...
403
+ @property
348
404
  def date(self) -> SpannedStr: ...
349
405
  @property
350
406
  def account(self) -> SpannedStr: ...
@@ -354,6 +410,7 @@ class Pad:
354
410
  def comment(self) -> typing.Optional[SpannedStr]: ...
355
411
  @property
356
412
  def key_values(self) -> builtins.list[KeyValue]: ...
413
+ def dump(self) -> builtins.str: ...
357
414
 
358
415
  @typing.final
359
416
  class Plugin:
@@ -362,9 +419,12 @@ class Plugin:
362
419
  @property
363
420
  def span(self) -> Span: ...
364
421
  @property
422
+ def file(self) -> File: ...
423
+ @property
365
424
  def name(self) -> SpannedStr: ...
366
425
  @property
367
426
  def config(self) -> typing.Optional[SpannedStr]: ...
427
+ def dump(self) -> builtins.str: ...
368
428
 
369
429
  @typing.final
370
430
  class PopMeta:
@@ -373,7 +433,10 @@ class PopMeta:
373
433
  @property
374
434
  def span(self) -> Span: ...
375
435
  @property
436
+ def file(self) -> File: ...
437
+ @property
376
438
  def key(self) -> SpannedStr: ...
439
+ def dump(self) -> builtins.str: ...
377
440
 
378
441
  @typing.final
379
442
  class Posting:
@@ -382,6 +445,8 @@ class Posting:
382
445
  @property
383
446
  def span(self) -> Span: ...
384
447
  @property
448
+ def file(self) -> File: ...
449
+ @property
385
450
  def opt_flag(self) -> typing.Optional[SpannedStr]: ...
386
451
  @property
387
452
  def account(self) -> SpannedStr: ...
@@ -397,6 +462,7 @@ class Posting:
397
462
  def comment(self) -> typing.Optional[SpannedStr]: ...
398
463
  @property
399
464
  def key_values(self) -> builtins.list[KeyValue]: ...
465
+ def dump(self) -> builtins.str: ...
400
466
 
401
467
  @typing.final
402
468
  class Price:
@@ -405,6 +471,8 @@ class Price:
405
471
  @property
406
472
  def span(self) -> Span: ...
407
473
  @property
474
+ def file(self) -> File: ...
475
+ @property
408
476
  def date(self) -> SpannedStr: ...
409
477
  @property
410
478
  def currency(self) -> SpannedStr: ...
@@ -414,6 +482,7 @@ class Price:
414
482
  def comment(self) -> typing.Optional[SpannedStr]: ...
415
483
  @property
416
484
  def key_values(self) -> builtins.list[KeyValue]: ...
485
+ def dump(self) -> builtins.str: ...
417
486
 
418
487
  @typing.final
419
488
  class PushMeta:
@@ -422,9 +491,12 @@ class PushMeta:
422
491
  @property
423
492
  def span(self) -> Span: ...
424
493
  @property
494
+ def file(self) -> File: ...
495
+ @property
425
496
  def key(self) -> SpannedStr: ...
426
497
  @property
427
498
  def value(self) -> typing.Optional[SpannedKeyValueValue]: ...
499
+ def dump(self) -> builtins.str: ...
428
500
 
429
501
  @typing.final
430
502
  class Query:
@@ -433,6 +505,8 @@ class Query:
433
505
  @property
434
506
  def span(self) -> Span: ...
435
507
  @property
508
+ def file(self) -> File: ...
509
+ @property
436
510
  def date(self) -> SpannedStr: ...
437
511
  @property
438
512
  def name(self) -> SpannedStr: ...
@@ -442,6 +516,7 @@ class Query:
442
516
  def comment(self) -> typing.Optional[SpannedStr]: ...
443
517
  @property
444
518
  def key_values(self) -> builtins.list[KeyValue]: ...
519
+ def dump(self) -> builtins.str: ...
445
520
 
446
521
  @typing.final
447
522
  class Span:
@@ -455,35 +530,50 @@ class SpannedBinaryOp:
455
530
  @property
456
531
  def span(self) -> Span: ...
457
532
  @property
533
+ def file(self) -> File: ...
534
+ @property
458
535
  def content(self) -> builtins.str: ...
536
+ def dump(self) -> builtins.str: ...
459
537
 
460
538
  @typing.final
461
539
  class SpannedBool:
462
540
  @property
463
541
  def span(self) -> Span: ...
464
542
  @property
543
+ def file(self) -> File: ...
544
+ @property
465
545
  def content(self) -> builtins.bool: ...
546
+ def dump(self) -> builtins.str: ...
466
547
 
467
548
  @typing.final
468
549
  class SpannedKeyValueValue:
469
550
  @property
470
551
  def span(self) -> Span: ...
471
552
  @property
553
+ def file(self) -> File: ...
554
+ @property
472
555
  def content(self) -> KeyValueValue: ...
556
+ def dump(self) -> builtins.str: ...
473
557
 
474
558
  @typing.final
475
559
  class SpannedPriceOperator:
476
560
  @property
477
561
  def span(self) -> Span: ...
478
562
  @property
563
+ def file(self) -> File: ...
564
+ @property
479
565
  def content(self) -> builtins.str: ...
566
+ def dump(self) -> builtins.str: ...
480
567
 
481
568
  @typing.final
482
569
  class SpannedStr:
483
570
  @property
484
571
  def span(self) -> Span: ...
485
572
  @property
573
+ def file(self) -> File: ...
574
+ @property
486
575
  def content(self) -> builtins.str: ...
576
+ def dump(self) -> builtins.str: ...
487
577
 
488
578
  @typing.final
489
579
  class Tag:
@@ -492,9 +582,12 @@ class Tag:
492
582
  @property
493
583
  def span(self) -> Span: ...
494
584
  @property
585
+ def file(self) -> File: ...
586
+ @property
495
587
  def tag(self) -> SpannedStr: ...
496
588
  @property
497
589
  def action(self) -> builtins.str: ...
590
+ def dump(self) -> builtins.str: ...
498
591
 
499
592
  @typing.final
500
593
  class Transaction:
@@ -503,6 +596,8 @@ class Transaction:
503
596
  @property
504
597
  def span(self) -> Span: ...
505
598
  @property
599
+ def file(self) -> File: ...
600
+ @property
506
601
  def date(self) -> SpannedStr: ...
507
602
  @property
508
603
  def txn(self) -> typing.Optional[SpannedStr]: ...
@@ -518,11 +613,6 @@ class Transaction:
518
613
  def links(self) -> builtins.list[SpannedStr]: ...
519
614
  @property
520
615
  def comment(self) -> typing.Optional[SpannedStr]: ...
521
- @property
522
- def extra(self) -> TransactionExtra: ...
523
-
524
- @typing.final
525
- class TransactionExtra:
526
616
  @property
527
617
  def tags_links_lines(self) -> builtins.list[SpannedStr]: ...
528
618
  @property
@@ -531,8 +621,9 @@ class TransactionExtra:
531
621
  def key_values(self) -> builtins.list[KeyValue]: ...
532
622
  @property
533
623
  def postings(self) -> builtins.list[Posting]: ...
624
+ def dump(self) -> builtins.str: ...
534
625
 
535
- def parse_file(filename: builtins.str) -> builtins.list[Directive]: ...
626
+ def parse_file(filename: builtins.str) -> File: ...
536
627
  def parse_string(
537
628
  content: builtins.str, filename: builtins.str = "<string>"
538
- ) -> builtins.list[Directive]: ...
629
+ ) -> File: ...
@@ -7,7 +7,7 @@ name = "beancount_ast"
7
7
  description = "Parse Beancount content into AST"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.10"
10
- version = '0.0.1.a0'
10
+ version = '0.0.1a2'
11
11
  dependencies = []
12
12
 
13
13
  [tool.pytest.ini_options]