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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio_mrr-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7a7c771c238165fe057ea434807aae6a9964a852f3fadb5c31ee73fa70927409
MD5 b3f2ffde3ab965b593a651e2ebbf59b9
BLAKE2b-256 7224b619c24612cd23e9edbbbf5996b7d69d1789dfb5158e4208d544acdc0436

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_mrr-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 575280d3a658eb6619afe56e8ec5a1ec350943130adbdf86709b37acf9b9df0b
MD5 180588dd338066a17087fc64f93b3115
BLAKE2b-256 d20801e1a6189af91842b65669b1c4086c94965fb88cd44f5ee212de91b4ee03

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