Skip to content

Commit

Permalink
BUmp version to 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixEditor committed Sep 7, 2024
1 parent 8b63803 commit 470d54e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@ options will be added in the future. Documentation is [here >](https://matrixedi
* it helps you to create cleaner and more compact code.
* You can even extend Caterpillar and write your parsing logic in C or C++!!

## What does it look like?

```python
from caterpillar._Py import *

@struct(order=LittleEndian)
class Format:
magic: b"ITS MAGIC" # Supports string and byte constants directly
a: uint8 # Primitive data types
b: int32
length: uint8 # String fields with computed lengths
name: String(this.length) # -> you can also use Prefixed(uint8)
names: CString[uint8::] # Sequences with prefixed, computed lengths

# Instantiation (keyword-only arguments, magic is auto-inferred):
obj = Format(a=1, b=2, length=3, name="foo", names=["a", "b"])
# Packing the object:
blob = pack(obj) # objects of struct classes can be packed right away
# results in: b'ITS MAGIC\x01\x02\x00\x00\x00\x03foo\x02a\x00b\x00'
# Unpacking the binary data:
obj2 = unpack(blob, Format)
```

This library offers extensive functionality beyond basic struct handling. For further details
on its powerful features, explore the official [documentation](https://matrixeditor.github.io/caterpillar/),
[examples](./examples/), and [test cases](./test/).

## Installation

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ wheel.py-api = "cp312"

[project]
name = "caterpillar"
version = "2.1.4"
version = "2.1.5"

description="Library to pack and unpack structurized binary data."
authors = [
Expand Down
2 changes: 1 addition & 1 deletion src/caterpillar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__version__ = "2.1.4"
__version__ = "2.1.5"
__release__ = None
__author__ = "MatrixEditor"

Expand Down

0 comments on commit 470d54e

Please sign in to comment.