Asynchronous Python client for BitAds.ai API
Project description
BitAds Client Library
🚀 Overview
BitAds Client is an asynchronous Python client for interacting with the BitAds.ai API. It allows users to integrate with the BitAds network to retrieve campaign details, validate miners, and interact with the BitAds infrastructure.
📦 Installation
Install the package using pip:
pip install bitads-client
🔧 Configuration
Importing the Client
from bitads_client.client.impl import AsyncBitAdsClient
Initializing the Client
client = AsyncBitAdsClient(
base_url="https://prod-s.a.bitads.ai/api",
hot_key="your-hot-key",
)
📡 API Usage
✅ Ping BitAds API
import asyncio
async def main():
response = await client.ping()
print(response)
await client.close()
asyncio.run(main())
🔗 Generate Miner URL
async def main():
response = await client.generate_miner_url("campaign_id")
print(response.data)
await client.close()
asyncio.run(main())
📊 Send Server Load Data
from bitads_client.schemas import SendServerLoadRequest
async def main():
data = SendServerLoadRequest(
timestamp="2024-06-08 19:33:07",
hostname="server1",
load_average={"1min": 3.5, "5min": 4.2, "15min": 4.0},
)
await client.send_server_load(data)
await client.close()
asyncio.run(main())
📡 Send User IP Activity
from bitads_client.schemas import SendUserIpActivityRequest
async def main():
data = SendUserIpActivityRequest(
user_activity={
"user1": [{"ip": "192.168.1.1", "date": "2024-06-08", "count": 5}]
}
)
await client.send_user_ip_activity(data)
await client.close()
asyncio.run(main())
✅ Running Tests
To run unit tests:
pytest tests/
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
📬 Contact
For issues, please open a GitHub issue or contact support at Discord.
🚀 Enjoy seamless integration with BitAds.ai!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitads_client-0.1.4.tar.gz.
File metadata
- Download URL: bitads_client-0.1.4.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137c1993ee195af9dc7f709b1a01c5eb1cd95d08a518acc5f117c6bd8a0aa3aa
|
|
| MD5 |
54cc924113045e1abfd089867ff58d78
|
|
| BLAKE2b-256 |
13390648f1b999687571bf8c9e9bde2add2531ddae8033831f0aa891e70daa4b
|
File details
Details for the file bitads_client-0.1.4-py3-none-any.whl.
File metadata
- Download URL: bitads_client-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b455c5c6a90e669fd9d05ddbf803ac9b83dda247fbd3500fad349e9131f87389
|
|
| MD5 |
21626c4c0c7ebb52f5883e2a3c2d21c8
|
|
| BLAKE2b-256 |
42203a9f88f24c54e34fed3669e25770a36c0a4819469c290cb092560d4f06af
|