codapact-ynab 0.2.0__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.
- codapact_ynab-0.2.0/LICENSE +21 -0
- codapact_ynab-0.2.0/PKG-INFO +89 -0
- codapact_ynab-0.2.0/README.md +67 -0
- codapact_ynab-0.2.0/codapact.yaml +13 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/__init__.py +6 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/__main__.py +6 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/_model.json +11304 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/cli.py +573 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/client.py +475 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/py.typed +0 -0
- codapact_ynab-0.2.0/gen/python/src/codapact_ynab/types.py +1365 -0
- codapact_ynab-0.2.0/gen/python/tests/e2e.json +945 -0
- codapact_ynab-0.2.0/gen/python/tests/test_e2e.py +32 -0
- codapact_ynab-0.2.0/openapi.yaml +4033 -0
- codapact_ynab-0.2.0/pyproject.toml +58 -0
- codapact_ynab-0.2.0/pyproject.toml.orig +45 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mike Hill
|
|
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,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codapact-ynab
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Typed Python client and `ynab` CLI for the YNAB API, generated by Codapact
|
|
5
|
+
Keywords: ynab,budget,cli,api-client,codapact
|
|
6
|
+
Author: Mike Hill
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Dist: codapact[keyring]>=0.8.0,<0.9
|
|
16
|
+
Requires-Python: >=3.13
|
|
17
|
+
Project-URL: Homepage, https://github.com/mikejhill/codapact-ynab
|
|
18
|
+
Project-URL: Repository, https://github.com/mikejhill/codapact-ynab
|
|
19
|
+
Project-URL: Issues, https://github.com/mikejhill/codapact-ynab/issues
|
|
20
|
+
Project-URL: Generator, https://github.com/mikejhill/codapact
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# codapact-ynab
|
|
24
|
+
|
|
25
|
+
The **YNAB coda**: a typed Python client and `ynab` command-line tool for the
|
|
26
|
+
[YNAB API](https://api.ynab.com/), generated from YNAB's OpenAPI contract by
|
|
27
|
+
[Codapact](https://github.com/mikejhill/codapact).
|
|
28
|
+
|
|
29
|
+
Replaces `ynab-api-cli`, which is no longer maintained.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```console
|
|
34
|
+
uv tool install codapact-ynab # or: pipx install codapact-ynab
|
|
35
|
+
ynab --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Requires Python 3.13+.
|
|
39
|
+
|
|
40
|
+
## Credentials
|
|
41
|
+
|
|
42
|
+
Create a personal access token under YNAB **Account Settings → Developer Settings**, then either:
|
|
43
|
+
|
|
44
|
+
```console
|
|
45
|
+
ynab auth login # saves it in the OS keyring
|
|
46
|
+
ynab doctor # checks settings, credentials, and connectivity
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
or set `YNAB_BEARER` in the environment. `YNAB_BEARER_COMMAND` runs a command that prints
|
|
50
|
+
the token (for example a password manager).
|
|
51
|
+
|
|
52
|
+
## Use
|
|
53
|
+
|
|
54
|
+
```console
|
|
55
|
+
ynab plans list
|
|
56
|
+
ynab accounts list -o table
|
|
57
|
+
ynab transactions list --since-date 2026-01-01 --query 'data.transactions[].payee_name'
|
|
58
|
+
ynab describe --brief # every command, for scripts and agents
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`--plan-id` defaults to `last-used`. `--dry-run` prints the HTTP request without sending it;
|
|
62
|
+
commands that delete ask for confirmation (or `--yes`).
|
|
63
|
+
|
|
64
|
+
As a library:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from codapact_ynab import Client
|
|
68
|
+
|
|
69
|
+
client = Client()
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## How this repository works
|
|
73
|
+
|
|
74
|
+
| Path | What it is |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `openapi.yaml` | YNAB's contract, pinned (currently API 1.91.0) |
|
|
77
|
+
| `codapact.yaml` | Codapact project file: shaping rules and targets |
|
|
78
|
+
| `gen/python/` | Generated code and tests. Do not edit; regenerate |
|
|
79
|
+
| `pyproject.toml` | Hand-written packaging: PyPI metadata and the release version |
|
|
80
|
+
|
|
81
|
+
```console
|
|
82
|
+
uvx codapact==0.8.0 sync --check # has YNAB published a new contract?
|
|
83
|
+
uvx codapact==0.8.0 sync # pull it into openapi.yaml
|
|
84
|
+
uvx codapact==0.8.0 generate # regenerate gen/python
|
|
85
|
+
uv run pytest # offline tests
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
CI fails if `gen/python` differs from what the pinned Codapact produces. Releases are cut by
|
|
89
|
+
release-please and published to PyPI through trusted publishing.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# codapact-ynab
|
|
2
|
+
|
|
3
|
+
The **YNAB coda**: a typed Python client and `ynab` command-line tool for the
|
|
4
|
+
[YNAB API](https://api.ynab.com/), generated from YNAB's OpenAPI contract by
|
|
5
|
+
[Codapact](https://github.com/mikejhill/codapact).
|
|
6
|
+
|
|
7
|
+
Replaces `ynab-api-cli`, which is no longer maintained.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
uv tool install codapact-ynab # or: pipx install codapact-ynab
|
|
13
|
+
ynab --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Requires Python 3.13+.
|
|
17
|
+
|
|
18
|
+
## Credentials
|
|
19
|
+
|
|
20
|
+
Create a personal access token under YNAB **Account Settings → Developer Settings**, then either:
|
|
21
|
+
|
|
22
|
+
```console
|
|
23
|
+
ynab auth login # saves it in the OS keyring
|
|
24
|
+
ynab doctor # checks settings, credentials, and connectivity
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
or set `YNAB_BEARER` in the environment. `YNAB_BEARER_COMMAND` runs a command that prints
|
|
28
|
+
the token (for example a password manager).
|
|
29
|
+
|
|
30
|
+
## Use
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
ynab plans list
|
|
34
|
+
ynab accounts list -o table
|
|
35
|
+
ynab transactions list --since-date 2026-01-01 --query 'data.transactions[].payee_name'
|
|
36
|
+
ynab describe --brief # every command, for scripts and agents
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`--plan-id` defaults to `last-used`. `--dry-run` prints the HTTP request without sending it;
|
|
40
|
+
commands that delete ask for confirmation (or `--yes`).
|
|
41
|
+
|
|
42
|
+
As a library:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from codapact_ynab import Client
|
|
46
|
+
|
|
47
|
+
client = Client()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## How this repository works
|
|
51
|
+
|
|
52
|
+
| Path | What it is |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `openapi.yaml` | YNAB's contract, pinned (currently API 1.91.0) |
|
|
55
|
+
| `codapact.yaml` | Codapact project file: shaping rules and targets |
|
|
56
|
+
| `gen/python/` | Generated code and tests. Do not edit; regenerate |
|
|
57
|
+
| `pyproject.toml` | Hand-written packaging: PyPI metadata and the release version |
|
|
58
|
+
|
|
59
|
+
```console
|
|
60
|
+
uvx codapact==0.8.0 sync --check # has YNAB published a new contract?
|
|
61
|
+
uvx codapact==0.8.0 sync # pull it into openapi.yaml
|
|
62
|
+
uvx codapact==0.8.0 generate # regenerate gen/python
|
|
63
|
+
uv run pytest # offline tests
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
CI fails if `gen/python` differs from what the pinned Codapact produces. Releases are cut by
|
|
67
|
+
release-please and published to PyPI through trusted publishing.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
source:
|
|
3
|
+
type: openapi
|
|
4
|
+
path: openapi.yaml
|
|
5
|
+
upstream: https://api.ynab.com/papi/open_api_spec.yaml # codapact sync / sync --check
|
|
6
|
+
shape:
|
|
7
|
+
- group: {by: tag}
|
|
8
|
+
- defaults:
|
|
9
|
+
params: {"*.plan_id": last-used}
|
|
10
|
+
cli: {program: ynab}
|
|
11
|
+
targets:
|
|
12
|
+
- {name: python, output: gen/python, options: {package: codapact_ynab, distribution: codapact-ynab}}
|
|
13
|
+
- {name: python-cli, output: gen/python}
|