Skip to main content

xmrig-python

PyPi Python PyPI - Downloads License

A wrapper for the XMRig HTTP API and client manager

Installing xmrig-python

From Source

git clone https://github.com/CoulterStutz/python-xmrig.git && cd python-xmrig
poetry install # or use `pip install .`, dont forget the period to set the source location to the current directory.

Using PyPi

poetry install xmrig # or use `pip install xmrig`.

After that the package will be available to use!

Example Usage

Here is a basic implementation of the API Wrapper now dubbed XMRigAPI.

import xmrig, logging
x = xmrig.XMRigAPI(ip="127.0.0.1", port="5555", access_token="example")
logging.basicConfig()
logging.getLogger("XMRigAPI").setLevel(logging.INFO)            # Change to DEBUG to print out all responses when their methods are called
log = logging.getLogger("MyLOG")

# Control the miner using JSON RPC.
x.pause_miner()
x.resume_miner()
x.stop_miner()
x.start_miner()

# Update cached data from endpoints individually or all at once
x.update_summary()
x.update_all_responses()

# Edit and update the miners `config.json` via the HTTP API.
x.update_config()                                               # This updates the cached data
config = x.config()                                             # Use the `config` property to access the data
config["pools"]["USER"] = "NEW_WALLET_ADDRESS"
x.post_config(config)

# Summary and Backends API data is available as properties in either full or individual format.
log.info(x.summary)                                             # Prints the entire `summary` endpoint response
log.info(x.sum_hashrates)                                       # Prints out the current hashrates
log.info(x.sum_pool_accepted_jobs)                              # Prints out the accepted_jobs counter
log.info(x.sum_pool_rejected_jobs)                              # Prints out the rejected_jobs counter
log.info(x.sum_current_difficulty)                              # Prints out the current difficulty

Metadata

Release files for xmrig 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xmrig 1.1.2
File Size Uploaded Provenance Actions
xmrig-1.1.2.tar.gz 11.4 kB Without provenance Details for xmrig-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xmrig 1.1.2
File Interpreter ABI Platform Actions
xmrig-1.1.2-py3-none-any.whl Python 3 none any Details for xmrig-1.1.2-py3-none-any.whl

Total release size: 22.5 kB

Release files / xmrig-1.1.2.tar.gz

Download URL xmrig-1.1.2.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a627168867411f6bcd68b61d0480c67f8febf7a933654e163ea4ff102782a1c1
BLAKE2b-256 checksum
How to use checksums
cb8fe24e475f122ad4c35fb299c9a05710def7bcddbab944c63a6c17bf6df3b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / xmrig-1.1.2-py3-none-any.whl

Download URL xmrig-1.1.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
593d67d3a45d908d7e3b69ec2d836e1b7560fe73d632423dea1b31bdb5bc816f
BLAKE2b-256 checksum
How to use checksums
b9116740a241c4e4cf942bb1918921b2f5ef17f72f9f348d61e456613603c21f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Security for xmrig 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page