beancount-format 0.1.20__cp310-abi3-win_arm64.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.
- beancount_format/__init__.py +19 -0
- beancount_format/beancount_format.pyd +0 -0
- beancount_format/beancount_format.pyi +13 -0
- beancount_format/py.typed +0 -0
- beancount_format-0.1.20.dist-info/METADATA +53 -0
- beancount_format-0.1.20.dist-info/RECORD +9 -0
- beancount_format-0.1.20.dist-info/WHEEL +4 -0
- beancount_format-0.1.20.dist-info/entry_points.txt +2 -0
- beancount_format-0.1.20.dist-info/licenses/LICENSE +21 -0
|
@@ -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)))
|
|
Binary file
|
|
@@ -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: ...
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: beancount-format
|
|
3
|
+
Version: 0.1.20
|
|
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: trim21 <trim21.me@gmail.com>
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
|
+
|
|
16
|
+
# beancount-format
|
|
17
|
+
|
|
18
|
+
beancount formatter.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install beancount-format
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### as CLI
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
beancount-format ./
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### as library
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from bean_format import format_text
|
|
38
|
+
|
|
39
|
+
source = "2010-01-01 open Assets:Cash\n"
|
|
40
|
+
formatted = format_text(source)
|
|
41
|
+
print(formatted)
|
|
42
|
+
|
|
43
|
+
# Override formatter options
|
|
44
|
+
formatted = format_text(
|
|
45
|
+
source,
|
|
46
|
+
path="ledger.beancount", # defaults to "<memory>"
|
|
47
|
+
line_width=88,
|
|
48
|
+
indent_width=2,
|
|
49
|
+
new_line="lf", # "lf" or "crlf"
|
|
50
|
+
)
|
|
51
|
+
print(formatted)
|
|
52
|
+
```
|
|
53
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
beancount_format\__init__.py,sha256=GYBS_NvuD559RoIzeh7wi4OOATQLrCUr-6hCpg9LWSY,447
|
|
2
|
+
beancount_format\beancount_format.pyd,sha256=cSu9rp2D2MUzON3xhbikWoSbz1GKtfBbSq8IfwokNJo,988672
|
|
3
|
+
beancount_format\beancount_format.pyi,sha256=SHJAQu4Obh0xe7pmRNuCVd5X1RuJQaJ6RTECw9eot-I,311
|
|
4
|
+
beancount_format\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
beancount_format-0.1.20.dist-info\METADATA,sha256=lwYQn1TNbsrlqvqRYrfj76nRghtxgjy3kFW1N3sJ-_g,1102
|
|
6
|
+
beancount_format-0.1.20.dist-info\WHEEL,sha256=MufjGu_63ruR8ZgxzOhetQW9p_leDU_zsBcxlIi9DWc,96
|
|
7
|
+
beancount_format-0.1.20.dist-info\entry_points.txt,sha256=iu-c3K79nbksocHF9A20qANbf6CzHsy1mgwI5v--Qtc,57
|
|
8
|
+
beancount_format-0.1.20.dist-info\licenses\LICENSE,sha256=qiHDPsn9gk1mWu9H0jruuBX3DI8Ipr4GZPk6DKpMl08,1085
|
|
9
|
+
beancount_format-0.1.20.dist-info\RECORD,,
|
|
@@ -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.
|