Spaces:
Sleeping
Sleeping
|
Download docs/md/design/storage/object_store.md from thanhnv2323/humanize-text-python: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/docs/md/design/storage/object_store.md
- Command line
-
hf download hf://spaces/thanhnv2323/humanize-text-python/docs/md/design/storage/object_store.md
-
curl -L -o object_store.md https://huggingface.co/spaces/thanhnv2323/humanize-text-python/resolve/main/docs/md/design/storage/object_store.md
1.02 kB
Storage: object_store
Code: adsp/storage/object_store.py
Purpose
object_store is a minimal object storage shim used by ingestion and pipelines. In the architecture it corresponds to S3 (or equivalent).
Responsibilities
- Store bytes for a file under a bucket/key
- Retrieve stored bytes by bucket/key
Public API
put(bucket: str, file_path: pathlib.Path) -> None
Reads bytes from file_path and stores them under (bucket, file_path.name).
get(bucket: str, key: str) -> bytes
Returns stored bytes for (bucket, key).
Data model
_STORE: Dict[str, Dict[str, bytes]](process-global in-memory)
Key dependencies / technologies
pathlib.Pathfor file IO- In-memory dictionary storage
Notes / production hardening
Replace with:
- AWS S3 / MinIO / GCS / Azure Blob client
- Content-addressable keys (hash-based) to avoid accidental overwrites
- Metadata (content type, original filename, uploaded_by, timestamps)
- Pre-signed URLs for frontend upload/download