Skip to main content

A Python framework for describing, reading and writing binary file formats

Project description

Steel

Steel provides an elegant way to define binary data structures using Python type hints and field descriptors. It's designed to make working with binary file formats intuitive and type-safe.

Features

  • Declarative: Define binary structures using familiar Python class syntax
  • Fully type-hinted: Leverage your IDE to interact with binary data
  • Flexible: Support for different data types, sizes, and endianness
  • Modern: Built for Python 3.13+ with modern typing features

Installation

pip install steel

Quick Start

import steel

class GIF(steel.Structure):
    magic = steel.FixedBytes(b'GIF')
    version = steel.FixedLengthString(size=3)
    width = steel.Integer(size=2)
    height = steel.Integer(size=2)

with open('logo.gif', 'rb') as f:
    image = GIF.read(f)

print(f"Version: {image.version}")
print(f"Version: {header.version}")
print(f"Size: {header.width}x{header.height}")

Requirements

  • Python 3.13+

Development Setup

pip install -e ".[dev]"

Links

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

steel-0.5.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

steel-0.5-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file steel-0.5.tar.gz.

File metadata

  • Download URL: steel-0.5.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for steel-0.5.tar.gz
Algorithm Hash digest
SHA256 62a8694559b2069004b27219573c795c13a7d0dec293bafa1e8ae439b41d064a
MD5 31355ee59116272e52dab7415eb2563c
BLAKE2b-256 5131f53b5a0138d6dd1530dc7586fafb82fd64efd360766ffdbad8a5e249014f

See more details on using hashes here.

File details

Details for the file steel-0.5-py3-none-any.whl.

File metadata

  • Download URL: steel-0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.12

File hashes

Hashes for steel-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4ea9cd51c2d03a8000100881fa408053d059b31ca294a06db14d60879b02f461
MD5 7512b832241886bc06df6aa149f33b2a
BLAKE2b-256 466df7c25c3d12e7791e71adde0d3659fef35a3476ee94ef11f0ba8819e8b5b0

See more details on using hashes here.

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