Code Monkey home page Code Monkey logo

cryptoupdate's Introduction

Crypto Update

Integrate auto cryptocurrencies price update to Notion and archive database.

Install the required software dependencies by running the following command

python3 -m pip install -r requirements.txt

Create ./inputs/my_variables.yml file with your notion and coinmarketcap related informations

NOTION_VERSION: <insert-API-notion-version>
NOTION_API_TOKEN: <insert-your-notion-integration-secret-token> 
NOTION_TOKEN_V2: <insert-your-notion-integration-internal-token>
NOTION_FILE_TOKEN: <insert-your-notion-file-token>
MY_COINMARKETCAP_APIKEY: <insert-your-coinmarketcap-integration-secret-token>

How to find those values

NOTION_API_TOKEN: It has to be created from your Notion account (https://www.notion.so/my-integrations)

NOTION_VERSION: It is found in the API documentation (https://developers.notion.com/reference/versioning)

NOTION_TOKEN_V2:

NOTION_FILE_TOKEN:

MY_COINMARKETCAP_APIKEY: It is found in your API account (https://pro.coinmarketcap.com/account)

Notion's database structure

This is the general structure of the database processed:

{
	"object": "database",
	"title": [
		{
			"type": "text",
			"text": {
				"content": "Dashboard",
			},
			"plain_text": "Dashboard",
		}
	],
	"properties": {
		"Token": {
			"id": "title",
			"name": "Token",
			"type": "title",
			"title": {}
		},
		"Price/Coin": {
			"name": "Price/Coin",
			"type": "number",
			"number": {
				"format": "number"
			}
		},
		"Coins in wallet": {
			"name": "Coins in wallet",
			"type": "number",
			"number": {
				"format": "number"
			}
		},
		"Wallet Value (€)": {
			"name": "Wallet Value (€)",
			"type": "formula",
			"formula": {
				"expression": "multiply(prop(\"Price/Coin\"), prop(\"Coins in wallet\"))"
			}
		}
	}
}

Run the following command to execute python script

python3 main.py

This command will update the notion Dashboard with coins current values and save it in the archives directory as a CSV file.

Archives processing

python processArchive.py

This command will process the archives directory to create a CSV file for wallets evolution throught time.

Credits

cryptoupdate's People

Contributors

hansipie avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.