Notion2Pandas
Notion2Pandas is a Python 3 package that extends the capabilities of the excellent notion-sdk-py by Ramnes. It enables the seamless import of a Notion database into a pandas dataframe and vice versa, requiring just a single line of code.
Installation
pip install notion2pandas
Quick Start
Synchronous Client
from notion2pandas import Notion2PandasClient
import os
# Create client
n2p = Notion2PandasClient(auth=os.environ["NOTION_TOKEN"])
# Import database to NotionDataFrame
ndf = n2p.get_dataframe(os.environ["DATABASE_ID"])
# Work with your data
ndf.loc[ndf['Status'] == 'Todo', 'Status'] = 'In Progress'
# Save changes back to Notion
n2p.sync_to_notion(ndf)
Asynchronous Client
from notion2pandas import AsyncNotion2PandasClient
import os
# Create async client
async_n2p = AsyncNotion2PandasClient(auth=os.environ["NOTION_TOKEN"])
# Import database to NotionDataFrame (concurrent processing)
ndf = await async_n2p.get_dataframe(os.environ["DATABASE_ID"])
# Work with your data
ndf.loc[ndf['Status'] == 'Todo', 'Status'] = 'In Progress'
# Save changes back to Notion (concurrent updates)
await async_n2p.sync_to_notion(ndf)
For more complete, real-world examples, see the examples folder.
📖 Documentation
This README covers the basics. For everything else — filters and sorts, data sources, templates, callbacks, custom read/write functions, logging, and more — see the full documentation.
Migrating from v1.x
Version 2.0 introduces several improvements and breaking changes. If you're upgrading from v1.x:
| v1.x | v2.0 |
|---|---|
from_notion_DB_to_dataframe() |
get_dataframe() |
update_notion_DB_from_dataframe() |
sync_to_notion() |
from_notion_database_to_dataframes() |
get_dataframes() |
delete_rows_and_pages() |
delete_pages() |
Returns pd.DataFrame |
Returns NotionDataFrame |
PageID column |
page_id index |
| Manual row appending | ndf.add_page() |
📖 Complete migration guide with examples: MIGRATION-GUIDE.md
📚 v1.x documentation: README-v1.md
Examples
Real-world scripts covering common use cases are available in the examples folder.
Changelog
View the complete version history on the changelog page.
Support
Notion2Pandas is an open-source project. Contributions are welcome!
- Report Issues: Found a bug? Open an issue
- Propose Changes: Have an improvement? Submit a merge request
- Fork the Project: Disagree with the direction? You're free to fork with our blessing!
All proposals will be evaluated and responded to.
License
This project is open-source and available under the MIT License.
Metadata
Release files for notion2pandas 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| notion2pandas-3.3.0.tar.gz | 2.3 MB | Without provenance | Details for notion2pandas-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| notion2pandas-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for notion2pandas-3.3.0-py3-none-any.whl |
Total release size: 2.4 MB
Release files / notion2pandas-3.3.0.tar.gz
| Download URL | notion2pandas-3.3.0.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb1bf1f50675e3ce375b775d4afacf4e41dab21dcbf8b638907d6313aa160d3f
|
|
BLAKE2b-256 checksum How to use checksums |
9a29899f01fd991d66d9189c3418fae13ca8d558c132bd489cc09517420ffab4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / notion2pandas-3.3.0-py3-none-any.whl
| Download URL | notion2pandas-3.3.0-py3-none-any.whl |
|---|---|
| Size | 46.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbcbe8af2812e837cde7f0735af3bc3420d9307f698fbb3d8c28cf462a0d9c50
|
|
BLAKE2b-256 checksum How to use checksums |
2db4e6c8a7aa44317391fda32507d2bfd83ba5b344d4eee9377ed43c41f29471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for notion2pandas 3.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.