Skip to main content

Read and write raw binary files using the familiar interface from the Xarray library

Project description

Xarray-binfile

Xarray-binfile logo

Custom Xarray file engine to handle raw binary files


  • QA: CI CodeQL pre-commit.ci status Quality Gate Status Coverage CodeFactor

  • Docs: Docs

  • Package: PyPI - Version PyPI - Python Version

  • Meta: Wizard Template Checked with mypy Hatch project Ruff GitHub License EffVer Versioning


Overview

Xarray-binfile is a Python package that integrates raw binary files with xarray. You provide the metadata that describes each binary file, and the package exposes those files through xarray datasets and data arrays with optional lazy chunking through Dask.

The package was first designed around binary outputs from the Fortran framework 2DECOMP&FFT and the CFD solver Xcompact3d, which is built on top of it. It is not limited to those ecosystems and can be used with any raw binary convention once the corresponding metadata mapping is provided.

It is aimed at workflows where raw binary files are part of an existing convention, such as simulation outputs or NumPy .tofile() dumps. Once opened, the data can be indexed, reduced, plotted, and computed with the usual xarray and Dask APIs.

See the documentation for end-to-end examples covering lazy loading, Dask-backed computations, task-graph visualization, writing derived results back to .bin files, parallel and larger-than-memory workflows, benchmarking on your own data, batch dtype conversion, probe time-series export to CSV, and quick matplotlib plots.

[!CAUTION] Raw binary files are machine- and convention-dependent. Differences such as little-endian vs big-endian byte order, word size, record layout, and memory ordering can change how bytes should be interpreted. Always verify dtype and endianness when sharing files across machines or toolchains.

Copyright and License

© 2025 Felipe N. Schuch. All content is under MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xarray_binfile-0.1.0b2.tar.gz (234.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xarray_binfile-0.1.0b2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file xarray_binfile-0.1.0b2.tar.gz.

File metadata

  • Download URL: xarray_binfile-0.1.0b2.tar.gz
  • Upload date:
  • Size: 234.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for xarray_binfile-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 6200cec308145dce9d286c683d5aac61860b0574de8120a38e8063db664e6420
MD5 697ea3be45f571d3fa43e1c20f411d53
BLAKE2b-256 0b95b40b327d586ebbbdb24216d66172c9325977ba52ecfb5e191425501609a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_binfile-0.1.0b2.tar.gz:

Publisher: ci.yaml on fschuch/xarray-binfile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xarray_binfile-0.1.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for xarray_binfile-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0df655889d5a4b86894b9731b2d225069a4935b77922d555117c323d27bf73a
MD5 0d232f35621739000efb88d58cf3798c
BLAKE2b-256 d0e5680dc5b3d6069d1ec3f6996956dc24fd38b52917ad88b48791b1de1044cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_binfile-0.1.0b2-py3-none-any.whl:

Publisher: ci.yaml on fschuch/xarray-binfile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page