Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
from dotenv import load_dotenv | |
import requests | |
class NotionClient(): | |
def __init__(self, notion_key): | |
self.notion_key = notion_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from dotenv import load_dotenv | |
import requests | |
""" | |
This example uses Azure Cognitive Services Translator to translate Notion pages into a new Notion page. | |
See full explanation at: https://www.pynotion.com/translate-with-azure-translator-part-2 | |
Create a Translator resource in Azure, and set the key and region in your environment or a .env file as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from dotenv import load_dotenv | |
import requests | |
""" | |
This example uses Azure Cognitive Services Translator and the Notion API to translate the title of a page. | |
For more details, see [Translate a Notion page using Azure Cognitive Services Translator (Part 1)](https://www.pynotion.com/translate-with-azure-translator) | |
Create a Translator resource in Azure, and set the key and region in your environment or a .env file as |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
1. Create an integration at https://www.notion.so/my-integrations | |
2. Set an environment variable NOTION_KEY with the value of the "Internal Integration Token" | |
3. Create a page and connect it to your integration. | |
Ensure you have requests installed in your environment `pip install requests` | |
""" | |
import os | |
import json |