View the Project on GitHub SecretSatoshis/Bitcoin-Report-Library
Bitcoin market and on-chain analytics pipeline powering the Secret Satoshis research stack. The system delivers deterministic, reproducible datasets optimized for downstream modeling, reporting, and visualization.
This is the single data source for the entire Secret Satoshis analytics stack. All data fetching, metric calculation, and feature engineering happens here. Downstream projects (e.g., Bitcoin-Chart-Library) consume the CSV output directly — no API calls or duplicated logic.
Bitcoin-Report-Library/
├── main.py # Pipeline orchestrator
├── data_format.py # Data access and feature engineering
├── report_tables.py # Table generation and formatting
├── data_definitions.py # Configuration and constants
├── csv/ # Output directory (consumed by Chart Library)
├── reports/ # Report prompt reference
└── requirements.txt # Python dependencies
| Module | Responsibility |
|---|---|
main.py |
Orchestrates end-to-end execution: data ingestion, metric calculation, table assembly, cycle analysis, CSV export |
data_format.py |
Fetches raw data from APIs, normalizes timestamps, engineers features, calculates derived metrics, computes cycle analysis (drawdowns, halvings, cycle lows) |
report_tables.py |
Builds tabular outputs: fundamentals, ROI, performance comparisons, valuations, heatmaps, OHLC |
data_definitions.py |
Central configuration: tickers, API settings, reference data, metric templates, constants |
reports/ |
Markdown report reference for the Weekly Bitcoin Recap and its current CSV inputs |
APIs (BRK, yfinance, CoinGecko, Kraken)
│
▼
data_format.py ──► Fetches & calculates all metrics
│
▼
report_tables.py ──► Generates formatted report tables
│
▼
csv/ ──► All outputs exported as CSV
│
▼
Bitcoin-Chart-Library ──► Reads CSVs, generates charts
# Clone the repository
git clone https://github.com/SecretSatoshis/Bitcoin-Report-Library.git
cd Bitcoin-Report-Library
# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
python main.py
The pipeline executes in sequence:
csv/Note: The CSV output is consumed by Bitcoin-Chart-Library for visualization. Run this pipeline first before generating charts.
| Source | Data Type | Endpoint |
|---|---|---|
| BRK (Bitview) API | On-chain metrics, difficulty, supply data | bitview.space/api |
| Yahoo Finance | Equities, ETFs, indices, commodities, forex | yfinance library |
| CoinGecko | Altcoin prices, market caps, BTC dominance | Public API |
| Kraken | Bitcoin OHLC price data | Public API |
| Alternative.me | Fear & Greed Index | Public API |
| Google Sheets | Miner efficiency data | CSV export |
All configuration is centralized in data_definitions.py:
The reports/ folder stores the documentation reference for the canonical Secret Satoshis weekly report format that sits on top of the CSV pipeline.
reports/weekly_bitcoin_recap.md documents the Weekly Bitcoin Recap structure and promptsThis file is not executable code. It is a reference document for agents and maintainers who need to understand which current Report Library datasets support each recap section.
All outputs are written to csv/ and served via GitHub Pages at https://secretsatoshis.github.io/Bitcoin-Report-Library/csv/ for remote consumption by downstream projects.
The master metrics dataset is exported as gzipped CSV (.csv.gz) to keep the file under GitHub’s size limits. pd.read_csv() reads .csv.gz files natively — no manual decompression needed.
| File | Description |
|---|---|
master_metrics_data.csv.gz |
Complete dataset with all calculated metrics and change calculations (gzipped) |
fundamentals_table.csv |
Network performance, security, economics, valuation metrics |
summary_table.csv |
Labeled summary metrics with Metric, Value, and Category columns |
performance_table.csv |
Multi-asset performance comparison |
mtd_return_comparison.csv |
Month-to-date return comparison |
ytd_return_comparison.csv |
Year-to-date return comparison |
relative_value_comparison.csv |
Relative valuation metrics |
roi_table.csv |
Historical ROI by labeled time frame and entry date |
eoy_model_data.csv |
End-of-year price model projections |
5k_bucket_table.csv |
Price distribution in $5,000 buckets with current bucket markers |
1k_bucket_table.csv |
Price distribution in $1,000 buckets with current bucket markers |
monthly_heatmap_data.csv |
Monthly returns heatmap data |
ohlc_data.csv |
OHLC price data |
These CSV files are pre-computed for downstream visualization by Bitcoin-Chart-Library:
| File | Description |
|---|---|
drawdown_data.csv |
ATH drawdown cycles with days since ATH and percentage decline |
cycle_low_data.csv |
Market cycle performance indexed from cycle lows |
halving_data.csv |
Performance indexed from each Bitcoin halving (5 eras) |
cagr_data.csv |
Rolling CAGR calculations for all metrics (1Y, 2Y, 3Y, 4Y) |
| File | Description |
|---|---|
brk_onchain_raw.csv |
Raw BRK API on-chain data before transformations |
pandas==2.2.0
numpy==1.26.4
requests==2.32.3
yfinance==0.2.60
GPLv3