{"id":25390140,"url":"https://github.com/everoddandeven/monero-python","last_synced_at":"2025-07-23T02:34:37.114Z","repository":{"id":288649817,"uuid":"967018842","full_name":"everoddandeven/monero-python","owner":"everoddandeven","description":"Python library for using Monero","archived":false,"fork":false,"pushed_at":"2025-06-11T21:48:35.000Z","size":31399,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T22:44:10.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/everoddandeven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-15T19:55:21.000Z","updated_at":"2025-06-11T21:48:39.000Z","dependencies_parsed_at":"2025-06-11T22:42:39.808Z","dependency_job_id":null,"html_url":"https://github.com/everoddandeven/monero-python","commit_stats":null,"previous_names":["everoddandeven/monero-python"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/everoddandeven/monero-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everoddandeven%2Fmonero-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everoddandeven%2Fmonero-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everoddandeven%2Fmonero-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everoddandeven%2Fmonero-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/everoddandeven","download_url":"https://codeload.github.com/everoddandeven/monero-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everoddandeven%2Fmonero-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266606777,"owners_count":23955342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-15T14:37:14.384Z","updated_at":"2025-07-23T02:34:37.093Z","avatar_url":"https://github.com/everoddandeven.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monero Python Library\n[![Build](https://github.com/everoddandeven/monero-python/actions/workflows/build.yml/badge.svg)](https://github.com/everoddandeven/monero-python/actions/workflows/build.yml)\n\nPython library for using Monero\n\nA Python library for creating Monero applications using RPC and Python bindings to [monero v0.18.4.0 'Fluorine Fermi'](https://github.com/monero-project/monero/tree/v0.18.4.0).\n\n* Supports wallet and daemon RPC clients.\n* Supports client-side wallets using Python bindings.\n* Supports multisig, view-only, and offline wallets.\n* Wallet types are interchangeable by conforming to a [common interface](https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html).\n* Uses a clearly defined [data model and API specification](https://woodser.github.io/monero-java/monero-spec.pdf) intended to be intuitive and robust.\n* Query wallet transactions, transfers, and outputs by their properties.\n* Fetch and process binary data from the daemon (e.g. raw blocks).\n* Receive notifications when blocks are added to the chain or when wallets sync, send, or receive.\n\n## Architecture\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg width=\"85%\" height=\"auto\" src=\"docs/architecture.png\"/\u003e\u003cbr\u003e\n\t\u003ci\u003eBuild Python\n     applications using RPC or Python bindings to \u003ca href=\"https://github.com/monero-project/monero\"\u003emonero-project/monero\u003c/a\u003e.  Wallet implementations are interchangeable by conforming to a common interface, \u003ca href=\"https://woodser.github.io/monero-java/javadocs/monero/wallet/MoneroWallet.html\"\u003eMoneroWallet\u003c/a\u003e.\u003c/i\u003e\n\u003c/p\u003e\n\n\n## Sample code\n\n```python\nfrom monero import *\n\n# connect to daemon\ndaemon: MoneroDaemon = MoneroDaemonRpc(\"http://localhost:38081\", \"superuser\", \"abctesting123\")\nheight: int = daemon.get_height(); # 1523651\ntxsInPool: list[MoneroTx] = daemon.get_tx_pool() # get transactions in the pool\n\n# create wallet from mnemonic phrase using Python bindings to monero-project\n\nwallet_config = MoneroWalletConfig()\nwallet_config.path = \"sample_wallet_full\"\nwallet_config.password = \"supersecretpassword123\"\nwallet_config.network_type = MoneroNetworkType.STAGENET\nwallet_config.server = MoneroRpcConnection()\nwallet_config.server.username = \"superuser\"\nwallet_config.server.password = \"abctesting123\"\nwallet_config.seed = \"hefty value scenic...\"\nwallet_config.restore_height = 573936\nwallet_full: MoneroWallet = MoneroWalletFull.create_wallet(wallet_config)\n\n# custom wallet listener implementation\nlistener: MoneroWalletListener = MyWalletListener()\n\n# synchronize the wallet and receive progress notifications\nwallet_full.sync(listener)\n\n# synchronize in the background every 5 seconds\nwallet_full.start_syncing(5000)\n\n# receive notifications when funds are received, confirmed, and unlocked\nwallet_full.add_listener(listener)\n\n# connect to wallet RPC and open wallet\nwallet_rpc: MoneroWallet = new MoneroWalletRpc(\"http://localhost:38083\", \"rpc_user\", \"abc123\")\nwallet_rpc.open_wallet(\"sample_wallet_rpc\", \"supersecretpassword123\")\nprimary_address: str = wallet_rpc.get_primary_address() # 555zgduFhmKd2o8rPUz...\nbalance: int = wallet_rpc.get_balance() # 533648366742\ntxs: list[MoneroTxWallet] = wallet_rpc.get_txs() # get transactions containing transfers to/from the wallet\n\n# send funds from RPC wallet to full wallet\ntx_config = MoneroTxConfig()\ntx_config.account_index = 0\ntx_config.address = wallet_full.get_address(1, 0)\ntx_config.amount = 250000000000 # send 0.25 XMR (denominated in atomic units)\ntx_config.relay = False # create transaction and relay to the network if true\n\ncreated_tx: MoneroTxWallet = wallet_rpc.create_tx(tx_config)\nfee: int = created_tx.get_fee() # \"Are you sure you want to send... ?\"\nwallet_rpc.relay_tx(created_tx) # relay the transaction\n\n# save and close wallet\nwallet_full.close(true)\n```\n\n## Using monero-python in your project\n\n#### For pip:\n\n```bash\n# still not available, waiting for legacy monero package replace on PyPI\n\npip3 install monero\n```\n\n#### For system-wide installation:\n\n##### Ubuntu\n```bash\n# still not available on official debian/ubuntu repository\n\nsudo apt install -y python3-monero\n```\n\n##### Fedora/RedHat\n\n```bash\n# still not available on official fedora repository\n\nsudo dnf install -y python3-monero\n```\n\n#### If using RPC servers:\n\n1. Download and install [Monero CLI](https://web.getmonero.org/downloads/).\n2. Start monerod, e.g.: `./monerod --stagenet` (or use a remote daemon).\n3. Start monero-wallet-rpc, e.g.: `./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38083 --rpc-login rpc_user:abc123 --wallet-dir ./`\n\n\u003e [!NOTE]\n\u003e On Windows, if you want to use native wallets instead of monero-wallet-rpc, or if you want to process binary data, first install MSYS2:\n\u003e 1. Install [MSYS2](https://www.msys2.org/).\n\u003e 2. Environment variables \u003e System variables \u003e Path \u003e Edit \u003e New \u003e C:\\msys64\\mingw64\\bin\n\n## Building monero-python from source\n\nFor convenience, native libraries for Linux, macOS, and Windows are distributed with monero-python, but they can be built independently from source:\n\n### Linux and macOS\n\n1. Install build dependencies:\u003cbr\u003e\n    ```bash\n    # Ubuntu/Debian\n\n    sudo apt install -y python3-all python3-pip python3-pybind11\n    ```\n    ```bash\n    # Fedora/RedHat\n\n    sudo dnf install -y python3-all python3-pip python3-pybind11\n    ```\n    \n2. Clone the project repository: \n    ```bash\n    git clone --recurse-submodules https://github.com/everoddandeven/monero-python.git\n    ```\n3. Build the monero-cpp submodule (located at `./external/monero-cpp`) as a native library by following [instructions](https://github.com/woodser/monero-cpp#using-monero-cpp-in-your-project) for your system.\n4. Copy shared library `./external/monero-cpp/build/libmonero-cpp.so` to `/usr/lib`:\n    ```\n    sudo cp ./external/monero-cpp/build/libmonero-cpp.so /usr/lib/\n    ```\n5. Build monero-python to `./build/`:\u003cbr\u003e\n    ```bash\n    cd monero-python\n    mkdir -p build\n    cd build\n    cmake ..\n    make\n    ```\n6. Or build and install monero-python with pip: `pip3 install . --break-system-packages`\n\n## Memory Growth\n\nIf you see unrestricted memory growth using monero-python, consider applying [jemalloc](https://jemalloc.net/) to improve memory management with `malloc`. In many cases, this can completely resolve the memory growth.\n\nFor example: `export LD_PRELOAD=/path/to/libjemalloc.a` then run your app.\n\n## Running Python tests\n\n1. Install `pytest`:\n    ```bash\n    # With PIP\n\n    pip3 install pytest --break-system-packages\n    ```\n    ```bash\n    # System-wide installation Ubuntu/Debian\n\n    sudo apt install -y python3-pytest\n    ```\n    ```bash\n    # System-wide installation Fedora/RedHat\n\n    sudo dnf install -y python3-pytest\n    ```\n2. Clone the project repository: \n    ```bash\n    git clone --recurse-submodules https://github.com/everoddandeven/monero-python.git\n    ```\n3. `cd monero-python`\n4. Start RPC servers:\n\t1. Download and install [Monero CLI](https://web.getmonero.org/downloads/).\n\t2. Start monerod, e.g.: `./monerod --stagenet` (or use a remote daemon).\n\t3. Start monero-wallet-rpc, e.g.: `./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38083 --rpc-login rpc_user:abc123 --wallet-dir ./`\n5. Configure the appropriate RPC endpoints, authentication, and other settings in [monero_test_utils.py](tests/utils/monero_test_utils.py).\n6. Run all *.py files in tests folder with `pytest`.\n\n\n## Related projects\n\n* [monero-cpp](https://github.com/woodser/monero-cpp)\n* [monero-java](https://github.com/woodser/monero-cpp)\n* [monero-ts](https://github.com/woodser/monero-ts)\n\n## License\n\nThis project is licensed under MIT.\n\n## Donations\n\nPlease consider donating to support the development of this project. 🙏\n\n\u003cp align=\"center\"\u003e\n  \u003ccode\u003eXMR\u003c/code\u003e\u003cbr\u003e\n\t\u003cimg src=\"donate.png\" style=\"margin-top: 5px\" width=\"115\" height=\"115\"/\u003e\u003cbr\u003e\n\t\u003ccode\u003e84rXAu3QhsfbQ2vbxyoEptbRLZ2gtyL8k2qCeJwM5AU4FcxVDEbLRuxMZD5pXD1TR295Nodn7y9mkjoMemHrnMqa9ZnJTza\u003c/code\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feveroddandeven%2Fmonero-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feveroddandeven%2Fmonero-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feveroddandeven%2Fmonero-python/lists"}