dao-treasury 0.0.68__cp311-cp311-win32.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.

Potentially problematic release.


This version of dao-treasury might be problematic. Click here for more details.

Files changed (54) hide show
  1. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Expenses.json +452 -0
  2. dao_treasury/.grafana/provisioning/dashboards/breakdowns/Revenue.json +452 -0
  3. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +84 -0
  4. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +220 -0
  5. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +106 -0
  6. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +357 -0
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +803 -0
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +597 -0
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Current Treasury Assets.json +981 -0
  10. dao_treasury/.grafana/provisioning/dashboards/treasury/Historical Treasury Balances.json +2961 -0
  11. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +475 -0
  12. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
  13. dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
  14. dao_treasury/__init__.py +62 -0
  15. dao_treasury/_docker.cp311-win32.pyd +0 -0
  16. dao_treasury/_docker.py +194 -0
  17. dao_treasury/_nicknames.cp311-win32.pyd +0 -0
  18. dao_treasury/_nicknames.py +32 -0
  19. dao_treasury/_wallet.cp311-win32.pyd +0 -0
  20. dao_treasury/_wallet.py +250 -0
  21. dao_treasury/constants.cp311-win32.pyd +0 -0
  22. dao_treasury/constants.py +39 -0
  23. dao_treasury/db.py +1454 -0
  24. dao_treasury/docker-compose.yaml +41 -0
  25. dao_treasury/main.py +253 -0
  26. dao_treasury/py.typed +0 -0
  27. dao_treasury/sorting/__init__.cp311-win32.pyd +0 -0
  28. dao_treasury/sorting/__init__.py +295 -0
  29. dao_treasury/sorting/_matchers.cp311-win32.pyd +0 -0
  30. dao_treasury/sorting/_matchers.py +387 -0
  31. dao_treasury/sorting/_rules.cp311-win32.pyd +0 -0
  32. dao_treasury/sorting/_rules.py +235 -0
  33. dao_treasury/sorting/factory.cp311-win32.pyd +0 -0
  34. dao_treasury/sorting/factory.py +299 -0
  35. dao_treasury/sorting/rule.cp311-win32.pyd +0 -0
  36. dao_treasury/sorting/rule.py +344 -0
  37. dao_treasury/sorting/rules/__init__.cp311-win32.pyd +0 -0
  38. dao_treasury/sorting/rules/__init__.py +1 -0
  39. dao_treasury/sorting/rules/ignore/__init__.cp311-win32.pyd +0 -0
  40. dao_treasury/sorting/rules/ignore/__init__.py +1 -0
  41. dao_treasury/sorting/rules/ignore/llamapay.cp311-win32.pyd +0 -0
  42. dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
  43. dao_treasury/streams/__init__.cp311-win32.pyd +0 -0
  44. dao_treasury/streams/__init__.py +0 -0
  45. dao_treasury/streams/llamapay.cp311-win32.pyd +0 -0
  46. dao_treasury/streams/llamapay.py +388 -0
  47. dao_treasury/treasury.py +191 -0
  48. dao_treasury/types.cp311-win32.pyd +0 -0
  49. dao_treasury/types.py +133 -0
  50. dao_treasury-0.0.68.dist-info/METADATA +120 -0
  51. dao_treasury-0.0.68.dist-info/RECORD +54 -0
  52. dao_treasury-0.0.68.dist-info/WHEEL +5 -0
  53. dao_treasury-0.0.68.dist-info/top_level.txt +2 -0
  54. dao_treasury__mypyc.cp311-win32.pyd +0 -0
@@ -0,0 +1,452 @@
1
+ {
2
+ "annotations": {
3
+ "list": [
4
+ {
5
+ "builtIn": 1,
6
+ "datasource": {
7
+ "type": "grafana",
8
+ "uid": "-- Grafana --"
9
+ },
10
+ "enable": true,
11
+ "hide": true,
12
+ "iconColor": "rgba(0, 211, 255, 1)",
13
+ "name": "Annotations & Alerts",
14
+ "type": "dashboard"
15
+ }
16
+ ]
17
+ },
18
+ "description": "Shows a breakdown of expenses over time.",
19
+ "editable": true,
20
+ "fiscalYearStartMonth": 0,
21
+ "graphTooltip": 1,
22
+ "id": 5,
23
+ "links": [],
24
+ "panels": [
25
+ {
26
+ "datasource": "SQLite",
27
+ "fieldConfig": {
28
+ "defaults": {
29
+ "color": {
30
+ "mode": "thresholds"
31
+ },
32
+ "mappings": [],
33
+ "thresholds": {
34
+ "mode": "absolute",
35
+ "steps": [
36
+ {
37
+ "color": "green",
38
+ "value": 0
39
+ },
40
+ {
41
+ "color": "red",
42
+ "value": 80
43
+ }
44
+ ]
45
+ },
46
+ "unit": "currencyUSD"
47
+ },
48
+ "overrides": []
49
+ },
50
+ "gridPos": {
51
+ "h": 4,
52
+ "w": 6,
53
+ "x": 0,
54
+ "y": 0
55
+ },
56
+ "id": 1,
57
+ "options": {
58
+ "colorMode": "value",
59
+ "graphMode": "area",
60
+ "justifyMode": "auto",
61
+ "orientation": "auto",
62
+ "percentChangeColorMode": "standard",
63
+ "reduceOptions": {
64
+ "calcs": ["lastNotNull"],
65
+ "fields": "",
66
+ "values": false
67
+ },
68
+ "showPercentChange": false,
69
+ "textMode": "auto",
70
+ "wideLayout": true
71
+ },
72
+ "pluginVersion": "12.2.0",
73
+ "targets": [
74
+ {
75
+ "datasource": "SQLite",
76
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
77
+ "queryType": "table",
78
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
79
+ "refId": "A",
80
+ "timeColumns": ["time", "ts"]
81
+ }
82
+ ],
83
+ "title": "Expenses",
84
+ "type": "stat"
85
+ },
86
+ {
87
+ "datasource": "SQLite",
88
+ "fieldConfig": {
89
+ "defaults": {
90
+ "color": {
91
+ "mode": "thresholds"
92
+ },
93
+ "mappings": [],
94
+ "thresholds": {
95
+ "mode": "absolute",
96
+ "steps": [
97
+ {
98
+ "color": "green",
99
+ "value": 0
100
+ },
101
+ {
102
+ "color": "red",
103
+ "value": 80
104
+ }
105
+ ]
106
+ },
107
+ "unit": "currencyUSD"
108
+ },
109
+ "overrides": []
110
+ },
111
+ "gridPos": {
112
+ "h": 4,
113
+ "w": 6,
114
+ "x": 6,
115
+ "y": 0
116
+ },
117
+ "id": 4,
118
+ "options": {
119
+ "colorMode": "value",
120
+ "graphMode": "area",
121
+ "justifyMode": "auto",
122
+ "orientation": "auto",
123
+ "percentChangeColorMode": "standard",
124
+ "reduceOptions": {
125
+ "calcs": ["lastNotNull"],
126
+ "fields": "",
127
+ "values": false
128
+ },
129
+ "showPercentChange": false,
130
+ "textMode": "auto",
131
+ "wideLayout": true
132
+ },
133
+ "pluginVersion": "12.2.0",
134
+ "targets": [
135
+ {
136
+ "datasource": "SQLite",
137
+ "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 30.436875)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
138
+ "queryType": "table",
139
+ "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 30.436875)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
140
+ "refId": "A",
141
+ "timeColumns": ["time", "ts"]
142
+ }
143
+ ],
144
+ "title": "Monthly Expenses",
145
+ "type": "stat"
146
+ },
147
+ {
148
+ "datasource": "SQLite",
149
+ "fieldConfig": {
150
+ "defaults": {
151
+ "color": {
152
+ "mode": "thresholds"
153
+ },
154
+ "mappings": [],
155
+ "thresholds": {
156
+ "mode": "absolute",
157
+ "steps": [
158
+ {
159
+ "color": "green",
160
+ "value": 0
161
+ },
162
+ {
163
+ "color": "red",
164
+ "value": 80
165
+ }
166
+ ]
167
+ },
168
+ "unit": "currencyUSD"
169
+ },
170
+ "overrides": []
171
+ },
172
+ "gridPos": {
173
+ "h": 4,
174
+ "w": 6,
175
+ "x": 12,
176
+ "y": 0
177
+ },
178
+ "id": 2,
179
+ "options": {
180
+ "colorMode": "value",
181
+ "graphMode": "area",
182
+ "justifyMode": "auto",
183
+ "orientation": "auto",
184
+ "percentChangeColorMode": "standard",
185
+ "reduceOptions": {
186
+ "calcs": ["lastNotNull"],
187
+ "fields": "",
188
+ "values": false
189
+ },
190
+ "showPercentChange": false,
191
+ "textMode": "auto",
192
+ "wideLayout": true
193
+ },
194
+ "pluginVersion": "12.2.0",
195
+ "targets": [
196
+ {
197
+ "datasource": "SQLite",
198
+ "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 7)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
199
+ "queryType": "table",
200
+ "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24 / 7)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
201
+ "refId": "A",
202
+ "timeColumns": ["time", "ts"]
203
+ }
204
+ ],
205
+ "title": "Weekly Expenses",
206
+ "type": "stat"
207
+ },
208
+ {
209
+ "datasource": "SQLite",
210
+ "fieldConfig": {
211
+ "defaults": {
212
+ "color": {
213
+ "mode": "thresholds"
214
+ },
215
+ "mappings": [],
216
+ "thresholds": {
217
+ "mode": "absolute",
218
+ "steps": [
219
+ {
220
+ "color": "green",
221
+ "value": 0
222
+ },
223
+ {
224
+ "color": "red",
225
+ "value": 80
226
+ }
227
+ ]
228
+ },
229
+ "unit": "currencyUSD"
230
+ },
231
+ "overrides": []
232
+ },
233
+ "gridPos": {
234
+ "h": 4,
235
+ "w": 6,
236
+ "x": 18,
237
+ "y": 0
238
+ },
239
+ "id": 3,
240
+ "options": {
241
+ "colorMode": "value",
242
+ "graphMode": "area",
243
+ "justifyMode": "auto",
244
+ "orientation": "auto",
245
+ "percentChangeColorMode": "standard",
246
+ "reduceOptions": {
247
+ "calcs": ["lastNotNull"],
248
+ "fields": "",
249
+ "values": false
250
+ },
251
+ "showPercentChange": false,
252
+ "textMode": "auto",
253
+ "wideLayout": true
254
+ },
255
+ "pluginVersion": "12.2.0",
256
+ "targets": [
257
+ {
258
+ "datasource": "SQLite",
259
+ "queryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
260
+ "queryType": "table",
261
+ "rawQueryText": "SELECT SUM(t.value_usd) / ((($__to - $__from) / 1000.0 / 60 / 60 / 24)) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) inner join txgroups g USING (txgroup_id) WHERE gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring})",
262
+ "refId": "A",
263
+ "timeColumns": ["time", "ts"]
264
+ }
265
+ ],
266
+ "title": "Daily Expenses",
267
+ "type": "stat"
268
+ },
269
+ {
270
+ "datasource": "SQLite",
271
+ "description": "",
272
+ "fieldConfig": {
273
+ "defaults": {
274
+ "color": {
275
+ "mode": "palette-classic"
276
+ },
277
+ "custom": {
278
+ "axisBorderShow": false,
279
+ "axisCenteredZero": false,
280
+ "axisColorMode": "text",
281
+ "axisLabel": "",
282
+ "axisPlacement": "auto",
283
+ "barAlignment": 0,
284
+ "barWidthFactor": 0.6,
285
+ "drawStyle": "bars",
286
+ "fillOpacity": 70,
287
+ "gradientMode": "none",
288
+ "hideFrom": {
289
+ "legend": false,
290
+ "tooltip": false,
291
+ "viz": false
292
+ },
293
+ "insertNulls": false,
294
+ "lineInterpolation": "linear",
295
+ "lineWidth": 1,
296
+ "pointSize": 5,
297
+ "scaleDistribution": {
298
+ "type": "linear"
299
+ },
300
+ "showPoints": "auto",
301
+ "showValues": false,
302
+ "spanNulls": false,
303
+ "stacking": {
304
+ "group": "A",
305
+ "mode": "normal"
306
+ },
307
+ "thresholdsStyle": {
308
+ "mode": "off"
309
+ }
310
+ },
311
+ "mappings": [],
312
+ "thresholds": {
313
+ "mode": "absolute",
314
+ "steps": [
315
+ {
316
+ "color": "green",
317
+ "value": 0
318
+ },
319
+ {
320
+ "color": "red",
321
+ "value": 80
322
+ }
323
+ ]
324
+ },
325
+ "unit": "currencyUSD"
326
+ },
327
+ "overrides": []
328
+ },
329
+ "gridPos": {
330
+ "h": 12,
331
+ "w": 24,
332
+ "x": 0,
333
+ "y": 4
334
+ },
335
+ "id": 11,
336
+ "type": "timeseries",
337
+ "options": {
338
+ "legend": {
339
+ "calcs": ["sum"],
340
+ "displayMode": "list",
341
+ "placement": "bottom",
342
+ "showLegend": true
343
+ },
344
+ "tooltip": {
345
+ "hideZeros": false,
346
+ "mode": "single",
347
+ "sort": "none"
348
+ }
349
+ },
350
+ "pluginVersion": "12.2.0",
351
+ "targets": [
352
+ {
353
+ "datasource": "SQLite",
354
+ "queryText": "SELECT t.timestamp, g.name AS \"TxGroup\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Expenses\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id INNER JOIN txgroups g USING (txgroup_id) WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring}) GROUP BY t.timestamp, g.name ORDER BY t.timestamp;",
355
+ "queryType": "table",
356
+ "rawQueryText": "SELECT t.timestamp, g.name AS \"TxGroup\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue', 'Expenses', 'Other Expense') THEN t.value_usd ELSE 0 END) AS \"Expenses\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id INNER JOIN txgroups g USING (txgroup_id) WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 AND g.name IN (${Txgroup:sqlstring}) GROUP BY t.timestamp, g.name ORDER BY t.timestamp;",
357
+ "refId": "A",
358
+ "timeColumns": ["timestamp"]
359
+ }
360
+ ],
361
+ "title": "Weekly Cashflow",
362
+ "transformations": [
363
+ {
364
+ "id": "formatTime",
365
+ "options": {
366
+ "outputFormat": "YYYY-WW",
367
+ "timeField": "timestamp",
368
+ "timezone": "browser",
369
+ "useTimezone": true
370
+ }
371
+ },
372
+ {
373
+ "id": "convertFieldType",
374
+ "options": {
375
+ "conversions": [
376
+ {
377
+ "dateFormat": "YYYY-WW",
378
+ "destinationType": "time",
379
+ "targetField": "timestamp"
380
+ }
381
+ ],
382
+ "fields": {}
383
+ }
384
+ },
385
+ {
386
+ "id": "groupBy",
387
+ "options": {
388
+ "fields": {
389
+ "TxGroup": {
390
+ "aggregations": [],
391
+ "operation": "groupby"
392
+ },
393
+ "Expenses": {
394
+ "aggregations": ["sum"],
395
+ "operation": "aggregate"
396
+ },
397
+ "timestamp": {
398
+ "aggregations": [],
399
+ "operation": "groupby"
400
+ }
401
+ }
402
+ }
403
+ },
404
+ {
405
+ "id": "partitionByValues",
406
+ "options": {
407
+ "fields": ["TxGroup"],
408
+ "keepFields": false,
409
+ "naming": {
410
+ "asLabels": false
411
+ }
412
+ }
413
+ }
414
+ ]
415
+ }
416
+ ],
417
+ "preload": false,
418
+ "refresh": "",
419
+ "schemaVersion": 42,
420
+ "tags": [],
421
+ "templating": {
422
+ "list": [
423
+ {
424
+ "allowCustomValue": true,
425
+ "current": {
426
+ "text": "All",
427
+ "value": "$__all"
428
+ },
429
+ "definition": "SELECT DISTINCT t.name FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id LEFT JOIN txgroups t ON gh.txgroup_id = t.txgroup_id WHERE (gh.top_category = 'Expenses' OR gh.top_category = 'Cost of Revenue' OR gh.top_category = 'Other Expense') AND a.timestamp >= $__from/1000 AND a.timestamp <= $__to/1000;",
430
+ "description": "",
431
+ "includeAll": true,
432
+ "label": "Tx Group",
433
+ "name": "Txgroup",
434
+ "options": [],
435
+ "query": "SELECT DISTINCT t.name FROM treasury_txs a INNER JOIN txgroup_hierarchy gh ON a.txgroup_id = gh.txgroup_id LEFT JOIN txgroups t ON gh.txgroup_id = t.txgroup_id WHERE (gh.top_category = 'Expenses' OR gh.top_category = 'Cost of Revenue' OR gh.top_category = 'Other Expense') AND a.timestamp >= $__from/1000 AND a.timestamp <= $__to/1000;",
436
+ "refresh": 2,
437
+ "regex": "",
438
+ "sort": 5,
439
+ "type": "query"
440
+ }
441
+ ]
442
+ },
443
+ "time": {
444
+ "from": "now-6M",
445
+ "to": "now"
446
+ },
447
+ "timepicker": {},
448
+ "timezone": "",
449
+ "title": "Expenses Over Time",
450
+ "uid": "62bccd38-918c-4395-9180-8f7f911e9ddf",
451
+ "version": 7
452
+ }