Busabase
Busabase 是一个开源(MIT)数据库与 AI 智能体工作空间——将数据、文档、技能和应用集成于一体。您可以本地运行、在网络内自托管或使用 Busabase Cloud,从而开启新时代。
AI 翻译
尚未检测到更新。GitHub 发布版本后会显示在这里。
Truck it or flare it? Netback model for trucking stranded Permian & Eagle Ford gas as CNG/LNG
翻译准备中
正在加载完整 README。
查看完整 README ↗Should a producer with stranded gas truck it as CNG or LNG, or keep flaring it? This project answers that every trading day for 18 real, satellite-detected flares in the Permian and Eagle Ford. It uses only public data: EIA prices, World Bank/NOAA VIIRS flare detections, EIA basin boundaries and OSRM road routing. A Postgres star schema, idempotent ingestion with data-quality checks, a netback model written in readable SQL, a sensitivity analysis and a dashboard with assumption controls sit on top.
▶ Live dashboard: kaavinb.github.io/virtual-pipeline-netback: no install, works on a phone. Drag the sliders to ask "what if?"; every view is a shareable link.
The bottom-up cost model reproduces the World Bank's independent full-chain estimates within 3–9% (06).
A virtual pipeline (CNG/LNG in ISO containers on trucks) earns its keep where pipelines don't reach. The questions a commercial or BI team asks every day are the ones this model answers:
The pipeline-versus-fuel result is the strategic point: the value sits in delivered-fuel markets, not pipeline injection, and distance only matters at the margin.
flowchart LR
subgraph Sources["Public sources"]
EIA["EIA API v2<br/>Henry Hub daily · diesel weekly"]
WB["World Bank / NOAA VIIRS<br/>flare volumes by location"]
GIS["EIA basin boundaries"]
OSRM["OSRM routing"]
Y["assumptions.yaml<br/>38 sourced / labelled inputs"]
end
subgraph Ingest["Python ingestion (idempotent, logged, retried)"]
I1["eia.py"] --- I2["sites.py"] --- I3["routes.py"] --- I4["assumptions.py"]
end
subgraph PG["PostgreSQL 17"]
CORE[("core<br/>star schema")]
OPS[("ops<br/>ingest runs · DQ results")]
MART["mart (SQL views)<br/>v_netback_daily · v_site_latest<br/>scenarios · tornado · curves"]
end
EIA --> I1 --> CORE
WB --> I2
GIS --> I2 --> CORE
OSRM --> I3 --> CORE
Y --> I4 --> CORE
CORE --> MART
CORE --> DQ["dq.py: 14 checks"] --> OPS
MART --> MB["Metabase dashboard<br/>(live, with assumption controls)"]
MART --> CSV["CSV extracts → Tableau Public"]
Netback = delivered price − (treatment + compression or liquefaction) − trucking − (decompression or regas) − fees, all in $/MMBtu at the wellsite. Trucking is built bottom-up:
trucking $/MMBtu = fixed + 2 × (road miles + last mile) × (diesel $/gal ÷ mpg + non-fuel $/mile) ÷ MMBtu per load
MMBtu per load is computed: the smaller of what the container holds and what is legal at 80,000 lb. Delivered price is Henry Hub + basis for hubs, or diesel parity × (1 − discount) for a fuel customer. Diesel parity is taken on a lower-heating-value basis: engines burn on LHV, gas is sold on HHV, and skipping the correction overstates the gas value by 3.3%. The full walk-through is in 01 — value chain and netback.
All business logic is SQL (sql/migrations). Python only moves data in and
out. What-if analysis never copies the formulas: mart.site_latest_scenario('{"fuel_discount_to_diesel": 0.6}')
sets a transaction-local override that mart.v_assumption honours, and then the same views
recompute. The sensitivity tornado and the dashboard's controls both run through it.
Requirements: Docker, uv, make, and a free EIA API key.
cp .env.example .env # paste EIA_API_KEY, choose a Metabase admin password
make setup # Python 3.12 deps via uv
make all # Postgres → migrations → EIA → sites → assumptions → routes → DQ → sensitivity → CSV extracts (~90 s)
make dashboard # Metabase on http://localhost:3000, dashboard built from code
make test # 70 tests
make help lists every target. make reset && make all rebuilds from an empty database
deterministically: the same 18 sites, and identical numbers for the same
source data.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗