Dependency-free core primitives for the ai-hats framework (atomic filesystem I/O).
Project description
ai-hats-core
Dependency-free core primitives for the ai-hats framework — pure standard library, zero third-party dependencies.
Today it ships the canonical atomic file-write helper: write to a unique
temp file in the same directory, then os.replace it into place, so a reader
never observes a half-written file and a crash never leaves a truncated one.
Install
pip install ai-hats-core
Requires Python 3.11+.
Usage
from pathlib import Path
from ai_hats_core import atomic_write_text, atomic_write_bytes
atomic_write_text(Path("config.json"), '{"ok": true}\n')
atomic_write_bytes(Path("data.bin"), b"\x00\x01", mode=0o600)
Both helpers write atomically (unique-tmp-in-same-dir + os.replace); pass
mode to set explicit permissions, otherwise the file lands with the umask
default.
Public API
ai_hats_core.__all__:
atomic_write_text(path, text, *, mode=None)atomic_write_bytes(path, data, *, mode=None)
Dependencies
None — standard library only.
Versioning
SemVer. The public API is ai_hats_core.__all__.
License
MIT. See the ai-hats repository.
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
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 ai_hats_core-0.1.0.tar.gz.
File metadata
- Download URL: ai_hats_core-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d9739f1e9429ec26be6a61902eb7e8d1d1242d73ecee18c3014c2083c39e13d
|
|
| MD5 |
6b126dd79c2eb53505ecbe200d183b32
|
|
| BLAKE2b-256 |
25c4c5a5059d293c423c5a1b3291ad7031f8638baf3e5dcb7faaa9c5394321c0
|
Provenance
The following attestation bundles were made for ai_hats_core-0.1.0.tar.gz:
Publisher:
release-packages.yml on muratovv/ai-hats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_hats_core-0.1.0.tar.gz -
Subject digest:
9d9739f1e9429ec26be6a61902eb7e8d1d1242d73ecee18c3014c2083c39e13d - Sigstore transparency entry: 2047750839
- Sigstore integration time:
-
Permalink:
muratovv/ai-hats@5f93a701985601028082c7fd912928419aba027b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/muratovv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-packages.yml@5f93a701985601028082c7fd912928419aba027b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ai_hats_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_hats_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c066b60dc067d550aad5b3bd910794ace15a6019cc8d239db123a90b71bc7d8
|
|
| MD5 |
2651d00838cc520639e7e29409d80c91
|
|
| BLAKE2b-256 |
e956c5a43b2448b5177945a1edacc13b8338d2494f959629abdbf0efb414b1ef
|
Provenance
The following attestation bundles were made for ai_hats_core-0.1.0-py3-none-any.whl:
Publisher:
release-packages.yml on muratovv/ai-hats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_hats_core-0.1.0-py3-none-any.whl -
Subject digest:
7c066b60dc067d550aad5b3bd910794ace15a6019cc8d239db123a90b71bc7d8 - Sigstore transparency entry: 2047750852
- Sigstore integration time:
-
Permalink:
muratovv/ai-hats@5f93a701985601028082c7fd912928419aba027b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/muratovv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-packages.yml@5f93a701985601028082c7fd912928419aba027b -
Trigger Event:
workflow_dispatch
-
Statement type: