bitview-client 0.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bitview_client-0.12.0/.gitignore +51 -0
- bitview_client-0.12.0/.python-version +1 -0
- bitview_client-0.12.0/PKG-INFO +72 -0
- bitview_client-0.12.0/README.md +51 -0
- bitview_client-0.12.0/bitview_client/__init__.py +16465 -0
- bitview_client-0.12.0/pydoc-markdown.yml +13 -0
- bitview_client-0.12.0/pyproject.toml +44 -0
- bitview_client-0.12.0/tests/mempool_compat/.gitignore +1 -0
- bitview_client-0.12.0/tests/mempool_compat/AUDIT.md +120 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_address_info.py +131 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_address_txs.py +99 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_address_txs_chain.py +132 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_address_txs_mempool.py +55 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_address_utxo.py +71 -0
- bitview_client-0.12.0/tests/mempool_compat/addresses/test_validate_address.py +83 -0
- bitview_client-0.12.0/tests/mempool_compat/audit_prompt.md +106 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block.py +52 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_header.py +52 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_height.py +62 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_raw.py +49 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_status.py +61 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_txid_index.py +71 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_txids.py +55 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_txs.py +73 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_txs_start.py +98 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_block_v1.py +80 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_height.py +75 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_recent.py +60 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_tip_hash.py +48 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_tip_height.py +47 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_v1_height.py +87 -0
- bitview_client-0.12.0/tests/mempool_compat/blocks/test_blocks_v1_recent.py +63 -0
- bitview_client-0.12.0/tests/mempool_compat/check_endpoints.py +158 -0
- bitview_client-0.12.0/tests/mempool_compat/conftest.py +227 -0
- bitview_client-0.12.0/tests/mempool_compat/fees/test_mempool_blocks.py +45 -0
- bitview_client-0.12.0/tests/mempool_compat/fees/test_precise.py +39 -0
- bitview_client-0.12.0/tests/mempool_compat/fees/test_recommended.py +39 -0
- bitview_client-0.12.0/tests/mempool_compat/general/test_difficulty_adjustment.py +103 -0
- bitview_client-0.12.0/tests/mempool_compat/general/test_historical_price.py +106 -0
- bitview_client-0.12.0/tests/mempool_compat/general/test_prices.py +43 -0
- bitview_client-0.12.0/tests/mempool_compat/mempool/test_fullrbf_replacements.py +55 -0
- bitview_client-0.12.0/tests/mempool_compat/mempool/test_mempool.py +44 -0
- bitview_client-0.12.0/tests/mempool_compat/mempool/test_recent.py +36 -0
- bitview_client-0.12.0/tests/mempool_compat/mempool/test_replacements.py +53 -0
- bitview_client-0.12.0/tests/mempool_compat/mempool/test_txids.py +50 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/conftest.py +17 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_blocks_fee_rates.py +58 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_blocks_fees.py +74 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_blocks_rewards.py +73 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_blocks_sizes_weights.py +92 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_blocks_timestamp.py +52 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_difficulty_adjustments.py +81 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_hashrate.py +53 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_hashrate_pools.py +49 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pool.py +73 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pool_blocks.py +47 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pool_blocks_height.py +61 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pool_hashrate.py +43 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pools.py +80 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_pools_period.py +54 -0
- bitview_client-0.12.0/tests/mempool_compat/mining/test_reward_stats.py +58 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_cpfp.py +80 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_post_tx.py +55 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_transaction_times.py +105 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx.py +71 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_hex.py +53 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_merkle_proof.py +70 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_merkleblock_proof.py +58 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_outspend.py +79 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_outspends.py +59 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_raw.py +50 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_rbf.py +82 -0
- bitview_client-0.12.0/tests/mempool_compat/transactions/test_tx_status.py +77 -0
- bitview_client-0.12.0/tests/test_basic.py +73 -0
- bitview_client-0.12.0/tests/test_hash_prefix.py +63 -0
- bitview_client-0.12.0/tests/test_metric_data.py +496 -0
- bitview_client-0.12.0/tests/test_tree.py +89 -0
- bitview_client-0.12.0/uv.lock +1471 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Mac OS
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
# Builds
|
|
5
|
+
target
|
|
6
|
+
websites/dist
|
|
7
|
+
bridge/
|
|
8
|
+
/ids.txt
|
|
9
|
+
rust_out
|
|
10
|
+
|
|
11
|
+
# Copies
|
|
12
|
+
*\ copy*
|
|
13
|
+
|
|
14
|
+
# Ignored
|
|
15
|
+
_*
|
|
16
|
+
!__*.py
|
|
17
|
+
/*.md
|
|
18
|
+
/*.py
|
|
19
|
+
/*.json
|
|
20
|
+
/*.html
|
|
21
|
+
!/btc-cycle-sim.html
|
|
22
|
+
/research
|
|
23
|
+
/filter_*
|
|
24
|
+
/heatmaps*
|
|
25
|
+
/oracle*
|
|
26
|
+
/playground
|
|
27
|
+
/*.txt
|
|
28
|
+
/*.csv
|
|
29
|
+
/tmp
|
|
30
|
+
**/.test
|
|
31
|
+
|
|
32
|
+
# Logs
|
|
33
|
+
*.log*
|
|
34
|
+
|
|
35
|
+
# Environment variables/configs
|
|
36
|
+
.env
|
|
37
|
+
|
|
38
|
+
# Profiling
|
|
39
|
+
profile.json.gz
|
|
40
|
+
flamegraph.svg
|
|
41
|
+
*.trace
|
|
42
|
+
|
|
43
|
+
# AI
|
|
44
|
+
.claude/settings*
|
|
45
|
+
!CLAUDE.md
|
|
46
|
+
|
|
47
|
+
# Expand
|
|
48
|
+
expand.rs
|
|
49
|
+
|
|
50
|
+
# AI
|
|
51
|
+
.claude
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.9
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bitview-client
|
|
3
|
+
Version: 0.12.0
|
|
4
|
+
Summary: Bitcoin on-chain analytics client — thousands of metrics, block explorer, and address index
|
|
5
|
+
Project-URL: Homepage, https://bitcoinresearchkit.org
|
|
6
|
+
Project-URL: Repository, https://github.com/bitcoinresearchkit/brk
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Keywords: analytics,api,bitcoin,blockchain,brk,cryptocurrency,data,metrics,on-chain
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# bitview-client
|
|
23
|
+
|
|
24
|
+
Zero-dependency Python client for the [Bitview](https://bitview.space) Bitcoin analytics API.
|
|
25
|
+
|
|
26
|
+
Requires Python 3.9+.
|
|
27
|
+
|
|
28
|
+
[PyPI](https://pypi.org/project/bitview-client/) | [API Reference](https://github.com/bitcoinresearchkit/brk/blob/main/packages/bitview_client/DOCS.md) | [Source](https://github.com/bitcoinresearchkit/brk/tree/main/packages/bitview_client)
|
|
29
|
+
|
|
30
|
+
AI clients can use the same API through the official stateless, read-only MCP
|
|
31
|
+
endpoint at [mcp.bitview.space](https://mcp.bitview.space/). No authentication
|
|
32
|
+
is required.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install bitview-client
|
|
38
|
+
# or
|
|
39
|
+
uv add bitview-client
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You can also copy [`bitview_client/__init__.py`](./bitview_client/__init__.py)
|
|
43
|
+
into a project. The client has no runtime dependencies; Pandas and Polars are
|
|
44
|
+
only needed for their optional conversion helpers.
|
|
45
|
+
|
|
46
|
+
## Quick start
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from bitview_client import BitviewClient
|
|
50
|
+
|
|
51
|
+
# Use the public API or point the client at a self-hosted Bitview server.
|
|
52
|
+
client = BitviewClient("https://bitview.space")
|
|
53
|
+
|
|
54
|
+
# Mempool.space-compatible blockchain endpoints.
|
|
55
|
+
block_hash = client.get_block_by_height(800000)
|
|
56
|
+
tx = client.get_tx(
|
|
57
|
+
"a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Typed, chainable series access.
|
|
61
|
+
prices = (
|
|
62
|
+
client.series.price.split.close.usd.by.day1()
|
|
63
|
+
.tail(30)
|
|
64
|
+
.fetch()
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Programmatic access when the series name is only known at runtime.
|
|
68
|
+
same_prices = client.series_endpoint("price_close", "day1").tail(30).fetch()
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Series endpoints support integer and date slices, `head(n)`, `tail(n)`,
|
|
72
|
+
`skip(n).take(m)`, `fetch_csv()`, `len()`, and `version()`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# bitview-client
|
|
2
|
+
|
|
3
|
+
Zero-dependency Python client for the [Bitview](https://bitview.space) Bitcoin analytics API.
|
|
4
|
+
|
|
5
|
+
Requires Python 3.9+.
|
|
6
|
+
|
|
7
|
+
[PyPI](https://pypi.org/project/bitview-client/) | [API Reference](https://github.com/bitcoinresearchkit/brk/blob/main/packages/bitview_client/DOCS.md) | [Source](https://github.com/bitcoinresearchkit/brk/tree/main/packages/bitview_client)
|
|
8
|
+
|
|
9
|
+
AI clients can use the same API through the official stateless, read-only MCP
|
|
10
|
+
endpoint at [mcp.bitview.space](https://mcp.bitview.space/). No authentication
|
|
11
|
+
is required.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install bitview-client
|
|
17
|
+
# or
|
|
18
|
+
uv add bitview-client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You can also copy [`bitview_client/__init__.py`](./bitview_client/__init__.py)
|
|
22
|
+
into a project. The client has no runtime dependencies; Pandas and Polars are
|
|
23
|
+
only needed for their optional conversion helpers.
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from bitview_client import BitviewClient
|
|
29
|
+
|
|
30
|
+
# Use the public API or point the client at a self-hosted Bitview server.
|
|
31
|
+
client = BitviewClient("https://bitview.space")
|
|
32
|
+
|
|
33
|
+
# Mempool.space-compatible blockchain endpoints.
|
|
34
|
+
block_hash = client.get_block_by_height(800000)
|
|
35
|
+
tx = client.get_tx(
|
|
36
|
+
"a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# Typed, chainable series access.
|
|
40
|
+
prices = (
|
|
41
|
+
client.series.price.split.close.usd.by.day1()
|
|
42
|
+
.tail(30)
|
|
43
|
+
.fetch()
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Programmatic access when the series name is only known at runtime.
|
|
47
|
+
same_prices = client.series_endpoint("price_close", "day1").tail(30).fetch()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Series endpoints support integer and date slices, `head(n)`, `tail(n)`,
|
|
51
|
+
`skip(n).take(m)`, `fetch_csv()`, `len()`, and `version()`.
|