blockpipe-client-0.1.3
توضیحات
A Python library for interacting with Blockpipe Endpoint API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | blockpipe-client-0.1.3 |
| نام | blockpipe-client |
| نسخه کتابخانه | 0.1.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | blockpipe.io |
| ایمیل نویسنده | support@blockpipe.io |
| آدرس صفحه اصلی | https://github.com/blockpipe/python |
| آدرس اینترنتی | https://pypi.org/project/blockpipe-client/ |
| مجوز | - |
# 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:
```bash
pip install blockpipe-client
```
## Usage
1. Import `BlockpipeClient` and create a new instance:
```python
from blockpipe_client import BlockpipeClient
client = BlockpipeClient("<PROJECT_SLUG>", {
"environment": "production", # optional
"baseUrl": "https://app.blockpipe.io/endpoint" # optional
})
```
2. Fetch data from the Blockpipe Endpoint API:
```python
results = client.get(["/path1", "/path2"])
```
# or with a single endpoint
```python
result = client.get("/path1")
```
3. Use the fetched data in your application:
```python
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
[Apache 2.0](LICENSE)
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl blockpipe-client-0.1.3:
pip install blockpipe-client-0.1.3.whl
نصب پکیج tar.gz blockpipe-client-0.1.3:
pip install blockpipe-client-0.1.3.tar.gz