← Back to all products
$29
Notion API Automation System
Python scripts and Zapier integrations for automating Notion: auto-create pages, sync databases, generate reports, and send notifications.
PythonConfigMarkdownJSONYAMLAWSNotion
📄 Product Preview
Try the interactive reader and demo tools below, or get the full product with all content unlocked.
📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample📁 File Structure 46 files
notion-automation-system/
├── LICENSE
├── README.md
├── configs/
│ └── automation_rules.yaml
├── examples/
│ ├── __pycache__/
│ │ ├── cross_db_sync.cpython-312.pyc
│ │ ├── daily_standup_page.cpython-312.pyc
│ │ ├── database_backup.cpython-312.pyc
│ │ ├── stale_task_alerter.cpython-312.pyc
│ │ └── weekly_metrics_report.cpython-312.pyc
│ ├── cross_db_sync.py
│ ├── daily_standup_page.py
│ ├── database_backup.py
│ ├── stale_task_alerter.py
│ └── weekly_metrics_report.py
├── free-sample.zip
├── guide/
│ ├── 01_SCHEDULING.md
│ ├── 02_SETUP.md
│ └── 03_ZAPIER_GUIDE.md
├── guides/
│ ├── SCHEDULING.md
│ ├── SETUP.md
│ └── ZAPIER_GUIDE.md
├── index.html
├── integrations/
│ ├── zapier_db_to_slack.json
│ ├── zapier_form_to_notion.json
│ └── zapier_new_page.json
├── requirements.txt
├── src/
│ ├── __init__.py
│ ├── __pycache__/
│ │ ├── __init__.cpython-312.pyc
│ │ ├── client.cpython-312.pyc
│ │ ├── databases.cpython-312.pyc
│ │ ├── filters.cpython-312.pyc
│ │ ├── notifications.cpython-312.pyc
│ │ ├── pages.cpython-312.pyc
│ │ ├── reports.cpython-312.pyc
│ │ └── sync_engine.cpython-312.pyc
│ ├── client.py
│ ├── databases.py
│ ├── filters.py
│ ├── notifications.py
│ ├── pages.py
│ ├── reports.py
│ └── sync_engine.py
└── tests/
├── __pycache__/
│ ├── test_client.cpython-312.pyc
│ └── test_filters.cpython-312.pyc
├── test_client.py
└── test_filters.py
📖 Documentation Preview README excerpt
Notion API Automation System
Automate your Notion workspace with Python scripts, scheduled reports, and webhook-driven workflows.
Stop manually creating pages, copying data between databases, and formatting reports. This system gives you a complete Python toolkit for Notion API automation — from simple page creation to multi-database sync engines and Zapier/webhook integrations.
What You Get
- Notion API client wrapper — handles authentication, rate limiting, pagination, and retry logic so you never hit the API raw
- Page & database CRUD helpers — create, read, update, archive pages and query databases with Pythonic filters
- Report generator — pull data from Notion databases and render Markdown/HTML summary reports on a schedule
- Notification sender — send Slack, email, or webhook alerts when Notion data meets your trigger conditions
- Sync engine — bidirectional sync between two Notion databases (or between Notion and a local JSON/CSV cache)
- Zapier integration recipes — pre-built Zapier webhook configurations for common Notion automations
- Runnable examples — 5 real scripts you can adapt: daily standup page, weekly metrics report, stale-task alerter, database backup, and cross-database sync
- Config-driven design — one
.envfile for credentials, one YAML file for all automation rules
File Structure
notion-automation-system/
├── README.md
├── LICENSE
├── requirements.txt
├── src/
│ ├── __init__.py
│ ├── client.py # Notion API client with rate limiting & retries
│ ├── pages.py # Page creation, update, archive helpers
│ ├── databases.py # Database query, filter builder, schema reader
│ ├── reports.py # Report generation from database queries
│ ├── notifications.py # Alert dispatch (Slack, email, webhook)
│ ├── sync_engine.py # Cross-database and Notion-to-local sync
│ └── filters.py # Notion filter/sort DSL builder
├── examples/
│ ├── daily_standup_page.py # Auto-create a standup page every morning
│ ├── weekly_metrics_report.py# Pull KPIs and generate a summary report
│ ├── stale_task_alerter.py # Notify when tasks haven't been updated
│ ├── database_backup.py # Export a Notion database to JSON/CSV
│ └── cross_db_sync.py # Sync records between two databases
├── configs/
│ ├── .env.example # API keys and integration tokens
│ └── automation_rules.yaml # Declarative automation configuration
├── integrations/
│ ├── zapier_new_page.json # Zapier: webhook creates Notion page
│ ├── zapier_db_to_slack.json # Zapier: Notion DB change → Slack message
│ └── zapier_form_to_notion.json # Zapier: form submission → Notion page
├── guides/
│ ├── SETUP.md # Getting started guide
│ ├── ZAPIER_GUIDE.md # How to wire up the Zapier integrations
│ └── SCHEDULING.md # Running scripts on a cron schedule
└── tests/
├── test_client.py # Unit tests for the API client
└── test_filters.py # Unit tests for the filter builder
Quick Start
1. Get Your Notion API Token
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
examples/cross_db_sync.py#!/usr/bin/env python3
"""
Cross-Database Sync
====================
Synchronizes records between two Notion databases by matching on a
shared key property (e.g., email address, project ID, or SKU).
Use cases:
- Mirror a project tracker into a client-facing status database
- Sync a contacts database across two team workspaces
- Keep an "Active Items" view in sync with a master database
How it decides what to do:
- Records in source but not target → created in target
- Records in both, source newer → target is updated
- Records in target but not source → optionally archived
Setup:
Set in configs/.env:
- NOTION_TOKEN
- SYNC_SOURCE_DB_ID
- SYNC_TARGET_DB_ID
- SYNC_KEY_PROPERTY (e.g., "Email" or "Project ID")
"""
from __future__ import annotations
import logging
import os
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from src.client import NotionClient
from src.sync_engine import sync_databases
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",