Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Docs

# Builds the API site from the stubs of src/python and publishes it to GitHub Pages from main. Pull
# requests only build it, to see that it still builds. The site is not kept in the repository.
on:
push:
branches: [ main ]
paths:
- 'docs/mkdocs/**'
- 'src/python/**'
- 'docs/architecture.png'
- '.github/workflows/docs.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/mkdocs/**'
- 'src/python/**'
- 'docs/architecture.png'
- '.github/workflows/docs.yml'
workflow_dispatch:

# A new push to a pull request cancels the previous run. Runs that are not
# from a pull request get their own group so they are never cancelled or replaced.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: docs/mkdocs/requirements.in

- name: Install mkdocs and its plugins
run: pip install -r docs/mkdocs/requirements.in

# mkdocstrings reads the stubs without importing anything, so the module does not have to be
# built, but it looks for them in a folder named monero
- name: Lay the stubs out as the monero package
run: |
mkdir -p "$RUNNER_TEMP/stubs"
cp -r src/python "$RUNNER_TEMP/stubs/monero"
echo "MONERO_STUBS=$RUNNER_TEMP/stubs" >> "$GITHUB_ENV"

# strict, so that a docstring or a reference that does not resolve fails the build
- name: Build the site
working-directory: docs/mkdocs
run: mkdocs build --strict

- name: Upload the site
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: docs/mkdocs/public

deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pages
cancel-in-progress: false
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ debian/debhelper-build-stamp
debian/files
debian/*.substvars
debian/*.log
# the site is built and published by .github/workflows/docs.yml
docs/mkdocs/public
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@

[![Pybind](https://img.shields.io/badge/pybind-v2-blue?logo=python&logoColor=white)](https://github.com/pybind/pybind11)
[![Python](https://img.shields.io/badge/python-3.10_%7C_3.11_%7C_3.12_%7C_3.13_%7C_3.14-blue?logo=python&logoColor=white)](https://github.com/libmonero/monero-python#monero-python-library)
[![Docs](https://img.shields.io/badge/docs-stable-blue?logo=readthedocs)](https://libmonero.github.io/monero-python/mkdocs/public/)
[![Docs](https://img.shields.io/badge/docs-stable-blue?logo=readthedocs)](https://libmonero.github.io/monero-python/)
[![Matrix](https://img.shields.io/badge/matrix-monero--python-blue?logo=matrix)](https://matrix.to/#/#monero-python:monero.social)

A Python library for creating Monero applications using RPC and Python bindings to [monero v0.18.5.3 'Fluorine Fermi'](https://github.com/monero-project/monero/tree/v0.18.5.3).

* Supports wallet and daemon RPC clients.
* Supports client-side wallets using Python bindings.
* Supports a keys-only wallet, which has the keys, the seed and the addresses of an account and needs no daemon.
* Supports multisig, view-only, and offline wallets.
* Wallet types are interchangeable by conforming to a [common interface](https://libmonero.github.io/monero-python/mkdocs/public/api/wallet/).
* Wallet types are interchangeable by conforming to a [common interface](https://libmonero.github.io/monero-python/api/wallet/).
* Uses a clearly defined [data model and API specification](https://github.com/libmonero/monero-python/blob/main/docs/monero-spec.pdf) intended to be intuitive and robust.
* Query wallet transactions, transfers, and outputs by their properties.
* Fetch and process binary data from the daemon (e.g. raw blocks).
Expand All @@ -28,7 +29,7 @@ A Python library for creating Monero applications using RPC and Python bindings

<p align="center">
<img width="85%" height="auto" src="docs/architecture.png"/><br>
<i>Build Python applications using RPC or Python bindings to <a href="https://github.com/monero-project/monero">monero-project/monero</a>. Wallet implementations are interchangeable by conforming to a common interface, <a href="https://libmonero.github.io/monero-python/mkdocs/public/api/wallet/">MoneroWallet</a>.</i>
<i>Build Python applications using RPC or Python bindings to <a href="https://github.com/monero-project/monero">monero-project/monero</a>. Wallet implementations are interchangeable by conforming to a common interface, <a href="https://libmonero.github.io/monero-python/api/wallet/">MoneroWallet</a>.</i>
</p>


Expand Down
130 changes: 92 additions & 38 deletions docs/architecture.drawio

Large diffs are not rendered by default.

Binary file modified docs/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ query.account_index = 1
query.subaddress_indices = [0, 1, 2, 3]

# fetch transfers that meets criteria from wallet
transfers: list[MoneroTransferWallet] = wallet.get_transfers(query)
transfers: list[MoneroTransfer] = wallet.get_transfers(query)

# print fetched txs
for transfer in transfers:
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs/docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Welcome to the Monero Python documentation.

The aim of this project is to provide an intuitive and robust way to interact with the Monero cryptocurrency in Python using a clearly defined data model. It provides high level classes representing objects from the Monero environment, like wallets, accounts, addresses and transactions.

Developers can create Monero applications using JSON-RPC or Python bindings to monero v0.18.5.1 'Fluorine Fermi'.
Developers can create Monero applications using JSON-RPC or Python bindings to monero v0.18.5.3 'Fluorine Fermi'.

Contributions can be made via issues and pull requests on GitHub, or communicated via the #monero-python workgroup on Matrix.

Expand Down
Binary file modified docs/mkdocs/docs/images/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions docs/mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repo_url: 'https://github.com/libmonero/monero-python'
edit_uri: edit/main/docs/mkdocs/docs/

markdown_extensions:
# https://squidfunk.github.io/mkdocs-material/extensions/admonition/
# https://squidfunk.github.io/mkdocs-material/reference/admonitions/
- admonition
- abbr
- def_list
Expand Down Expand Up @@ -140,7 +140,9 @@ plugins:
- mkdocstrings:
handlers:
python:
paths: [../../src/python]
# the stubs have to sit in a folder named monero, as the package they describe. CI lays them out
# in a temporary folder and gives it as MONERO_STUBS, there is no need to install the module
paths: [!ENV [MONERO_STUBS, ../../src/python]]
options:
show_source: false
show_root_heading: true
Expand Down
1 change: 0 additions & 1 deletion docs/mkdocs/public/404.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/architecture/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/connection/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/daemon/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/daemon_rpc/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/data_model/connection/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/data_model/daemon/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/data_model/wallet/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/errors/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/serializable_struct/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/utils/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/wallet/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/wallet_full/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/wallet_keys/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/mkdocs/public/api/wallet_rpc/index.html

This file was deleted.

109 changes: 0 additions & 109 deletions docs/mkdocs/public/assets/_mkdocstrings.css

This file was deleted.

Loading
Loading