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.0.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.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitads_client-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 541bf29ad93e12bcde40cbef0e403bb05095bbaa5f0c9ddac0787b50d5a11c0e
MD5 68570eb6c264b35a48414bb5ce709603
BLAKE2b-256 b6da81f81d5d50feefb8d38484fab0808f014e3a35da3ee4ebdadfe87ae27125

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitads_client-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2fb591e6c05fee8ec3b5528bdc32c3cb6cf2dd5bcb510613c4e48db0e914771
MD5 5fe94d55eced7a9117f389a3163d8bb1
BLAKE2b-256 fb4339585bb912baf222db11da176525ef62a1d9a8a993ce8a647eb13018f78d

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