Skip to content

Commit 50b4d9c

Browse files
authored
Add generate random data example (#292)
1 parent 7b467fe commit 50b4d9c

File tree

4 files changed

+416
-0
lines changed

4 files changed

+416
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copy this file to .env and fill in your integration token
2+
NOTION_TOKEN=your_integration_token_here
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Generate Random Data Example
2+
3+
## Overview
4+
5+
Populate any Notion database with realistic test data. This example
6+
automatically detects your database schema and generates appropriate fake data
7+
for each property type.
8+
9+
## Setup
10+
11+
### 1. Clone and install
12+
13+
```bash
14+
# Clone this repository locally
15+
git clone https://github.com/ramnes/notion-sdk-py.git
16+
17+
# Switch into this project
18+
cd notion-sdk-py/examples/generate_random_data
19+
20+
# Install the dependencies
21+
pip install -r requirements.txt
22+
```
23+
24+
### 2. Create a Notion integration
25+
26+
1. Visit [My Integrations](https://www.notion.so/my-integrations)
27+
2. Click "New integration"
28+
3. Give it a name and save
29+
4. Copy the integration token
30+
31+
### 3. Share a database with your integration
32+
33+
1. Open any database in Notion
34+
2. Click "..." menu → "Add connections"
35+
3. Search for and add your integration
36+
37+
### 4. Configure and run
38+
39+
```bash
40+
# Set your integration token (or add to .env file)
41+
export NOTION_TOKEN=your-integration-token
42+
43+
# Run the script
44+
python generate_random_data.py
45+
```
46+
47+
## Features
48+
49+
- Detects database schema automatically
50+
- Creates 10 test entries with realistic data
51+
- Shows filtering and querying examples
52+
53+
## Property Types
54+
55+
- Title & Rich Text
56+
- Number
57+
- Select & Multi-select
58+
- Date
59+
- Checkbox
60+
- URL, Email, Phone Number
61+
- Files (as external URLs)

0 commit comments

Comments
 (0)