Storage instance with file operation support for multiple backends.
Project description
Async-first, secure, and extensible storage backend abstraction for the Darca ecosystem.
darca-storage provides a clean interface for reading and writing to structured storage backends — local, cloud, or custom — with support for path confinement, credential injection, and session-aware logic.
Features
✅ Async-compatible FileBackend interface
🔐 Scoped access via ScopedFileBackend
🧠 Session-aware StorageClient with observability
🔌 Pluggable storage connectors (e.g., file://)
🔄 Credential and user context propagation
🧪 Easy to test and extend
📦 Installation
pip install darca-storage
Or using Poetry:
poetry add darca-storage
Quick Example
from darca_storage.factory import StorageConnectorFactory
client = await StorageConnectorFactory.from_url("file:///tmp/darca")
await client.write("hello.txt", content="Hello Darca!")
text = await client.read("hello.txt")
print(text)
Security by Default
All paths are resolved via ScopedFileBackend, which:
Normalizes and confines all access to a declared base_path
Prevents path traversal (e.g., ../../etc/passwd)
Raises StorageClientPathViolation if the boundary is violated
Extending
Implement a new backend:
class MyBackend(FileBackend):
async def read(self, path: str, *, binary=False) -> Union[str, bytes]:
...
Implement a new connector:
class MyConnector(StorageConnector):
async def connect(self) -> FileBackend:
return ScopedFileBackend(...)
Then register your scheme inside StorageConnectorFactory.
📚 Documentation
Visit the full documentation:
👉 https://roelkist.github.io/darca-storage/
To build locally:
make docs
🧪 Testing
Run all tests using:
make test
Coverage and reports:
Generates coverage.svg badge
Stores HTML output in htmlcov/
Fully parallel test support with xdist
🤝 Contributing
We welcome all contributions!
Create a new branch from main
Use PRs to submit changes
You can also open feature requests or issues using our GitHub templates
See CONTRIBUTING.rst for detailed guidelines.
📄 License
This project is licensed under the MIT License. See LICENSE for details.
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 darca_storage-0.0.1.tar.gz.
File metadata
- Download URL: darca_storage-0.0.1.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86fa44299b76fe9add669c7c9e19380d4462776a3573e5027409cd135f16c1f7
|
|
| MD5 |
16b33802f20a891d299653e03955ba34
|
|
| BLAKE2b-256 |
e7400b3e8b94a12a76514eb364f3e9813ea4d9f2a4f8567fb4e13bead4cf9ee1
|
Provenance
The following attestation bundles were made for darca_storage-0.0.1.tar.gz:
Publisher:
cd.yml on roelkist/darca-storage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
darca_storage-0.0.1.tar.gz -
Subject digest:
86fa44299b76fe9add669c7c9e19380d4462776a3573e5027409cd135f16c1f7 - Sigstore transparency entry: 226714668
- Sigstore integration time:
-
Permalink:
roelkist/darca-storage@ce19f1c03064c6138761990a915bacbe8eee6497 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/roelkist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@ce19f1c03064c6138761990a915bacbe8eee6497 -
Trigger Event:
release
-
Statement type:
File details
Details for the file darca_storage-0.0.1-py3-none-any.whl.
File metadata
- Download URL: darca_storage-0.0.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05622c19c5b28e9957ff2c1566a9f9a2f4a3c28ac0a4790c3294170d8a58b47
|
|
| MD5 |
bda7756ede6c9a3433bc033fad73dfb7
|
|
| BLAKE2b-256 |
d970d4ba1422d93cff6ccb0000b4cac985ae354759e86ec38da0290e94988d8f
|
Provenance
The following attestation bundles were made for darca_storage-0.0.1-py3-none-any.whl:
Publisher:
cd.yml on roelkist/darca-storage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
darca_storage-0.0.1-py3-none-any.whl -
Subject digest:
d05622c19c5b28e9957ff2c1566a9f9a2f4a3c28ac0a4790c3294170d8a58b47 - Sigstore transparency entry: 226714669
- Sigstore integration time:
-
Permalink:
roelkist/darca-storage@ce19f1c03064c6138761990a915bacbe8eee6497 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/roelkist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@ce19f1c03064c6138761990a915bacbe8eee6497 -
Trigger Event:
release
-
Statement type: