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
- Homepage: https://importsteel.org/
- Issues: https://github.com/gulopine/steel/issues
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
steel-0.5-py3-none-any.whl
(10.9 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62a8694559b2069004b27219573c795c13a7d0dec293bafa1e8ae439b41d064a
|
|
| MD5 |
31355ee59116272e52dab7415eb2563c
|
|
| BLAKE2b-256 |
5131f53b5a0138d6dd1530dc7586fafb82fd64efd360766ffdbad8a5e249014f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ea9cd51c2d03a8000100881fa408053d059b31ca294a06db14d60879b02f461
|
|
| MD5 |
7512b832241886bc06df6aa149f33b2a
|
|
| BLAKE2b-256 |
466df7c25c3d12e7791e71adde0d3659fef35a3476ee94ef11f0ba8819e8b5b0
|