Skip to main content

Orangebox

PyPI version Documentation Status

A Cleanflight/Betaflight blackbox log parser written in Python 3.

Orangebox has no dependencies other than the Python standard library, although it might be worthy to investigate how using numpy could possibly bring some performance gain in the future. If so, it shouldn't be a usability barrier since any user wanting to make something out of the decoded data will more than likely have numpy installed transitively as well as it's also a dependency of libraries like matplotlib and pandas (among others).

This parser was roughly modeled after the one in Blackbox Log Viewer hence produces the same output.

Documentation

You can browse the full documentation online on Read the Docs, here's a quick example:

from orangebox import Parser

# Load a file
parser = Parser.load("btfl_all.bbl")
# or optionally select a log by index (1 is the default)
# parser = Parser.load("btfl_all.bbl", 1)

# Print headers
print("headers:", parser.headers)

# Print the names of fields
print("field names:", parser.field_names)

# Select a specific log within the file by index
print("log count:", parser.reader.log_count)
parser.set_log_index(2)

# Print field values frame by frame
for frame in parser.frames():
    print("first frame:", frame.data)
    break

# Complete list of events only available once all frames have been parsed
print("events:", parser.events)

# Selecting another log changes the header and frame data produced by the Parser
# and also clears any previous results and state
parser.set_log_index(1)

Contributing

  • Contributions are very welcome!
  • Please follow the PEP8 Style Guido.
  • More info in the docs.

Changelog

0.5.0

  • Breaking change: raise RuntimeError on unexpected end of log
  • New features and fixes thanks to @rtlopez!
    • Add support for Inav and Rotorflight events
    • Handle unexpected end of log
    • Event parsing bugfix

0.4.0

  • Inspect log files for potentially missing required headers
  • Allow skipping of badly formatted headers via the allow_invalid_header argument

0.3.1

  • Add bb2gpx utility for converting GPS data into GPX

0.3.0

  • Add support for GPS frames (thanks to @tblaha!)

0.2.0

  • Improved Reader class can now handle multiple logs in a single file
  • Add bbsplit command-line script for splitting flashchip logs (thanks to @ysoldak!)
  • Improved logging
  • Added HTML documentation
  • Fix parsing stats

0.1.1-beta

  • Add bb2csv command-line script for converting logs into CSV

0.1.0-beta

  • First release (with a lot of missing parts)

Known issues

  • No explicit validation of raw data against corruption (except for headers), but it's highly likely that a Python exception will be raised in these cases anyway
  • Tested only on logs generated by Betaflight
  • Not all event frames are parsed (see TODO comments)
  • Some decoders are missing (see TODO comments)

Acknowledgement

Original blackbox data encoder and decoder was written by Nicholas Sherlock.

License

This project is licensed under GPLv3.

Metadata

Release files for orangebox 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orangebox 0.5.0
File Size Uploaded
orangebox-0.5.0.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for orangebox 0.5.0
File Interpreter ABI Platform
orangebox-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.1 kB

Release files / orangebox-0.5.0.tar.gz

Download URL orangebox-0.5.0.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e1b096e2b0e07edcb428a3a9c810faba4189f02d1ac36e0f3925b78289cec583
BLAKE2b-256 checksum
How to use checksums
82a89ca0d8f951b91c2ca493d8a2418d364409512990c656f0049e2931391f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / orangebox-0.5.0-py3-none-any.whl

Download URL orangebox-0.5.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a13d003a1caf13d84a422de1ca36fa0ad682e41a195ee207354c08fa5f451761
BLAKE2b-256 checksum
How to use checksums
04d7e87c820a1911c301e2679d7ff2594da8c830f5315d01e8bf518292e25a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

1 release file

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page