beancount-format 0.1.14__cp310-abi3-macosx_10_12_x86_64.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,19 @@
1
+ """Python bindings for the beancount formatter."""
2
+
3
+ import sys
4
+
5
+ from .beancount_format import ( # pyright: ignore[reportMissingModuleSource]
6
+ format_text,
7
+ main as _main,
8
+ )
9
+
10
+ __all__ = ["format_text", "main"]
11
+
12
+
13
+ def main(argv: list[str] | None = None) -> None:
14
+ """Run the CLI via the Rust backend.
15
+
16
+ Returns an exit code (0 when everything is formatted, 1 when changes are needed).
17
+ """
18
+
19
+ sys.exit(_main(list(argv or sys.argv)))
@@ -0,0 +1,13 @@
1
+ from typing import Optional, Sequence
2
+
3
+ __all__ = ["format_text", "main"]
4
+
5
+ def format_text(
6
+ text: str,
7
+ *,
8
+ path: Optional[str] = ...,
9
+ line_width: Optional[int] = ...,
10
+ indent_width: Optional[int] = ...,
11
+ new_line: Optional[str] = ...,
12
+ ) -> str: ...
13
+ def main(argv: Sequence[str]) -> int: ...
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: beancount-format
3
+ Version: 0.1.14
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3 :: Only
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ License-File: LICENSE
10
+ Summary: Beancount formatter powered by dprint-plugin-beancount
11
+ Home-Page: https://github.com/trim21/beancount-format
12
+ Author-email: David Sherret <dsherret@gmail.com>
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
15
+
16
+ # beancount-format
17
+
18
+ Python package wrapping the Rust `dprint-plugin-beancount` formatter.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ pip install beancount-format
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```python
29
+ from bean_format import format_text
30
+
31
+ source = "2010-01-01 open Assets:Cash\n"
32
+ formatted = format_text(source)
33
+ print(formatted)
34
+
35
+ # Override formatter options
36
+ formatted = format_text(
37
+ source,
38
+ path="ledger.beancount", # defaults to "<memory>"
39
+ line_width=88,
40
+ indent_width=2,
41
+ new_line="lf", # "lf" or "crlf"
42
+ )
43
+ print(formatted)
44
+ ```
45
+
@@ -0,0 +1,8 @@
1
+ beancount_format/__init__.py,sha256=GYBS_NvuD559RoIzeh7wi4OOATQLrCUr-6hCpg9LWSY,447
2
+ beancount_format/beancount_format.abi3.so,sha256=XMuoCZIo6KGPTh_uzV3ZNg4DfVRVbBeLCIj5Km8gF40,1249392
3
+ beancount_format/beancount_format.pyi,sha256=SHJAQu4Obh0xe7pmRNuCVd5X1RuJQaJ6RTECw9eot-I,311
4
+ beancount_format-0.1.14.dist-info/METADATA,sha256=8Z8DqLd6RjefEAIsgWUBzOvFwCaKvAyue6U_h2Srxq8,1096
5
+ beancount_format-0.1.14.dist-info/WHEEL,sha256=fbUzIEUvF2NEGRA2O2XBICD_Rkiz6hg6p-tg6XNS85Q,106
6
+ beancount_format-0.1.14.dist-info/entry_points.txt,sha256=iu-c3K79nbksocHF9A20qANbf6CzHsy1mgwI5v--Qtc,57
7
+ beancount_format-0.1.14.dist-info/licenses/LICENSE,sha256=qiHDPsn9gk1mWu9H0jruuBX3DI8Ipr4GZPk6DKpMl08,1085
8
+ beancount_format-0.1.14.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.11.5)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-abi3-macosx_10_12_x86_64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ beancount-format=beancount_format:main
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020-2021 David Sherret
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.