Metadata-Version: 2.1
Name: notionapimanager
Version: 0.1.10
Summary: Python package for consulting, creating and editing Notion databases
Home-page: https://github.com/rubchume/NotionApiManager
License: MIT
Author: Ruben Chulia Mena
Author-email: rubchume@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: pandas (>=1.4.0,<2.0.0)
Requires-Dist: requests (>=2.27.1,<3.0.0)
Project-URL: Documentation, https://notionapimanager.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/rubchume/NotionApiManager
Description-Content-Type: text/markdown

# Notion API Manager

This package implements a wrapper class around the official [Notion API](https://developers.notion.com/).

It makes it easier to read databases as [Pandas DataFrames](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) and to create new registries.

GitHub [repository](https://github.com/rubchume/NotionApiManager).

[Documentation](https://notionapimanager.readthedocs.io/en/latest/).

[PyPI](https://pypi.org/project/notionapimanager/).

# Steps

## Obtain a Notion integration token

You can do it following the instructions in this [PrettyStatic blog article](https://prettystatic.com/notion-api-python/).

## Install package

Install package from [PyPI](https://pypi.org/project/notionapimanager/).
```shell
pip install notionapimanager
```

## Basic usage of the NotionDatabaseApiManager class
Note: in Notion, a _database_ is what in SQL we would call a _table_.
Hence, a Notion _database_ will be returned as a Pandas DataFrame instance.

```python
from notionapimanager.notion_database_api_manager import NotionDatabaseApiManager
from notionapimanager.notion_property_encoder import PropertyValue

integration_token = "secret_example_integration_token_3147cefa7cd20d4s45677dfasd34"
database_id_1 = "cc147cefa7cd20d4841469ddbd4cd893"
database_id_2 = "cc147cef20d456461469ddbd4das4593"

manager = NotionDatabaseApiManager(integration_token, [database_id_1, database_id_2])
manager.connect()

# Get database 1
manager.get_database(database_id_1)

# Insert a new entry on the database 2
manager.create_page(
    database_id_2,
    [
        PropertyValue("Property Name", "Property value"),
    ]
)
```


