dao-treasury 0.0.42__cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.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.
Files changed (51) hide show
  1. bf2b4fe1f86ad2ea158b__mypyc.cpython-311-i386-linux-gnu.so +0 -0
  2. dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +60 -0
  3. dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
  4. dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +107 -0
  5. dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +387 -0
  6. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +835 -0
  7. dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +615 -0
  8. dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +492 -0
  9. dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +2018 -0
  10. dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
  11. dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
  12. dao_treasury/__init__.py +62 -0
  13. dao_treasury/_docker.cpython-311-i386-linux-gnu.so +0 -0
  14. dao_treasury/_docker.py +190 -0
  15. dao_treasury/_nicknames.cpython-311-i386-linux-gnu.so +0 -0
  16. dao_treasury/_nicknames.py +32 -0
  17. dao_treasury/_wallet.cpython-311-i386-linux-gnu.so +0 -0
  18. dao_treasury/_wallet.py +250 -0
  19. dao_treasury/constants.cpython-311-i386-linux-gnu.so +0 -0
  20. dao_treasury/constants.py +34 -0
  21. dao_treasury/db.py +1408 -0
  22. dao_treasury/docker-compose.yaml +41 -0
  23. dao_treasury/main.py +247 -0
  24. dao_treasury/py.typed +0 -0
  25. dao_treasury/sorting/__init__.cpython-311-i386-linux-gnu.so +0 -0
  26. dao_treasury/sorting/__init__.py +295 -0
  27. dao_treasury/sorting/_matchers.cpython-311-i386-linux-gnu.so +0 -0
  28. dao_treasury/sorting/_matchers.py +387 -0
  29. dao_treasury/sorting/_rules.cpython-311-i386-linux-gnu.so +0 -0
  30. dao_treasury/sorting/_rules.py +235 -0
  31. dao_treasury/sorting/factory.cpython-311-i386-linux-gnu.so +0 -0
  32. dao_treasury/sorting/factory.py +299 -0
  33. dao_treasury/sorting/rule.cpython-311-i386-linux-gnu.so +0 -0
  34. dao_treasury/sorting/rule.py +346 -0
  35. dao_treasury/sorting/rules/__init__.cpython-311-i386-linux-gnu.so +0 -0
  36. dao_treasury/sorting/rules/__init__.py +1 -0
  37. dao_treasury/sorting/rules/ignore/__init__.cpython-311-i386-linux-gnu.so +0 -0
  38. dao_treasury/sorting/rules/ignore/__init__.py +1 -0
  39. dao_treasury/sorting/rules/ignore/llamapay.cpython-311-i386-linux-gnu.so +0 -0
  40. dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
  41. dao_treasury/streams/__init__.cpython-311-i386-linux-gnu.so +0 -0
  42. dao_treasury/streams/__init__.py +0 -0
  43. dao_treasury/streams/llamapay.cpython-311-i386-linux-gnu.so +0 -0
  44. dao_treasury/streams/llamapay.py +388 -0
  45. dao_treasury/treasury.py +191 -0
  46. dao_treasury/types.cpython-311-i386-linux-gnu.so +0 -0
  47. dao_treasury/types.py +133 -0
  48. dao_treasury-0.0.42.dist-info/METADATA +119 -0
  49. dao_treasury-0.0.42.dist-info/RECORD +51 -0
  50. dao_treasury-0.0.42.dist-info/WHEEL +7 -0
  51. dao_treasury-0.0.42.dist-info/top_level.txt +2 -0
@@ -0,0 +1,492 @@
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
+ "editable": true,
19
+ "fiscalYearStartMonth": 0,
20
+ "graphTooltip": 1,
21
+ "links": [],
22
+ "liveNow": false,
23
+ "panels": [
24
+ {
25
+ "datasource": "SQLite",
26
+ "fieldConfig": {
27
+ "defaults": {
28
+ "color": {
29
+ "mode": "thresholds"
30
+ },
31
+ "mappings": [],
32
+ "thresholds": {
33
+ "mode": "absolute",
34
+ "steps": [
35
+ {
36
+ "color": "green",
37
+ "value": null
38
+ },
39
+ {
40
+ "color": "red",
41
+ "value": 80
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "overrides": []
47
+ },
48
+ "gridPos": {
49
+ "h": 4,
50
+ "w": 6,
51
+ "x": 0,
52
+ "y": 0
53
+ },
54
+ "id": 1,
55
+ "options": {
56
+ "colorMode": "value",
57
+ "graphMode": "area",
58
+ "justifyMode": "auto",
59
+ "orientation": "auto",
60
+ "reduceOptions": {
61
+ "calcs": [
62
+ "lastNotNull"
63
+ ],
64
+ "fields": "",
65
+ "values": false
66
+ },
67
+ "textMode": "auto"
68
+ },
69
+ "pluginVersion": "10.2.0",
70
+ "targets": [
71
+ {
72
+ "datasource": "SQLite",
73
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
74
+ "queryType": "table",
75
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
76
+ "refId": "A",
77
+ "timeColumns": [
78
+ "time",
79
+ "ts"
80
+ ]
81
+ }
82
+ ],
83
+ "title": "Revenue",
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": null
100
+ },
101
+ {
102
+ "color": "red",
103
+ "value": 80
104
+ }
105
+ ]
106
+ }
107
+ },
108
+ "overrides": []
109
+ },
110
+ "gridPos": {
111
+ "h": 4,
112
+ "w": 6,
113
+ "x": 6,
114
+ "y": 0
115
+ },
116
+ "id": 3,
117
+ "options": {
118
+ "colorMode": "value",
119
+ "graphMode": "area",
120
+ "justifyMode": "auto",
121
+ "orientation": "auto",
122
+ "reduceOptions": {
123
+ "calcs": [
124
+ "lastNotNull"
125
+ ],
126
+ "fields": "",
127
+ "values": false
128
+ },
129
+ "textMode": "auto"
130
+ },
131
+ "pluginVersion": "10.2.0",
132
+ "targets": [
133
+ {
134
+ "datasource": "SQLite",
135
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
136
+ "queryType": "table",
137
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
138
+ "refId": "A",
139
+ "timeColumns": [
140
+ "time",
141
+ "ts"
142
+ ]
143
+ }
144
+ ],
145
+ "title": "Cost of Revenue",
146
+ "type": "stat"
147
+ },
148
+ {
149
+ "datasource": "SQLite",
150
+ "fieldConfig": {
151
+ "defaults": {
152
+ "color": {
153
+ "mode": "thresholds"
154
+ },
155
+ "mappings": [],
156
+ "thresholds": {
157
+ "mode": "absolute",
158
+ "steps": [
159
+ {
160
+ "color": "green",
161
+ "value": null
162
+ },
163
+ {
164
+ "color": "red",
165
+ "value": 80
166
+ }
167
+ ]
168
+ }
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
+ "reduceOptions": {
185
+ "calcs": [
186
+ "lastNotNull"
187
+ ],
188
+ "fields": "",
189
+ "values": false
190
+ },
191
+ "textMode": "auto"
192
+ },
193
+ "pluginVersion": "10.2.0",
194
+ "targets": [
195
+ {
196
+ "datasource": "SQLite",
197
+ "queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
198
+ "queryType": "table",
199
+ "rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
200
+ "refId": "A",
201
+ "timeColumns": [
202
+ "time",
203
+ "ts"
204
+ ]
205
+ }
206
+ ],
207
+ "title": "Expenses",
208
+ "type": "stat"
209
+ },
210
+ {
211
+ "datasource": "SQLite",
212
+ "description": "",
213
+ "fieldConfig": {
214
+ "defaults": {
215
+ "color": {
216
+ "mode": "thresholds"
217
+ },
218
+ "mappings": [],
219
+ "thresholds": {
220
+ "mode": "absolute",
221
+ "steps": [
222
+ {
223
+ "color": "green",
224
+ "value": null
225
+ },
226
+ {
227
+ "color": "red",
228
+ "value": 80
229
+ }
230
+ ]
231
+ }
232
+ },
233
+ "overrides": []
234
+ },
235
+ "gridPos": {
236
+ "h": 4,
237
+ "w": 6,
238
+ "x": 18,
239
+ "y": 0
240
+ },
241
+ "id": 10,
242
+ "options": {
243
+ "colorMode": "value",
244
+ "graphMode": "area",
245
+ "justifyMode": "auto",
246
+ "orientation": "auto",
247
+ "reduceOptions": {
248
+ "calcs": [
249
+ "lastNotNull"
250
+ ],
251
+ "fields": "",
252
+ "values": false
253
+ },
254
+ "textMode": "auto"
255
+ },
256
+ "pluginVersion": "10.2.0",
257
+ "targets": [
258
+ {
259
+ "datasource": "SQLite",
260
+ "queryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
261
+ "queryType": "table",
262
+ "rawQueryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
263
+ "refId": "A",
264
+ "timeColumns": [
265
+ "time",
266
+ "ts"
267
+ ]
268
+ }
269
+ ],
270
+ "title": "Operating Total",
271
+ "type": "stat"
272
+ },
273
+ {
274
+ "datasource": "SQLite",
275
+ "description": "",
276
+ "fieldConfig": {
277
+ "defaults": {
278
+ "color": {
279
+ "mode": "palette-classic"
280
+ },
281
+ "custom": {
282
+ "axisBorderShow": false,
283
+ "axisCenteredZero": false,
284
+ "axisColorMode": "text",
285
+ "axisLabel": "",
286
+ "axisPlacement": "auto",
287
+ "barAlignment": 0,
288
+ "drawStyle": "bars",
289
+ "fillOpacity": 70,
290
+ "gradientMode": "none",
291
+ "hideFrom": {
292
+ "legend": false,
293
+ "tooltip": false,
294
+ "viz": false
295
+ },
296
+ "insertNulls": false,
297
+ "lineInterpolation": "linear",
298
+ "lineWidth": 1,
299
+ "pointSize": 5,
300
+ "scaleDistribution": {
301
+ "type": "linear"
302
+ },
303
+ "showPoints": "auto",
304
+ "spanNulls": false,
305
+ "stacking": {
306
+ "group": "A",
307
+ "mode": "normal"
308
+ },
309
+ "thresholdsStyle": {
310
+ "mode": "off"
311
+ }
312
+ },
313
+ "mappings": [],
314
+ "thresholds": {
315
+ "mode": "absolute",
316
+ "steps": [
317
+ {
318
+ "color": "green",
319
+ "value": null
320
+ },
321
+ {
322
+ "color": "red",
323
+ "value": 80
324
+ }
325
+ ]
326
+ }
327
+ },
328
+ "overrides": [
329
+ {
330
+ "matcher": {
331
+ "id": "byName",
332
+ "options": "Net (sum)"
333
+ },
334
+ "properties": [
335
+ {
336
+ "id": "custom.drawStyle",
337
+ "value": "line"
338
+ },
339
+ {
340
+ "id": "custom.stacking",
341
+ "value": {
342
+ "group": "A",
343
+ "mode": "none"
344
+ }
345
+ },
346
+ {
347
+ "id": "custom.fillOpacity",
348
+ "value": 19
349
+ }
350
+ ]
351
+ }
352
+ ]
353
+ },
354
+ "gridPos": {
355
+ "h": 12,
356
+ "w": 24,
357
+ "x": 0,
358
+ "y": 4
359
+ },
360
+ "id": 11,
361
+ "options": {
362
+ "legend": {
363
+ "calcs": [],
364
+ "displayMode": "list",
365
+ "placement": "bottom",
366
+ "showLegend": true
367
+ },
368
+ "tooltip": {
369
+ "mode": "single",
370
+ "sort": "none"
371
+ }
372
+ },
373
+ "targets": [
374
+ {
375
+ "datasource": "SQLite",
376
+ "queryText": "SELECT t.timestamp,\r\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END) AS \"Total Revenue\",\r\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\",\r\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\"\r\nFROM general_ledger AS t\r\nJOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id\r\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000\r\nGROUP BY timestamp\r\nORDER BY timestamp;",
377
+ "queryType": "table",
378
+ "rawQueryText": "SELECT t.timestamp,\r\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END) AS \"Total Revenue\",\r\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\",\r\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\"\r\nFROM general_ledger AS t\r\nJOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id\r\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000\r\nGROUP BY timestamp\r\nORDER BY timestamp;",
379
+ "refId": "A",
380
+ "timeColumns": [
381
+ "timestamp"
382
+ ]
383
+ }
384
+ ],
385
+ "title": "Weekly Cashflow",
386
+ "transformations": [
387
+ {
388
+ "id": "formatTime",
389
+ "options": {
390
+ "outputFormat": "YYYY-WW",
391
+ "timeField": "timestamp",
392
+ "timezone": "browser",
393
+ "useTimezone": true
394
+ }
395
+ },
396
+ {
397
+ "id": "convertFieldType",
398
+ "options": {
399
+ "conversions": [
400
+ {
401
+ "dateFormat": "YYYY-WW",
402
+ "destinationType": "time",
403
+ "targetField": "timestamp"
404
+ }
405
+ ],
406
+ "fields": {}
407
+ }
408
+ },
409
+ {
410
+ "id": "groupBy",
411
+ "options": {
412
+ "fields": {
413
+ "Cost of Revenue": {
414
+ "aggregations": [
415
+ "sum"
416
+ ],
417
+ "operation": "aggregate"
418
+ },
419
+ "Expenses": {
420
+ "aggregations": [
421
+ "sum"
422
+ ],
423
+ "operation": "aggregate"
424
+ },
425
+ "Net": {
426
+ "aggregations": [
427
+ "sum"
428
+ ],
429
+ "operation": "aggregate"
430
+ },
431
+ "Other Expenses": {
432
+ "aggregations": [
433
+ "sum"
434
+ ],
435
+ "operation": "aggregate"
436
+ },
437
+ "Other Income": {
438
+ "aggregations": [
439
+ "sum"
440
+ ],
441
+ "operation": "aggregate"
442
+ },
443
+ "Revenue": {
444
+ "aggregations": [
445
+ "sum"
446
+ ],
447
+ "operation": "aggregate"
448
+ },
449
+ "Timestamp": {
450
+ "aggregations": [],
451
+ "operation": "groupby"
452
+ },
453
+ "Total Expenses": {
454
+ "aggregations": [
455
+ "sum"
456
+ ],
457
+ "operation": "aggregate"
458
+ },
459
+ "Total Revenue": {
460
+ "aggregations": [
461
+ "sum"
462
+ ],
463
+ "operation": "aggregate"
464
+ },
465
+ "timestamp": {
466
+ "aggregations": [],
467
+ "operation": "groupby"
468
+ }
469
+ }
470
+ }
471
+ }
472
+ ],
473
+ "type": "timeseries"
474
+ }
475
+ ],
476
+ "refresh": "",
477
+ "schemaVersion": 38,
478
+ "tags": [],
479
+ "templating": {
480
+ "list": []
481
+ },
482
+ "time": {
483
+ "from": "now-6M",
484
+ "to": "now"
485
+ },
486
+ "timepicker": {},
487
+ "timezone": "",
488
+ "title": "Operating Cashflow Summary",
489
+ "uid": "fdf9969c-357a-4203-ae7b-12816e87bc7e",
490
+ "version": 1,
491
+ "weekStart": ""
492
+ }