Betaflight closed-loop chirp / blackbox analysis core — decoder, FRF/Bode, step response, spectral, HTML report.
Project description
betaflight-chirp-core
The compute core for Betaflight closed-loop chirp / blackbox analysis:
decode a .bbl/.bfl, estimate the frequency response (FRF/Bode), step
response and noise spectrum, and render a self-contained HTML report.
betaflight-chirp-coreknows nothing about MCP, HTTP, Docker, the CLI or the filesystem. Input: bytes. Output: objects + HTML.
Install
pip install betaflight-chirp-core
Or pin an exact commit straight from git:
pip install "betaflight-chirp-core @ git+https://github.com/SebGalina/betaflight-chirp-core@v0.1.5"
Usage
from betaflight_chirp_core import decode, analyse_log, build_report, run
# low-level: decode -> analyse -> render, step by step
df, fs, config = decode(open("log.bbl", "rb").read())
# df: decoded frames (pandas) fs: loop/log rate (Hz) config: PID/filter settings
a_pass = analyse_log(df, fs, config) # one log -> one self-contained pass dict
html = build_report([a_pass]) # passes -> self-contained HTML report
# single call: decode + analyse + report in one shot (used by mcp_local + worker)
result = run(open("log.bbl", "rb").read())
result.metrics # per-axis indicators the web front renders as-is
result.report_html # the self-contained HTML report (LLM path returns its link)
Importing the package is light: numpy/scipy/pandas load lazily, only when an
analysis runs. from betaflight_chirp_core import decoder stays stdlib-only, so
decode-only callers pull no heavy deps.
Layout
| Module | Role |
|---|---|
decoder.py |
pure-Python .bbl frame decoder (stdlib only) |
signal.py |
decode_dataframe (bytes → frames), sample_rate, active_mask |
config.py |
PID / filter settings parsed from the header |
analysis/ |
chirp (FRF/Bode), spectral, step response |
report.py |
self-contained HTML report (inlines the renderer assets) |
report_assets/ |
shared report renderer (chirp_report.{js,css} + glossary/strings JSON) — inlined by report.py, mountable by a web front |
Develop
pip install -e ".[test]"
pytest
Tests look for .bbl fixtures in tests/data/ (git-ignored — never commit a
real flight log, it carries GPS home-point coordinates). Drop your own logs
there to run the decode tests.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file betaflight_chirp_core-0.1.5.tar.gz.
File metadata
- Download URL: betaflight_chirp_core-0.1.5.tar.gz
- Upload date:
- Size: 89.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9f25cf83f9b707f4f199ce6cd17217322383ef13a7fe9c29900f8a59cd00737
|
|
| MD5 |
679d489a660f0291ff9f8843d880392b
|
|
| BLAKE2b-256 |
37d75d4e6f568e62fcc9a150364a3b94ddff5c098926e7da2c2329914dbe418f
|
Provenance
The following attestation bundles were made for betaflight_chirp_core-0.1.5.tar.gz:
Publisher:
publish.yml on SebGalina/betaflight-chirp-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betaflight_chirp_core-0.1.5.tar.gz -
Subject digest:
b9f25cf83f9b707f4f199ce6cd17217322383ef13a7fe9c29900f8a59cd00737 - Sigstore transparency entry: 1800095375
- Sigstore integration time:
-
Permalink:
SebGalina/betaflight-chirp-core@2e6c5d9c717e6138205333c796268a1c40cbbc77 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/SebGalina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e6c5d9c717e6138205333c796268a1c40cbbc77 -
Trigger Event:
release
-
Statement type:
File details
Details for the file betaflight_chirp_core-0.1.5-py3-none-any.whl.
File metadata
- Download URL: betaflight_chirp_core-0.1.5-py3-none-any.whl
- Upload date:
- Size: 92.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0985860aefa42a3dd876dd03f5efbe7bf3e4d4f68845e24311d2a0003b45d761
|
|
| MD5 |
60973435c229c626a7405186910f2661
|
|
| BLAKE2b-256 |
92d42d7b8f1b734c18d5d5edce8f8e85a5c1d612feed2a1c5f57b9a7754d6976
|
Provenance
The following attestation bundles were made for betaflight_chirp_core-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on SebGalina/betaflight-chirp-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betaflight_chirp_core-0.1.5-py3-none-any.whl -
Subject digest:
0985860aefa42a3dd876dd03f5efbe7bf3e4d4f68845e24311d2a0003b45d761 - Sigstore transparency entry: 1800095554
- Sigstore integration time:
-
Permalink:
SebGalina/betaflight-chirp-core@2e6c5d9c717e6138205333c796268a1c40cbbc77 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/SebGalina
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2e6c5d9c717e6138205333c796268a1c40cbbc77 -
Trigger Event:
release
-
Statement type: