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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitads_client-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d8bceea1e96f8659e3dcfb2827a99c15fbfaa03ac6cc5e2398e9324a0d1e19e7
MD5 2bb27e1f4387e3aba7477739c50f173d
BLAKE2b-256 a979796ba470b80711c7f729132cc2d7b6d05bf66d5121803e5b07a3e504e648

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitads_client-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d4ae440e79da1c90f8c46b16c111154dc47d525ec41d360f2b3e426ec86c669
MD5 c242374937b21a384e0b8195e40e3977
BLAKE2b-256 8c863e2683ccc9e434b03c5f46681ecd2f2fb41c0f12b78ad9e5f11da90aeca4

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