Skip to main content

Async library for MiningRigRentals API v2

Project description

aio-mrr

Async Library for MiningRigRentals API v2

Python Version License Code Style

Overview

aio-mrr is an asynchronous Python client for the MiningRigRentals API v2, built on aiohttp and pydantic. The library provides a typed interface to all API methods with automatic error handling, retry logic, and HMAC-SHA1 authentication.

Features

  • async/await — fully asynchronous API
  • Pydantic models — automatic validation and typed responses
  • Retry logic — automatic retries on network errors
  • HMAC-SHA1 authentication — secure API communication
  • Connection pooling — efficient connection management
  • Secret masking — API key protection in logs

Installation

pip install aio-mrr

For development:

pip install -e ".[dev]"

Quick Start

import asyncio
import os
from aio_mrr import MRRClient

async def main():
    api_key = os.environ.get("MRR_API_KEY")
    api_secret = os.environ.get("MRR_API_SECRET")

    if not api_key or not api_secret:
        raise ValueError("MRR_API_KEY and MRR_API_SECRET must be set")

    async with MRRClient(api_key, api_secret) as client:
        # Check authentication
        response = await client.whoami()
        if response.success:
            print(f"Logged in as: {response.data['username']}")

        # Get balance
        balance = await client.account.get_balance()
        if balance.success:
            print(f"Balance: {balance.data}")

asyncio.run(main())

Documentation

Full documentation is available on GitHub Pages:

Examples

Usage examples are available in the examples/ directory:

Requirements

  • Python 3.12+
  • aiohttp >= 3.13.0
  • pydantic >= 2.12.0
  • tenacity >= 9.1.0
  • loguru >= 0.7.0

API Coverage

The library covers all 55 public methods of the MiningRigRentals API v2:

Subclient Methods Description
Client 1 Authentication check
AccountClient 16 Account, balance, pools, profiles
InfoClient 4 Servers, algorithms, currencies
PricingClient 1 Conversion rates and prices
RigClient 15 Rig management
RentalClient 12 Rental management
RigGroupClient 7 Rig groups

Contributing

Pull requests are welcome! Please open an issue to discuss changes before submitting a PR.

License

MIT License



aio-mrr is MIT licensed code.
Designed & built in Novosibirsk, Russia by SibNeuroTech
Contact: @GRinvest

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

aio_mrr-0.2.1.tar.gz (156.7 kB view details)

Uploaded Source

Built Distribution

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

aio_mrr-0.2.1-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

Details for the file aio_mrr-0.2.1.tar.gz.

File metadata

  • Download URL: aio_mrr-0.2.1.tar.gz
  • Upload date:
  • Size: 156.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for aio_mrr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 869a13d7af6c14f91e4833423f81a6cefdbfc9f7a02fed1caec26ec490dc019f
MD5 0e9f0b6d76f46a6b90557f1352f7ebe4
BLAKE2b-256 dc8d12a0bbd2a044f7c70e2da3ae983e6b8e24b8303eb635e3a38875327055c2

See more details on using hashes here.

File details

Details for the file aio_mrr-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: aio_mrr-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 58.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for aio_mrr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69ec08605788d1493926a74c83274d95429da5a0da4bb3a223b2e0fd57acf252
MD5 c89298518b2eda6fe24d9bf1be56ba8c
BLAKE2b-256 2102713f2e579027a46a150cd3b84406144f38c80aaf70edf9aaf4f5bbec1c4e

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