Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tootouch/notionist
Life is divided into before and after meeting Notion
https://github.com/tootouch/notionist
Last synced: about 1 month ago
JSON representation
Life is divided into before and after meeting Notion
- Host: GitHub
- URL: https://github.com/tootouch/notionist
- Owner: TooTouch
- License: apache-2.0
- Created: 2020-06-06T07:05:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-01T11:29:00.000Z (over 4 years ago)
- Last Synced: 2024-10-12T16:24:55.833Z (about 1 month ago)
- Language: Python
- Size: 19.5 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Notionist
> *Life is divided into before and after meeting Notion*This is Notion collection extraction repository for people who use Notion.
I saw `notion-py`, unofficial python API for Notion.so made by `jamalex`, and appreciated `jamalex`. Thanks to `notion-py`, I'm using Notion better. However, there is no table extraction function. I want to use my table contents in python without extracting zip file. Therefore, I made this repository. At first, this repo was for me, but now I want to share this repo for notion users.
Please contact me if you want to join this repo.
# Quick Start
You can install this module entering `pip install notionist` in your command or bash.
```
pip install notionist
```# How to Use
## 1. Get token_v2
First of all, you need `token_v2` to use this module. You can find you token_v2 in your cookies after enterting your id and passward to Notion as follows.
`F12 (User Defined Key) > Application > Cookies > https://www.notion.so > token_v2`
![token_v2](https://user-images.githubusercontent.com/37654013/83939185-d2a48b80-a815-11ea-8a77-11465e01920d.JPG)
## 2. Make a table in notion
When you make a table in notion, you can copy your table link as follows (If you work in web, you can use url).
**TODO:** Only particular types such as Number, Text, Multi-select, and Select can be extracted from notion. I will try others as soon as possible.
![table](https://user-images.githubusercontent.com/37654013/83939246-72fab000-a816-11ea-9894-8cd5e3d729c1.JPG)
## 3. Using CollectionExtract
```python
from notionist import collection_apitoken_v2 = 'YOUR token_v2'
extraction = collection_api.CollectionExtract(token_v2=token_v2)url = 'https://www.notion.so/tootouch/ae60f9946dc54de78fbd4850ccf48b40?v=9d07e70306b2498eb82805b83f882140'
extraction.table_extract(url)
```Tags |number| text |Name
---|---|---|---
0 |A | 1 | apple |1
1 |B | 2 |banana |2
2 |C | 3 |orange |3# TODO
- [ ] Extract other types in table
- [ ] Plotting based on table data in Notion page