Skip to content

Commit 54c3fe8

Browse files
authored
Use cog to autogenerate README (#19)
1 parent e244612 commit 54c3fe8

File tree

3 files changed

+151
-54
lines changed

3 files changed

+151
-54
lines changed

README.md

+138-53
Original file line numberDiff line numberDiff line change
@@ -25,66 +25,151 @@ Examples below leverage the SimpleFIN Bridge Demo Access URL of `https://demo:de
2525

2626
#### Get accounts
2727

28-
❯ simplefin accounts
29-
SimpleFIN Accounts
30-
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
31-
┃ Institution ┃ Account ┃ Balance ┃ Account ID ┃
32-
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
33-
│ SimpleFIN Demo │ SimpleFIN Savings │ 114125.50 │ Demo Savings │
34-
│ SimpleFIN Demo │ SimpleFIN Checking │ 24302.22 │ Demo Checking │
35-
└────────────────┴────────────────────┴───────────┴───────────────┘
28+
`simplefin accounts [--format FORMAT]`
29+
30+
<!-- [[[cog
31+
import cog
32+
from simplefin import cli
33+
from click.testing import CliRunner
34+
runner = CliRunner()
35+
result = runner.invoke(cli, ["accounts"])
36+
cog.out(
37+
"```\n❯ simplefin accounts\n{}```".format(result.output)
38+
)
39+
]]] -->
40+
```
41+
❯ simplefin accounts
42+
SimpleFIN Accounts
43+
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
44+
┃ Institution ┃ Account ┃ Balance ┃ Account ID ┃
45+
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
46+
│ SimpleFIN Demo │ SimpleFIN Savings │ 115525.50 │ Demo Savings │
47+
│ SimpleFIN Demo │ SimpleFIN Checking │ 26134.42 │ Demo Checking │
48+
└────────────────┴────────────────────┴───────────┴───────────────┘
49+
```
50+
<!-- [[[end]]] -->
51+
52+
##### JSON output
53+
54+
<!-- [[[cog
55+
import cog
56+
from simplefin import cli
57+
from click.testing import CliRunner
58+
runner = CliRunner()
59+
result = runner.invoke(cli, ["accounts", "--format", "json"])
60+
cog.out(
61+
"```\n❯ simplefin accounts --format json\n{}```".format(result.output)
62+
)
63+
]]] -->
64+
```
65+
❯ simplefin accounts --format json
66+
[
67+
{
68+
"org": {
69+
"domain": "beta-bridge.simplefin.org",
70+
"sfin-url": "https://beta-bridge.simplefin.org/simplefin",
71+
"name": "SimpleFIN Demo",
72+
"url": "https://beta-bridge.simplefin.org",
73+
"id": "simplefin.demoorg"
74+
},
75+
"id": "Demo Savings",
76+
"name": "SimpleFIN Savings",
77+
"currency": "USD",
78+
"balance": "115525.50",
79+
"available-balance": "115525.50",
80+
"balance-date": 1738368000,
81+
"transactions": [],
82+
"holdings": []
83+
},
84+
{
85+
"org": {
86+
"domain": "beta-bridge.simplefin.org",
87+
"sfin-url": "https://beta-bridge.simplefin.org/simplefin",
88+
"name": "SimpleFIN Demo",
89+
"url": "https://beta-bridge.simplefin.org",
90+
"id": "simplefin.demoorg"
91+
},
92+
"id": "Demo Checking",
93+
"name": "SimpleFIN Checking",
94+
"currency": "USD",
95+
"balance": "26134.42",
96+
"available-balance": "26134.42",
97+
"balance-date": 1738368000,
98+
"transactions": [],
99+
"holdings": []
100+
}
101+
]
102+
```
103+
<!-- [[[end]]] -->
36104

37105
#### Get transactions for an account
38106

39107
`simplefin transactions ACCOUNT_ID [--format FORMAT] [--lookback-days INTEGER]`
40108

41-
❯ simplefin transactions "Demo Savings"
42-
Transactions for Demo Savings
43-
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
44-
┃ Date ┃ Payee ┃ Amount ┃
45-
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
46-
│ 10 Jan 2025 │ John's Fishin Shack │ -50.00 │
47-
│ 10 Jan 2025 │ Grocery store │ -90.00 │
48-
│ 11 Jan 2025 │ John's Fishin Shack │ -55.50 │
49-
│ 11 Jan 2025 │ Grocery store │ -85.50 │
50-
└─────────────┴─────────────────────┴────────┘
109+
<!-- [[[cog
110+
import cog
111+
from simplefin import cli
112+
from click.testing import CliRunner
113+
runner = CliRunner()
114+
result = runner.invoke(cli, ["transactions", "Demo Savings", "--lookback-days", 1])
115+
cog.out(
116+
"```\n❯ simplefin transactions \"Demo Savings\"\n{}```".format(result.output)
117+
)
118+
]]] -->
119+
```
120+
❯ simplefin transactions "Demo Savings"
121+
Transactions for Demo Savings
122+
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
123+
┃ Date ┃ Payee ┃ Amount ┃
124+
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
125+
│ 01 Feb 2025 │ You │ 1960.00 │
126+
│ 01 Feb 2025 │ John's Fishin Shack │ -05.50 │
127+
│ 01 Feb 2025 │ Grocery store │ -135.50 │
128+
└─────────────┴─────────────────────┴─────────┘
129+
```
130+
<!-- [[[end]]] -->
51131

52132
##### JSON output
53133

54134
We convert the posted and transacted_at, if provided, values into ISO strings.
55135

56-
❯ simplefin transactions "Demo Savings" --format json
57-
[
58-
{
59-
"id": "1736496000",
60-
"posted": "2025-01-10T08:00:00+00:00",
61-
"amount": "-50.00",
62-
"description": "Fishing bait",
63-
"payee": "John's Fishin Shack",
64-
"memo": "JOHNS FISHIN SHACK BAIT"
65-
},
66-
{
67-
"id": "1736524800",
68-
"posted": "2025-01-10T16:00:00+00:00",
69-
"amount": "-90.00",
70-
"description": "Grocery store",
71-
"payee": "Grocery store",
72-
"memo": "LOCAL GROCER STORE #1133"
73-
},
74-
{
75-
"id": "1736582400",
76-
"posted": "2025-01-11T08:00:00+00:00",
77-
"amount": "-55.50",
78-
"description": "Fishing bait",
79-
"payee": "John's Fishin Shack",
80-
"memo": "JOHNS FISHIN SHACK BAIT"
81-
},
82-
{
83-
"id": "1736611200",
84-
"posted": "2025-01-11T16:00:00+00:00",
85-
"amount": "-85.50",
86-
"description": "Grocery store",
87-
"payee": "Grocery store",
88-
"memo": "LOCAL GROCER STORE #1133"
89-
}
90-
]
136+
<!-- [[[cog
137+
import cog
138+
from simplefin import cli
139+
from click.testing import CliRunner
140+
runner = CliRunner()
141+
result = runner.invoke(cli, ["transactions", "Demo Savings", "--format", "json", "--lookback-days", 1])
142+
cog.out(
143+
"```\n❯ simplefin transactions \"Demo Savings\" --format json\n{}```".format(result.output)
144+
)
145+
]]] -->
146+
```
147+
❯ simplefin transactions "Demo Savings" --format json
148+
[
149+
{
150+
"id": "1738382400",
151+
"posted": "2025-02-01T04:00:00+00:00",
152+
"amount": "1960.00",
153+
"description": "Pay day!",
154+
"payee": "You",
155+
"memo": "PAY DAY - FROM YER JOB"
156+
},
157+
{
158+
"id": "1738396800",
159+
"posted": "2025-02-01T08:00:00+00:00",
160+
"amount": "-05.50",
161+
"description": "Fishing bait",
162+
"payee": "John's Fishin Shack",
163+
"memo": "JOHNS FISHIN SHACK BAIT"
164+
},
165+
{
166+
"id": "1738425600",
167+
"posted": "2025-02-01T16:00:00+00:00",
168+
"amount": "-135.50",
169+
"description": "Grocery store",
170+
"payee": "Grocery store",
171+
"memo": "LOCAL GROCER STORE #1133"
172+
}
173+
]
174+
```
175+
<!-- [[[end]]] -->

pyproject.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ build-backend = "hatchling.build"
2222

2323
[dependency-groups]
2424
dev = [
25+
"cogapp>=3.4.1",
2526
"pytest>=8.3.4",
2627
"pytest-httpx>=0.35.0",
2728
"ruff>=0.9.0",
@@ -32,4 +33,4 @@ source = "vcs"
3233
raw-options = { local_scheme = "no-local-version" }
3334

3435
[tool.hatch.build.targets.wheel]
35-
packages = ["src/simplefin"]
36+
packages = ["src/simplefin"]

uv.lock

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)