Unoffical Notion AI API
Project description
NotionAI
Unofficial NotionAI API
https://github.com/Vaayne/NotionAI
Feature
- Full APIs from Notion AI
- Support stream response
Usage
Install
pip install --upgrade notionai-py
Get Notion Token
- Open Chrome / Firefix DevTools
- Find Cookies and copy value for
token_v2
Example
Basic
import os
from notionai import NotionAI
TOKEN = os.getenv("NOTION_TOKEN")
def main():
ai = NotionAI(TOKEN)
res = ai.blog_post("write a blog about the meaning of life")
print(res)
if __name__ == "__main__":
main()
Stream API
import os
import sys
from notionai import NotionAI
TOKEN = os.getenv("NOTION_TOKEN")
def main():
ai = NotionAIStream(TOKEN)
res = ai.blog_post("write a blog about the meaning of life")
for item in res:
sys.stdout.write(item)
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
notionai-py-0.0.3.tar.gz
(274.1 kB
view hashes)
Built Distribution
Close
Hashes for notionai_py-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09f11106c4efdef6aa0d78ea21c266ba1cace571b1f1be678abcd5ff10a00451 |
|
MD5 | ce24de973d06e76bc330d3c78ab521e0 |
|
BLAKE2b-256 | 4156cc795bac10c0d928d818b2f08d1654108b322aa9118ac15b447952fe7f0b |