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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitads_client-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 641947a748add004d97573daac5d36886ce5d943f129e16b289ccebb2938b492
MD5 e19e02a8bf4d6ee485d1ec31255a8dac
BLAKE2b-256 5bc79e37abb8b26b38565cd933759cc864079448d8776693b5d0025ea8de64d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bitads_client-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abe187005bdba9eccea7f296725117ea5293796382768fd030d5235be0743708
MD5 9a05b1b88c355ba078d5eb521c878c77
BLAKE2b-256 a0390841e027fe2433908a0847ef975c1caf6ef0a21d0ec2607529165a7e7da7

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