aio-mrr
Async Library for MiningRigRentals API v2
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:
01_quickstart.py— basic initialization and simple request02_account_balance.py— account operations03_manage_rigs.py— rig management04_create_rental.py— rental creation05_rig_groups.py— rig group management06_info_and_pricing.py— info and pricing07_error_handling_demo.py— error handling08_advanced_search.py— advanced search09_pool_management.py— pool management10_profile_management.py— profile management
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
aio-mrr is MIT licensed code.
Designed & built in Novosibirsk, Russia by SibNeuroTech
Contact: @GRinvest
Release files for aio-mrr 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aio_mrr-0.2.2.tar.gz | 156.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aio_mrr-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 214.8 kB
Release files / aio_mrr-0.2.2.tar.gz
| Download URL | aio_mrr-0.2.2.tar.gz |
|---|---|
| Size | 156.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a7c771c238165fe057ea434807aae6a9964a852f3fadb5c31ee73fa70927409
|
|
BLAKE2b-256 checksum How to use checksums |
7224b619c24612cd23e9edbbbf5996b7d69d1789dfb5158e4208d544acdc0436
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / aio_mrr-0.2.2-py3-none-any.whl
| Download URL | aio_mrr-0.2.2-py3-none-any.whl |
|---|---|
| Size | 58.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
575280d3a658eb6619afe56e8ec5a1ec350943130adbdf86709b37acf9b9df0b
|
|
BLAKE2b-256 checksum How to use checksums |
d20801e1a6189af91842b65669b1c4086c94965fb88cd44f5ee212de91b4ee03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|