Client written in Python 3 for Blockchain API service:
- Get Bitcoin blockchain charts data
- Get Bitcoin blockchain statistical data
- Get Bitcoin mining pools data
You can also:
- Persist data via JSON format file pipeline
- Persist data via MongoDB pipeline
- Persist data via PostgreSQL pipeline
- Automatize data fetching with jobs scheduler
- Deploy to Heroku cloud platform
These instructions will get you a copy of the project on your local system.
Blockchain API Client uses a number of open source projects to work properly:
- apscheduler - Advanced Python Scheduler
- configparser - Configuration file parser
- psycopg2 - PostgreSQL adapter fo Python
- pymongo - Python driver for MongoDB
- python-dotenv - .env file management
- requests - HTTP for Humans
And of course Blockchain API Client itself is open source with a public repository on GitHub.
A step by step series of examples:
Get historical price for Bitcoin in json format
from blockchain.api import BlockchainAPIClient
api = BlockchainAPIClient('charts')
response = api.call(chart='market-price', timespan='all')
Get market capitalization for Bitcoin in json format
from blockchain.api import BlockchainAPIClient
api = BlockchainAPIClient('charts')
response = api.call(chart='market-cap', timespan='all')
Get Bitcoin blockchain statistics in json format
from blockchain.api import BlockchainAPIClient
api = BlockchainAPIClient('stats')
response = api.call()
Get Bitcoin minig pools info in json format
from blockchain.api import BlockchainAPIClient
api = BlockchainAPIClient('pools')
response = api.call(timespan='5days')
Persist data in JSON file
from blockchain.pipelines import JSONFileWriterPipeline
file = JSONFileWriterPipeline.config()
file.write(response)
Persist (save/update) data with MongoDB
from blockchain.pipelines import MongoDBPipeline
mongo = MongoDBPipeline.config()
mongo.open_connection()
mongo.persist_data(response)
mongo.close_connection()
For a complete description of available parameters please check Blockchain API documentation
MIT
Free Software, Hell Yeah!