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.0b1.tar.gz (234.7 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.0b1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xarray_binfile-0.1.0b1.tar.gz
  • Upload date:
  • Size: 234.7 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.0b1.tar.gz
Algorithm Hash digest
SHA256 a9a32f6529d6b0ba134f37b888ba649fb1c3eb4969380b8c1bfff7983db0e7c6
MD5 7806f2123eb06d16c738d45b47c3d000
BLAKE2b-256 a015b344ceaebfe34427f07c40d35d23ffd5663da54cc2a2facd24cc318ff7e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xarray_binfile-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 010e68db824df6801db8a301c58ddcb39320daa5e82f2308fd532517f51d0c6a
MD5 7e526284aa8136567523bcec14d3f255
BLAKE2b-256 113e996da084bc0d09d8f60901babae08bcf0967a2d7a3c62c61442f16926fbd

See more details on using hashes here.

Provenance

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