This is a demo for integrating with the Notion API, which provides an API layer for interacting with Notion's REST API.
- Python 3.12
- Docker (optional, for running with Docker)
- Google Cloud CLI (optional, for deployments)
Create a .env
file in the root directory of the project and set the following environment variables:
NOTION_BASE_URL=https://api.notion.com/v1
NOTION_API_KEY=notion_api_key
APP_BASE_PATH=/api/v1
APP_API_KEY=app_api_key
LOGGING_LEVEL=debug
Replace notion_api_key
and app_api_key
with your actual Notion API key and API key for the service hub.
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python run.py
-
Build the Docker image:
docker build . -t notion-service-hub
-
Run the Docker container:
docker run notion-service-hub:latest
To make a request to the Notion Service Hub, you can use the following details:
- Authorization:
X-API-key
:app_api_key
curl --location '{host}/api/v1/databases' \
--header 'X-API-Key: f6473d3e-7074-4769-b69f-32c98827b28c'
To run unit tests, use pytest
:
pytest tests
To deploy the application, use the provided cloudrun_deploy.sh
script:
./cloudrun_deploy.sh
This script will deploy the service to Google Cloud Run.
This project is licensed under the MIT License - see the LICENSE file for details.