{"id":15020212,"url":"https://github.com/pierresouchay/data2notion","last_synced_at":"2025-10-25T10:08:56.323Z","repository":{"id":245908187,"uuid":"819526295","full_name":"pierresouchay/data2notion","owner":"pierresouchay","description":"Export records in Notion Databases","archived":false,"fork":false,"pushed_at":"2025-06-16T09:02:31.000Z","size":116,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T23:57:06.857Z","etag":null,"topics":["asyncio","csv","json","notion","prometheus"],"latest_commit_sha":null,"homepage":"","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/pierresouchay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-06-24T17:23:50.000Z","updated_at":"2025-06-16T09:02:08.000Z","dependencies_parsed_at":"2024-06-24T19:26:00.994Z","dependency_job_id":"867bc24d-50a7-4f3d-81c2-6e945a2a4e30","html_url":"https://github.com/pierresouchay/data2notion","commit_stats":null,"previous_names":["pierresouchay/data2notion"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/pierresouchay/data2notion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresouchay%2Fdata2notion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresouchay%2Fdata2notion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresouchay%2Fdata2notion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresouchay%2Fdata2notion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pierresouchay","download_url":"https://codeload.github.com/pierresouchay/data2notion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pierresouchay%2Fdata2notion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280936959,"owners_count":26416674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["asyncio","csv","json","notion","prometheus"],"created_at":"2024-09-24T19:54:45.425Z","updated_at":"2025-10-25T10:08:56.293Z","avatar_url":"https://github.com/pierresouchay.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# data2notion: export your data to Notion\n\n[![PyPI - Version](https://img.shields.io/pypi/v/data2notion)](https://pypi.org/project/data2notion/)\n[![License](https://img.shields.io/pypi/l/data2notion)](https://raw.githubusercontent.com/pierresouchay/data2notion/main/LICENSE)\n\nThis tool is intended for exporting various data from 3rd party systems\ninto Notion. If you tool can export some records, then you can make this data available to Notion!\n\n## Installation\n\nIt requires Python 3.9+ and try not using too many dependencies.\n\nto install it:\n\n```bash\npython3 install data2notion\n```\n\nThis will install it and all plugins. You can now run it by typing `data2notion` in you terminal.\n\n## Changes\n\n[CHANGELOG.md](https://github.com/pierresouchay/data2notion/blob/main/CHANGELOG.md)\n\n## Goals\n\nWhen working as a CTO, I had the need to expose data from various systems (Applications, AWS, SIEM, Active Directory, users, groups...)\ninto Notion to generate automatic reports and select what I wanted to expose, so it made all systems transparent and open.\nThis was extremelly precious to automatically generate reports for audits.\n\nOne of the advantages of the tool is that:\n\n - it creates entries in Notion database if entries do not exists\n - it modifies the various fields of the Notion database if they have been modified\n - it cleanups the old records when they don't exist anymore\n\nSo, if you run this tool everyday, you have a Notion database in sync with the data from all your third party systems.\nAnd you can start commenting, taking decisions and documenting those entries within Notion: it gives you a centralized\nway to discuss topics about all of your IT, provides comments, reminders (eg: reming me about renewing this certificate\nin 2 years, check if the fix has been performed in 2 months...), and cleanup dead stuff automatically.\n\nInitially, the tool was only dealing with CSV, but data2notion also deals with various formats and APIs, so you can\nintegrate faster and better!\n\n# Features\n\ndata2notion supports plugins, so you can either work with JSON/CSV export or implement your own retrieval of data, for instance,\nfrom a 3rd party API.\n\n## Basic Usage\n\ndata2notion is build using commands. Each succession of command has its own help.\n\nThe first level is teh following:\n\n```bash\ndata2notion --help\nusage: data2notion [-h] [--version] [--log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}] [--notion-log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}]\n                   [--notion-rate-limit NOTION_RATE_LIMIT] [--statistics {console,disabled}] [--notion-token NOTION_TOKEN]\n                   {plugins,write-to-notion} ...\n\nExport some data into a notion database\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n                        Set the default log level (default=WARNING)\n  --notion-log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n                        Set the log level for data2notion (default=INFO)\n  --notion-rate-limit NOTION_RATE_LIMIT\n                        Set the notion rate-limiter, by default {default_rate_limit} (3 requests/sec, 100 initial bucket size)\n  --statistics {console,disabled}\n                        Display Statistics when program ends\n  --notion-token NOTION_TOKEN\n                        Notion Token to use $NOTION_TOKEN by default\n\naction to perform:\n  action to perform\n\n  {plugins,write-to-notion}\n                        sub-command help\n    write-to-notion     write to Notion Database\n```\n\nThis is the level where you can specify using the command line the `NOTION_TOKEN` (or you can use the environemnt variable `$NOTION_TOKEN` instead).\n\nYou can also change the log-level (in case of issues) and enable/disable statistics.\n\n### First level of help\n\nHow to get the _notion_database_id_?\n\nFrom [official documentation](https://developers.notion.com/reference/retrieve-a-database), open the database in your brower (in a full page),\nthe URL should then be https://notion.so/my_workspace/**668d797c76fa49349b05ad288df2d136**v=... =\u003e in such an example, `668d797c76fa49349b05ad288df2d136`\nwould be the _notion_database_id_.\n\nBe sure that you [granted access rights to this database](https://www.notion.so/help/add-and-manage-connections-with-the-api#add-connections-to-pages)\nto the token you want to use in this app.\n\n\n```bash\ndata2notion write-to-notion \u003cnotion_database_id\u003e \u003cplugin\u003e --help\n```\n\nWill list the arguments that are specific to a plugin.\n\n### CSV plugin\n\nExport CSV files arrays in Notion.\n\n```bash\ndata2notion write-to-notion \u003cnotion_database_id\u003e csv --help\nusage: data2notion write-to-notion notion_database_id csv [-h] [--csv-dialect {excel,excel-tab,unix,excel_with_semi-colon}] csv_file\n\nWrite to Notion DB from a CSV file\n\npositional arguments:\n  csv_file              CSV file to inject in Notion, if '-' is set, read from stdin\n\noptions:\n  -h, --help            show this help message and exit\n  --csv-dialect {excel,excel-tab,unix,excel_with_semi-colon}\n                        CSV Dialect, excel by default\n```\n\n### JSON Plugin\n\nExport some JSON arrays in Notion.\n\n```bash\nusage: data2notion write-to-notion \u003cnotion_database_id\u003e json [-h] [--json-path PATH_IN_JSON] json_file\n\nWrite to Notion DB from a JSON file containing an array\n\npositional arguments:\n  json_file             JSON file to inject in Notion, if '-' is set, read from stdin\n\noptions:\n  -h, --help            show this help message and exit\n  --json-path PATH_IN_JSON\n                        JSON path separated by dots to look for the array, example: calendar.appointments\n```\n\n### Prometheus Plugin\n\nExport metrics from prometheus (lastest values only) in Notion database.\n\nInspired by [prom2csv](https://pypi.org/project/prom2csv/), this plugin let you export your last prometheus metrics in Notion!\n\n```bash\nusage: data2notion [-h] [--version] [--log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}] [--notion-log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}] [--no-progress-bar] [--notion-rate-limit NOTION_RATE_LIMIT] [--statistics {console,disabled}]\n                   [--notion-token NOTION_TOKEN] [--partition column_name=\u003cregexp\u003e]\n                   {plugins,export-from-notion,write-to-notion} ...\n\nExport some data into a notion database\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n                        Set the default log level (default from $NOTION_LOG_LEVEL=WARNING)\n  --notion-log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}\n                        Set the log level for data2notion (default=INFO)\n  --no-progress-bar     Disable the progress bar\n  --notion-rate-limit NOTION_RATE_LIMIT\n                        Set the notion rate-limiter, by default {default_rate_limit} (3 requests/sec, 100 initial bucket size)\n  --statistics {console,disabled}\n                        Display Statistics when program ends\n  --notion-token NOTION_TOKEN\n                        Notion Token to use $NOTION_TOKEN by default\n  --partition column_name=\u003cregexp\u003e\n                        Only synchronize records having a column matching given regexp\n\naction to perform:\n  action to perform\n\n  {plugins,export-from-notion,write-to-notion}\n                        sub-command help\n    export-from-notion  export from Notion Database\n    write-to-notion     write to Notion Database\n```\n\n\n## Adding other plugins\n\n\nAdding plugin can be done using environment variable `$DATA2NOTION_ADDITIONAL_PLUGINS` which support the\nfollowing syntax `python_module.python_file:PluginClass`, thus to enable a new imaginary Bugzilla plugin, you might for instance\nexport the variable:\n\n```bash\nexport DATA2NOTION_ADDITIONAL_PLUGINS=\"bugzilla_api.bugzilla_plugin:BugzillPlugin\"\n```\n\nThen, the plugin should be visible in:\n```bash\ndata2notion plugins\n```\n\nand you might use it as any other plugin.\n\n## Writing new plugins\n\nSee [DESIGN.md](https://github.com/pierresouchay/data2notion/blob/main/DESIGN.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierresouchay%2Fdata2notion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierresouchay%2Fdata2notion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierresouchay%2Fdata2notion/lists"}