Skip to content

Commit fa839e2

Browse files
committed
fix some api.rst underline too short
add script and instructions to readme fixup formatting fixup yaml workflow file modify generate docs script and format a bit better add manually format api.rst for sections latest docs generated
1 parent 646d442 commit fa839e2

File tree

22 files changed

+509
-2816
lines changed

22 files changed

+509
-2816
lines changed

.github/workflows/python-api-docs.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: "Set up Python"
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.x'
15+
python-version: '3.9.x'
1616

1717
- name: "Install dependencies"
1818
run: |
@@ -24,11 +24,11 @@ jobs:
2424
- name: "Build Python API documentation"
2525
run: |
2626
cd ./bdk-python/
27-
bash ./scripts/build-linux-x86_64.sh
27+
python scripts/generate_docs.py
2828
sphinx-build -b html docs/ docs/_build/html
2929
30-
- name: "Upload Python website"
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: artifact-python-api-docs
34-
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/docs/_build/html/
30+
# - name: "Upload Python website"
31+
# uses: actions/upload-artifact@v4
32+
# with:
33+
# name: artifact-python-api-docs
34+
# path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/docs/_build/html/

bdk-python/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ python setup.py --verbose bdist_wheel
3434
```shell
3535
pip install ./dist/bdkpython-<yourversion>.whl
3636
```
37+
38+
## generate the docs
39+
40+
```shell
41+
python3 scripts/generate_docs.py
42+
sphinx-build -b html docs/ docs/_build/html
43+
```
44+
45+
To rebuild, run the following. be sure to keep the conf.py and index.rst
46+
47+
```shell
48+
rm -rf docs/_build/html
49+
python3 scripts/generate_docs.py
50+
sphinx-build -b html docs/ docs/_build/html
51+
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 2e1e3dc39064c1de4564a7de697f9f15
3+
config: 5fb7a54e8266e4003565896ce90c2a2e
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
-623 Bytes
Binary file not shown.

bdk-python/docs/_build/html/_modules/bdkpython/bdk.html

Lines changed: 223 additions & 103 deletions
Large diffs are not rendered by default.

bdk-python/docs/_build/html/_modules/index.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Overview: module code &mdash; Bitcoin Dev Kit Python documentation</title>
8+
<title>Overview: module code &mdash; BDK Python 0.1.0 documentation</title>
99
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
1010
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
1111

1212

1313
<script src="../_static/jquery.js?v=5d32c60e"></script>
1414
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
15-
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
15+
<script src="../_static/documentation_options.js?v=01f34227"></script>
1616
<script src="../_static/doctools.js?v=9a2dae69"></script>
1717
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
1818
<script src="../_static/js/theme.js"></script>
@@ -29,7 +29,7 @@
2929

3030

3131
<a href="../index.html" class="icon icon-home">
32-
Bitcoin Dev Kit Python
32+
BDK Python
3333
</a>
3434
<div role="search">
3535
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
@@ -41,7 +41,10 @@
4141
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
4242
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
4343
<ul>
44-
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
44+
<li class="toctree-l1"><a class="reference internal" href="../api.html">BDK Python API Reference</a></li>
45+
<li class="toctree-l1"><a class="reference internal" href="../api.html#api-reference">API Reference</a></li>
46+
<li class="toctree-l1"><a class="reference internal" href="../api.html#bdk-module">Bdk Module</a></li>
47+
<li class="toctree-l1"><a class="reference internal" href="../api.html#bitcoin-module">Bitcoin Module</a></li>
4548
</ul>
4649

4750
</div>
@@ -50,7 +53,7 @@
5053

5154
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
5255
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
53-
<a href="../index.html">Bitcoin Dev Kit Python</a>
56+
<a href="../index.html">BDK Python</a>
5457
</nav>
5558

5659
<div class="wy-nav-content">
Lines changed: 25 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,31 @@
1-
API Reference
2-
============
1+
BDK Python API Reference
2+
=====================
33

4-
.. currentmodule:: bdkpython
4+
This document describes the Python API for the Bitcoin Development Kit (BDK).
55

6-
Core Types
7-
---------
6+
Bdk Module
7+
==========
8+
Bitcoin Module
9+
==============
810

9-
Amount and Fees
10-
~~~~~~~~~~~~~~
11-
.. autoclass:: Amount
12-
:members:
13-
:undoc-members:
14-
:show-inheritance:
15-
16-
.. autoclass:: FeeRate
17-
:members:
18-
:undoc-members:
19-
:show-inheritance:
20-
21-
Addresses and Scripts
22-
~~~~~~~~~~~~~~~~~~~
23-
.. autoclass:: Address
24-
:members:
25-
:undoc-members:
26-
:show-inheritance:
27-
28-
.. autoclass:: Script
29-
:members:
30-
:undoc-members:
31-
:show-inheritance:
32-
33-
.. autoclass:: OutPoint
34-
:members:
35-
:undoc-members:
36-
:show-inheritance:
37-
38-
Descriptors
39-
~~~~~~~~~~
40-
.. autoclass:: Descriptor
41-
:members:
42-
:undoc-members:
43-
:show-inheritance:
44-
45-
.. autoclass:: DescriptorPublicKey
46-
:members:
47-
:undoc-members:
48-
:show-inheritance:
49-
50-
.. autoclass:: DescriptorSecretKey
51-
:members:
52-
:undoc-members:
53-
:show-inheritance:
54-
55-
.. autoclass:: DerivationPath
56-
:members:
57-
:undoc-members:
58-
:show-inheritance:
59-
60-
Wallet Operations
61-
---------------
62-
63-
Transaction Building
64-
~~~~~~~~~~~~~~~~~~
65-
.. autoclass:: TxBuilder
66-
:members:
67-
:undoc-members:
68-
:show-inheritance:
69-
70-
.. autoclass:: BumpFeeTxBuilder
71-
:members:
72-
:undoc-members:
73-
:show-inheritance:
74-
75-
.. autoclass:: TxBuilderResult
76-
:members:
77-
:undoc-members:
78-
:show-inheritance:
79-
80-
.. autoclass:: Psbt
81-
:members:
82-
:undoc-members:
83-
:show-inheritance:
84-
85-
Blockchain Clients
86-
~~~~~~~~~~~~~~~~
87-
.. autoclass:: Blockchain
88-
:members:
89-
:undoc-members:
90-
:show-inheritance:
91-
92-
.. autoclass:: ElectrumClient
93-
:members:
94-
:undoc-members:
95-
:show-inheritance:
96-
97-
.. autoclass:: EsploraClient
98-
:members:
99-
:undoc-members:
100-
:show-inheritance:
101-
102-
Wallet
103-
~~~~~~
104-
.. autoclass:: Wallet
105-
:members:
106-
:undoc-members:
107-
:show-inheritance:
108-
109-
.. autoclass:: WalletSync
110-
:members:
111-
:undoc-members:
112-
:show-inheritance:
113-
114-
Utilities
11+
Examples
11512
--------
116-
.. autoclass:: Mnemonic
117-
:members:
118-
:undoc-members:
119-
:show-inheritance:
120-
121-
.. autoclass:: Network
122-
:members:
123-
:undoc-members:
124-
:show-inheritance:
12513

126-
Exceptions
127-
---------
128-
.. autoexception:: InternalError
129-
:members:
130-
:show-inheritance:
131-
132-
.. autoexception:: FeeRateError
133-
:members:
134-
:show-inheritance:
14+
Basic Wallet Usage
15+
~~~~~~~~~~~~~~~~
13516

136-
.. autoexception:: ParseAmountError
137-
:members:
138-
:show-inheritance:
17+
.. code-block:: python
18+
19+
from bdkpython import *
20+
# Create a new wallet
21+
descriptor = "wpkh(...)" # Your descriptor here
22+
wallet = Wallet(descriptor, network=Network.TESTNET)
23+
24+
# Sync wallet
25+
blockchain = Blockchain("https://blockstream.info/testnet/api")
26+
wallet.sync(blockchain)
27+
28+
# Get balance
29+
balance = wallet.get_balance()
30+
print(f"Confirmed balance: {balance.confirmed}")
31+

bdk-python/docs/_build/html/_sources/index.rst.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
Welcome to Bitcoin Dev Kit Python's documentation!
2-
=============================================
1+
Welcome to BDK Python's documentation!
2+
========================================
33

44
.. toctree::
5-
:maxdepth: 10
5+
:maxdepth: 2
66
:caption: Contents:
77

88
api
9-
examples
109

1110
Indices and tables
1211
==================

0 commit comments

Comments
 (0)