iokit
Python library for serialization and file operations. Unifies multiple format codecs (JSON, YAML, Tar, etc.) with a single State interface that combines data, path, and timestamp.
Installation
Base install covers txt, bin, dat, json, gz, zip, tar:
pip install iokit
For all formats and web download support:
pip install iokit[ultra]
Missing formats will tell you what to install:
from iokit import Yaml
Yaml({"key": "value"}, "file")
ModuleNotFoundError: Missing required packages: PyYAML>=6.0.1. Install with: pip install PyYAML
Quick Start
Work with data as States. Each State carries the data, a path, and a timestamp. Load and save without thinking about formats.
JSON file:
from iokit import Json
state = Json({"key": "value"}, path="config.json")
print(state.path) # config.json
print(state.size) # 16
print(state.load()) # {'key': 'value'}
Text file:
from iokit import Txt
state = Txt("Hello, World!", "message")
state.save("/tmp/data", parents=True)
Load any file from disk:
from iokit import file
state = file("/path/to/file.txt")
content = state.load()
Common Operations
Chain transformations:
from iokit import Txt
state = Txt("Secret data", "notes")
encrypted = state.encrypt(password="secret")
compressed = encrypted.gzip()
compressed.save("/tmp")
Load compressed:
loaded = encrypted.load(password="secret").load()
Archives:
from iokit import Tar, Txt
file1 = Txt("First", "a")
file2 = Txt("Second", "b")
archive = Tar([file1, file2], "bundle")
states = list(archive.load())
Find states by pattern:
from iokit import filtrate, first
results = filtrate(archive.load(), "*.txt")
first_match = first(archive.load(), "a*")
Download:
from iokit import web
state = web("https://example.com/data.json", Json)
data = state.load()
Checksum:
state.digest("sha256").base64
state.digest("xxh128").base64url
Storage
Store and retrieve records by uid:
from iokit.storage import LocalStorage
storage = LocalStorage("/data")
storage.push("records/data.json", data)
loaded = storage.pull("records/data.json")
storage.remove("records/data.json")
for uid in storage.index(prefix="records/"):
print(uid)
State-aware storage with automatic encoding:
from iokit.storage import StateStorage
storage = StateStorage(
LocalStorage("/data"),
compression=6,
password="secret"
)
storage.push("file.json", {"data": 123})
result = storage.pull("file.json")
Contributing
Found a bug or have an idea? Open an issue or submit a pull request.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file iokit-0.5.0.tar.gz.
File metadata
- Download URL: iokit-0.5.0.tar.gz
- Upload date:
- Size: 36.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82adf00d6da4e1e68eeb79a9449d4dc731ca951bede06a77cb52dc1c21c1ec22
|
|
| MD5 |
01b33d9569d82bb6a05e65e174e89418
|
|
| BLAKE2b-256 |
476fb58c0b4b896a59b21ccd603ee236b6d19d28737830fb1bce6760939fff4c
|
Provenance
The following attestation bundles were made for iokit-0.5.0.tar.gz:
Publisher:
publish.yml on rilshok/iokit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iokit-0.5.0.tar.gz -
Subject digest:
82adf00d6da4e1e68eeb79a9449d4dc731ca951bede06a77cb52dc1c21c1ec22 - Sigstore transparency entry: 2642288471
- Sigstore integration time:
-
Permalink:
rilshok/iokit@b6cb44b92dd865de8f8525bf6b77fb5d24e34470 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/rilshok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b6cb44b92dd865de8f8525bf6b77fb5d24e34470 -
Trigger Event:
push
-
Statement type:
File details
Details for the file iokit-0.5.0-py3-none-any.whl.
File metadata
- Download URL: iokit-0.5.0-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b952304335633cd662961e2dfe707d6ba221c3eaf847194ecf5766c5be566dd5
|
|
| MD5 |
25430f03c2017be6bd228cb37ec3f9eb
|
|
| BLAKE2b-256 |
810de9b5aea13849343f4595e3aa3b3673295c363b3898ccfa18e8fd35f7144f
|
Provenance
The following attestation bundles were made for iokit-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on rilshok/iokit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iokit-0.5.0-py3-none-any.whl -
Subject digest:
b952304335633cd662961e2dfe707d6ba221c3eaf847194ecf5766c5be566dd5 - Sigstore transparency entry: 2642288515
- Sigstore integration time:
-
Permalink:
rilshok/iokit@b6cb44b92dd865de8f8525bf6b77fb5d24e34470 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/rilshok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b6cb44b92dd865de8f8525bf6b77fb5d24e34470 -
Trigger Event:
push
-
Statement type: