Skip to main content

Asynchronous Python client for BitAds.ai API

Project description

BitAds Client Library

BitAds Logo

🚀 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

bitads_client-0.1.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitads_client-0.1.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bitads_client-0.1.3.tar.gz.

File metadata

  • Download URL: bitads_client-0.1.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for bitads_client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5908f2597ec3486a87eb139901e7f507036da79b217930b2970c5528b1acf4e5
MD5 af9c3f59aa2cc3a07ab15c8c61b414fd
BLAKE2b-256 3429cae189c57e5351b00ef0b0fdc05ac6b074b3ed2c0d6abe3c4d509ba5e95e

See more details on using hashes here.

File details

Details for the file bitads_client-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: bitads_client-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for bitads_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d43aa5c3cb8491c00fb6699112a11dd35ac840a39bad9b9b5bdc4f3c0a424541
MD5 746ecde12f7165914679d95eb4351681
BLAKE2b-256 41a78714dccaf0e194c098505fec03ace9de0a89e68e2391d62038243b27c60a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page