Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.81 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.81 KB

README

This is a small Python 3 script and convenience wrapper around some of the functionality in notion-py. Its intent is to serialize PBLL project story Notion tables to CSV files.

Installation

pip3 install -r requirements.txt

Usage

You'll need an API token from Notion. As of July 2020, Notion's API is not public. You can grab a de facto token from the cookies loaded in your browser in a logged-in session on notion.so.

If you're not sure how to inspect cookie values, you can use an extension like EditThisCookie on Chrome as so:

Animated GIF of using EditThisCookie to get Notion API token

Usage syntax is available via notion2csv.py -h:

usage: notion2csv.py [-h] TOKEN_V2 URL PATH

Generate a CSV file from a Notion table

positional arguments:
  TOKEN_V2    API token_v2, via logged-in notion.so cookies
  URL         URL of the table to convert
  PATH        Output path for CSV

optional arguments:
  -h, --help  show this help message and exit

Currently, this is used as part of the PBLL project to serialize project story artifacts ↔ standard mappings to a CSV file suitable and reflects the structure of that as reflected in this mock table, i.e.

Project story summary and schema screenshot

…producing CSVs like this one