Async library for MiningRigRentals API v2
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio_mrr-0.2.0.tar.gz.
File metadata
- Download URL: aio_mrr-0.2.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39de706958e59c3f9be471f8aa617fc0046bfbf5b24cce66497ec9193d1f4f9b
|
|
| MD5 |
e5ee1f0546728464f50b11495c25d8fa
|
|
| BLAKE2b-256 |
92e6ad6ccd0891f6f4b4086e1b0c7b712fa98ab8839ed7ae0ec4bd21f866d279
|
File details
Details for the file aio_mrr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aio_mrr-0.2.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
525881c83f50528e25f4660bd82094015aebc353a2c8b3d45e71728e9ba53977
|
|
| MD5 |
cd9595a2e1c00ba86e03e940ad74a584
|
|
| BLAKE2b-256 |
b97cc91ec95497997afef581b67e4380cc27f630f6587405ee2cfaf635198383
|