A Python library for interacting with Blockpipe Endpoint API
Project description
Blockpipe Client for Python
Blockpipe Client is a Python library for interacting with Blockpipe Endpoint API. It provides a simple interface for fetching data from the API and supports both single endpoint and multiple endpoints.
Installation
Install the package using pip:
pip install blockpipe-client
Usage
- Import
BlockpipeClient
and create a new instance:
from blockpipe_client import BlockpipeClient
client = BlockpipeClient("<PROJECT_SLUG>", {
"environment": "production", # optional
"baseUrl": "https://app.blockpipe.io/endpoint" # optional
})
- Fetch data from the Blockpipe Endpoint API:
results = client.get(["/path1", "/path2"])
or with a single endpoint
result = client.get("/path1")
- Use the fetched data in your application:
for result in results:
print(result)
# If you only requested one endpoint, you can access the data directly:
print(result)
API
BlockpipeClient
A Python class representing a Blockpipe Client instance.
Constructor:
project
: The project slug.options
(optional): A dictionary with optional configurations:environment
: The deployment environment. Default is"production"
.baseUrl
: The base URL for the API. Default is"https://app.blockpipe.io/endpoint"
.
get
A method to fetch data from one or multiple Blockpipe Endpoint API paths.
Arguments:
endpoints
: A list of endpoint paths or a single endpoint path as a string.
Returns:
A list of data fetched from the specified endpoints, or a single data object if a single endpoint path was provided.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blockpipe-client-0.1.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for blockpipe_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e5a371146cd234511e420a18784201581d9a71b1f2da487b99148cc329a8e4 |
|
MD5 | cb01ed5a1e42e4af8de5793a9ba2567b |
|
BLAKE2b-256 | 40c95d727b88b7d2cc5a69eb468cc50e41c5f7f941082a20bed96be3c1f9f81e |