Pure mechanism layer for the Astro ecosystem — zero hard dependencies
Project description
astrobasis 天枢
Pure mechanism layer for the Astro ecosystem. Zero hard dependencies beyond Python 3.12 stdlib.
Install
pip install astrobasis
For JSON performance acceleration:
pip install astrobasis[fast]
Or from source:
pip install -e .
What's inside
| Module | Purpose |
|---|---|
_logging |
Structured logfmt logging — mandatory event field, key=value output |
_atomic |
POSIX atomic file writes — mkstemp → fsync → os.replace |
_json_compat |
orjson / stdlib json compatibility layer with graceful fallback |
_types |
Shared protocols — AsyncCloseable for async resource lifecycle |
Usage
Structured logging
from astrobasis import LogfmtLogger
logger = LogfmtLogger("my_module")
logger.info("request_complete", url="https://example.com", status=200)
# → ts=2026-07-17T... level=INFO logger=my_module event=request_complete url=https://example.com status=200
Atomic file writes
from astrobasis import atomic_write_json
data = {"key": "value", "nested": [1, 2, 3]}
atomic_write_json("/path/to/config.json", data)
# POSIX atomic: write to temp → fsync → os.replace. Concurrent reads always see complete data.
JSON compatibility
from astrobasis import _json_dumps
data = {"items": ["a", "b", "c"]}
result = _json_dumps(data)
# Uses orjson if installed (`pip install astrobasis[fast]`), stdlib json otherwise.
Async resource protocol
from astrobasis import AsyncCloseable
class MyResource(AsyncCloseable):
async def aclose(self) -> None:
await self._client.close()
License
Apache 2.0
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
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 astrobasis-0.1.1.tar.gz.
File metadata
- Download URL: astrobasis-0.1.1.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb8b349a96f5e8f3d7048ca0b6c38f53072b554770242d0dcf105552f08683d8
|
|
| MD5 |
3bcb9af747cf3ad1eeb0d20e5734178e
|
|
| BLAKE2b-256 |
fcd2724c6afd832f66aa79e7471e483b994df3c08e046eeea2cebb0adab72034
|
Provenance
The following attestation bundles were made for astrobasis-0.1.1.tar.gz:
Publisher:
ci.yml on Etoileint/AstroProject
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astrobasis-0.1.1.tar.gz -
Subject digest:
cb8b349a96f5e8f3d7048ca0b6c38f53072b554770242d0dcf105552f08683d8 - Sigstore transparency entry: 2255212682
- Sigstore integration time:
-
Permalink:
Etoileint/AstroProject@0254c9d46529336b9e011685b83725dd7cd618a2 -
Branch / Tag:
refs/tags/astrobasis/v0.1.1 - Owner: https://github.com/Etoileint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0254c9d46529336b9e011685b83725dd7cd618a2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file astrobasis-0.1.1-py3-none-any.whl.
File metadata
- Download URL: astrobasis-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eda5a314a6587178520675362b2fe7602c2ba7a0598fcdc2261a38952f4d0b24
|
|
| MD5 |
932cc49cec24081ba36c672894c7ec5d
|
|
| BLAKE2b-256 |
d42211e64e2681b2d6f659cf11c68bf8cf95940ad524a973579ba39436c71a9a
|
Provenance
The following attestation bundles were made for astrobasis-0.1.1-py3-none-any.whl:
Publisher:
ci.yml on Etoileint/AstroProject
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
astrobasis-0.1.1-py3-none-any.whl -
Subject digest:
eda5a314a6587178520675362b2fe7602c2ba7a0598fcdc2261a38952f4d0b24 - Sigstore transparency entry: 2255212687
- Sigstore integration time:
-
Permalink:
Etoileint/AstroProject@0254c9d46529336b9e011685b83725dd7cd618a2 -
Branch / Tag:
refs/tags/astrobasis/v0.1.1 - Owner: https://github.com/Etoileint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0254c9d46529336b9e011685b83725dd7cd618a2 -
Trigger Event:
push
-
Statement type: