Skip to content

Commit d23c69a

Browse files
authored
Release v3.1.0 (#64)
1 parent 78d1cfc commit d23c69a

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

.github/workflows/codspeed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: actions/setup-python@v5
22+
- uses: actions/setup-python@v5 # required for correct CodSpeed integration
2323
with:
2424
python-version: ${{ env.UV_PYTHON }}
2525

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
87
tags:
98
- 'v*.*.*'
109
workflow_dispatch:
@@ -90,8 +89,7 @@ jobs:
9089
with:
9190
target: ${{ matrix.target }}
9291
manylinux: ${{ matrix.manylinux || 'auto' }}
93-
container: ${{ matrix.container }}
94-
args: --release --out dist --interpreter ${{ matrix.maturin-interpreter || matrix.interpreter || '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10 pypy3.11' }} ${{ matrix.extra-build-args }}
92+
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10 pypy3.11' }}
9593
rust-toolchain: 1.76.0
9694
docker-options: -e CI
9795

@@ -129,6 +127,10 @@ jobs:
129127
- name: Checkout repository.
130128
uses: actions/checkout@v4
131129

130+
- uses: actions/setup-python@v5 # required for macos-13 with Python 3.8-3.10... otherwise UV uses PyPy...
131+
with:
132+
python-version: ${{ matrix.interpreter }}
133+
132134
- name: Install UV.
133135
uses: astral-sh/setup-uv@v6
134136
with:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.py[cod]
2+
13
# Generated by Cargo
24
# will have compiled files and executables
35
debug/
@@ -15,6 +17,7 @@ Cargo.lock
1517

1618
# IDE
1719
.idea
20+
*.iml
1821
.vscode
1922

2023
# Python virtual environment
@@ -30,4 +33,4 @@ __pycache__
3033
.pytest_cache
3134

3235
# Build artifacts
33-
*.so
36+
*.so

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libipld"
3-
version = "3.0.1"
3+
version = "3.1.0"
44
edition = "2021"
55
license = "MIT"
66
description = "Python binding to the Rust IPLD library"

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,32 @@ print(libipld.encode_multibase('u', b'yes mani !'))
2828

2929
### Features
3030

31-
- Decode DAG-CBOR (`decode_dag_cbor(bytes) -> dict`, `decode_dag_cbor_multi(bytes) -> list[dict]`)
32-
- Encode DAG-CBOR (`encode_dag_cbor(obj) -> bytes`)
33-
- Decode CID (`decode_cid(str | bytes) -> dict`). Accepts CID stringified form or CID raw byte form.
34-
- Encode CID (`encode_cid(bytes) -> str`). Encodes CID raw byte form to stringified form.
35-
- Decode Multibase (`decode_multibase(str) -> tuple[str, bytes]`). Returns base and data.
36-
- Encode Multibase (`encode_multibase(str, bytes) -> str`). Accepts base and data.
37-
- Decode CAR (`decode_car(bytes) -> tuple[dict, dict[bytes, dict]]`). Returns a header and blocks mapped by CID. CIDs in raw byte form.
31+
#### 🔗 CID (Content Identifier) Operations
32+
- **`decode_cid(data: str | bytes) -> dict`** - Decode CIDs from string representation (e.g., `'bafy...'`) or raw bytes into structured data containing version, codec, and hash information
33+
- **`encode_cid(data: str | bytes) -> str`** - Encode CID raw bytes to string representation, or return string CIDs as-is
3834

35+
#### 📦 DAG-CBOR (Directed Acyclic Graph CBOR) Operations
36+
- **`decode_dag_cbor(data: bytes) -> Any`** - Decode DAG-CBOR binary data into Python objects (dicts, lists, primitives)
37+
- **`decode_dag_cbor_multi(data: bytes) -> list[Any]`** - Decode multiple concatenated DAG-CBOR objects from a single byte stream
38+
- **`encode_dag_cbor(data: Any) -> bytes`** - Encode Python objects into DAG-CBOR binary format
3939

40-
## Requirements
40+
#### 🌐 Multibase Operations
41+
- **`decode_multibase(data: str) -> tuple[str, bytes]`** - Decode multibase-encoded strings, returning the base identifier and decoded data
42+
- **`encode_multibase(code: str, data: str | bytes) -> str`** - Encode data using specified multibase encoding (e.g., base58btc with code `'u'`)
43+
44+
#### 🚗 CAR (Content Addressable Archives) Operations
45+
- **`decode_car(data: bytes) -> tuple[dict, dict[bytes, dict]]`** - Decode CAR files into header metadata and a mapping of CID bytes to block data
46+
47+
### Requirements
4148

4249
- Python 3.8 or higher.
4350

44-
## Installing
51+
### Installing
4552

4653
You can install or upgrade `libipld` via
4754

4855
```bash
49-
pip install libipld
56+
pip install -U libipld
5057
```
5158

5259
### Contributing

python/libipld/_libipld.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def decode_multibase(data: str) -> tuple[str, bytes]:
8989
"""
9090

9191

92-
def encode_multibase(code: str, data: bytes | str) -> str:
92+
def encode_multibase(code: str, data: str | bytes) -> str:
9393
"""Encode data using multibase.
9494
9595
Args:

0 commit comments

Comments
 (0)