Skip to content

gracew/people-log-notion-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People Log Notion Export

This project contains a simple script, to_csv.py to export data from Notion in CSV format. Note that the Notion database IDs are currently hardcoded, and the script makes certain assumptions about their schemas.

To run:

NOTION_API_KEY=<integration token> pipenv run python to_csv.py

This should produce 2 files, people.csv and log.csv, that can then be imported into Postgres.

First, initialize the database:

PGPASSWORD=<pg password> psql -h <pg host> -U <pg username> <pg database name> < ./create_tables.sql

Then within the psql prompt:

\copy people(id, name, context, how_i_know_them) from '<path to people.csv>' delimiter ',' csv;
\copy log(date, hours, type, person_id) from '<path to log.csv>' delimiter ',' csv;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages