depozit-python
Python client for Depozit — a self-hosted file storage service.
Install
pip install depozit
Server
depozit server install # clone & run install.sh from depozit-server
depozit server uninstall # stop service and remove binaries
Manage the running service:
depozit start
depozit stop
depozit status
Usage
import depozit
default = depozit.connect("localhost:50051", api_key="your-api-key") # container default
default.upload("photo.jpg", "images/photo.jpg") # upload a file
default.upload_bytes(b"hello", "notes/hello.txt") # upload raw bytes
data = default.read("images/photo.jpg") # read a file
default.rename("notes/hello.txt", "greet.txt") # rename
default.delete("images/photo.jpg") # delete
for path in default.find(prefix="images/"): # list files
print(path)
Containers
Each connection is bound to one container. connect creates the container if it does not exist.
uploads = depozit.connect("localhost:50051", api_key="your-api-key", container="uploads")
uploads.upload_bytes(b"hello", "hello.txt") # stored in "uploads"
uploads.close()
Only a client on the default container can manage containers. On any other container these methods raise PermissionError.
default = depozit.connect("localhost:50051", api_key="your-api-key")
default.create_container("backups")
default.rename_container("backups", "archive")
default.delete_container("archive")
Use with to close the connection automatically:
with depozit.connect("localhost:50051", api_key="your-api-key", container="uploads") as uploads:
uploads.read("hello.txt")
Async
import depozit.aio
async with await depozit.aio.connect("localhost:50051", api_key="your-api-key") as default:
data = await default.read("images/photo.jpg")
Metadata
Release files for depozit 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| depozit-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for depozit-0.0.2-py3-none-any.whl |
Release files / depozit-0.0.2-py3-none-any.whl
| Download URL | depozit-0.0.2-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e4fc2b1303a38d20d604cce5e9d71fc747df2652f98643798e106def7511231
|
|
BLAKE2b-256 checksum How to use checksums |
dd958e34096c605ff71244d0e3e4d26ad36f2d8d8a25390b3196da25bd8fefc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for depozit 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.