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.0.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.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xarray_binfile-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a02f52851e45f1f4dd8a3b8225b348c98b13aae34678ad855b39a960e0c1f87f
MD5 077222a56d5d6c78cc25303a17c0e7b9
BLAKE2b-256 e1519e46e6da1205f38b68528be860fb11bdf6aab748f484a9a7d4ef51fba9a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_binfile-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: xarray_binfile-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for xarray_binfile-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28ed9a52e6ef5cdf7d9b0ff58d4fa89e9fb758acfdb5452fea3c25a5d8b40a14
MD5 45a7b47484f2c48869321930740ec2dd
BLAKE2b-256 ed3922fa4248f970a6c868570e4ab249c7051180c9445aa7daade87b46bf8570

See more details on using hashes here.

Provenance

The following attestation bundles were made for xarray_binfile-0.1.0-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