Auto update currency exchange rate for Notion
- requests
- notion-client
- cachetools
Run the below command to install
pip install requests notion-client cachetools
- python-dotenv
- This package is use to load environment variables from .env.
If you don't intend to use .env file, then this package is not required.
- This package is use to load environment variables from .env.
Run the below command to install
pip install python-dotenv
docker build .
docker pull smarttommyau/notion-currency-auto-update
- Setup and Run Environment
- Connect Notion
- Get an internal integration token
Use Notion's Getting Started Guide to get set up to use Notion's API.
- Set the NOTION_TOKEN environment variable by setting it in
.env
or manually - Now, run
python main.py
to run the program
Simply Run docker run smarttommyau/notion-currency-auto-update
--env-file .env
to load .env file-d
to run in background
- First, connect the integration to the database by add connection
- Then, follow the below instructions
You may also refer to this TEMPLATE
This way all rows in this column will be the same
- Create a new column in type of formula
- Naming scheme
ExRTV currencyA>CurrencyB AnyName
- ExRTV is a required prefix
- CurrencyA: From this currency
- CurrencyB: target currency
- AnyName: whatever you like
- Create 2 new columns one is a select and one is a number
Not multi-select!!
- For the select, Naming Scheme:
ExRTT AnyName
- ExRTT is a required prefix
- AnyName: whatever you like
- For the number, Naming Scheme:
ExRTV AnyName
- ExRTV is a required prefix
- AnyName: whatever you like
- For any row, set the select to in format of
CurrencyA>CurrencyB
- CurrencyA: From this currency
- CurrencyB: target currency
- Then, the ExRTV field will be auto update
- use a currency api that refresh more frequently
- Host the public integration version
It is normal that the update is not instantaneously due to indexing time and limited acess rate of the notion api.