{"id":22696088,"url":"https://github.com/zdimension/cozy-banks-analysis","last_synced_at":"2026-02-16T17:02:53.918Z","repository":{"id":164824540,"uuid":"628612974","full_name":"zdimension/cozy-banks-analysis","owner":"zdimension","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-07T19:25:58.000Z","size":229,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T06:26:36.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdimension.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-16T13:54:35.000Z","updated_at":"2025-01-07T19:26:02.000Z","dependencies_parsed_at":"2024-07-06T22:40:38.886Z","dependency_job_id":"da2ac36b-40df-4c65-938f-eb7af1c198f8","html_url":"https://github.com/zdimension/cozy-banks-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zdimension/cozy-banks-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdimension%2Fcozy-banks-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdimension%2Fcozy-banks-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdimension%2Fcozy-banks-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdimension%2Fcozy-banks-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdimension","download_url":"https://codeload.github.com/zdimension/cozy-banks-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdimension%2Fcozy-banks-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29513435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T04:14:14.120Z","updated_at":"2026-02-16T17:02:53.902Z","avatar_url":"https://github.com/zdimension.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cozy-banks-analysis\n\nThis repository contains various scripts to analyze the data exported\nfrom [Cozy Banks](https://cozy.io/fr/features/#bank).\n\nThe web interface is really nice but still lacks some advanced features (which doesn't mean it's not a great tool!).\n\n## Usage\n\nCreate a .env file following the .env.example file.\n\n### .env\n\nAll parameters are optional unless specified otherwise.\n\n- `ACH_PATH`: path to the `ACH` executable (default: `ACH`)\n- `BASE_URL` (**required**): URL of your Cozy instance (example: `https://johndoe.mycozy.cloud/`)\n- `TOKEN`: authentification token (automatically set, you don't have to set it yourself)\n\n### Command-line\n\n`pip install -r requirements.txt` and run one of the scripts below.\n\n**Note:** for all the features to work properly (e.g. automatic token generation), you need to have\n[`ach`](https://github.com/cozy/ACH) installed and in your `PATH`.\n\n## Scripts\n\n### `check_balance`\n\nComputes the balance of each account (cumulated sum of transactions) and compares it to the balance given by the bank\nconnectors. This is useful to make sure your transaction history is complete.\n\nExample output:\n\n```\nAccount                       Balance    Computed balance    Difference\n--------------------------  ---------  ------------------  ------------\nCheckings (Big Bank)          1756.02             1756.02          0.00\nSavings (Big Bank)              13.88                0.00         13.88\nCheckings (Other Bank)         629.12              566.27         62.85\nCheckings (Small Bank)        4107.06             4107.06          0.00\nLife Insurance (Small Bank)    698.15              800.11       -101.96\n```\n\n### `cmcic_to_cozy`\n\nConverts a CSV file exported from CIC / Crédit Mutuel \"Gestion de Budget\" service. This is a trick that allows getting\nyour transaction history since your account has been opened (normally, the bank only gives you one month of history for\nfree). Once you get that CSV file, you can convert it to JSON using this script, and import it in Cozy. Thus, you get\nyour full history.\n\n### `gen_ach_token`\n\nFor reasons unknown to me, the `ach token` subcommand only gives you the raw token, but `ach` expects a token file with\na very specific format for the other subcommands (`import`, `export`, ...). In fact, it expects the following:\n\n```js\nmodule.exports = {token: \"...\"};\n```\n\nThis script calls `ach token` and generates a file in the correct format, that you can then use\nwith `ach`: `ach -t token.js ...`.\n\n### `manual_insert`\n\nThis script allows batch manual insertion of transaction in a Cozy Banks account. This is useful if, like me, you're\ntrying to get old operations in your history from paper trails or things like that.\n\nTODO: document this better. Also this isn't in the repository yet.\n\n### `plot_balance`\n\nThis plots the balance of your accounts over time using Plotly.\n\nExample output:\n\n![Plotly example](https://i.imgur.com/qQYVPVT.png)\n\n### `sankey`\n\nThis script generates a Sankey diagram of your transactions. They're grouped by their Cozy category.\n\nThe output is in your clipboard, by default. The format is the one used\nby [Sankeymatic](https://sankeymatic.com/build/).\n\nExample output in Sankeymatic:\n\n![Sankeymatic example](https://i.imgur.com/JaBzdM4.png)\n\n### `sql`\n\nThis script allows querying your accounts and operations using SQL. \n\nUnder the hood, the data is exported in JSON format from the Cozy Stack API, loaded as a Pandas DataFrame, and then\nconverted to a SQLite database using pandasql. As such, you can use any SQL query that SQLite would understand. For now,\nthis script only allows read operations.\n\n```sql\nSELECT\n    accounts.display AS account,\n    SUM(operations.amount) AS balance\nFROM\n    operations\n    INNER JOIN accounts ON operations.account = accounts.id\nGROUP BY\n    operations.account\n```\n\n```\n                        account    balance\n0          Checkings (Big Bank)    1756.02\n1            Savings (Big Bank)      13.88\n2        Checkings (Other Bank)     629.12\n3        Checkings (Small Bank)    4107.06\n4   Life Insurance (Small Bank)     698.15\n```\n\nAn REPL mode, with syntax highlighting and autocompletion, is also available:\n\n![REPL](https://i.imgur.com/rGGpi4Y.png)\n\n## License\n\nThis project is licensed under the terms of the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdimension%2Fcozy-banks-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdimension%2Fcozy-banks-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdimension%2Fcozy-banks-analysis/lists"}