Client SDK for Objectstore, the Sentry object storage platform
Project description
Objectstore Client
The client is used to interface with the objectstore backend. It handles responsibilities like transparent compression, and making sure that uploads and downloads are done as efficiently as possible.
Usage
import datetime
from objectstore_client import ClientBuilder, NoOpMetricsBackend, TimeToLive
client_builder = ClientBuilder(
"http://localhost:8888",
"my_usecase",
metrics_backend=NoOpMetricsBackend(), # optionally, provide your own MetricsBackend implementation
)
client = client_builder.for_project(42, 424242)
object_id = client.put(
b"Hello, world!",
metadata={"key": "value"},
expiration_policy=TimeToLive(datetime.timedelta(days=1)),
)
result = client.get(object_id)
content = result.payload.read()
assert content == b"Hello, world!"
assert result.metadata.custom["key"] == "value"
client.delete(object_id)
Development
Environment Setup
The considerations for setting up the development environment that can be found in the main README apply for this package as well.
Pre-commit hook
A configuration to set up a git pre-commit hook using pre-commit is available at the root of the repository.
To install it, run
pre-commit install
The hook will automatically run some checks before every commit, including the linters and formatters we run in CI.
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 objectstore_client-0.0.4.tar.gz.
File metadata
- Download URL: objectstore_client-0.0.4.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b37dcd7a535e76331fbf3ae0d952834e934865ebd880f8a8ae8d08f80f1a5a72
|
|
| MD5 |
65a782175a3640a1cb3f28f317b88898
|
|
| BLAKE2b-256 |
ed1f221a791724cacd109a7362de61de4e5f579d807e4077c7e7217a66421b27
|
File details
Details for the file objectstore_client-0.0.4-py3-none-any.whl.
File metadata
- Download URL: objectstore_client-0.0.4-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f36e14638b7a1278c104d1fe2d9b581d426e90209e24171a4b39c2afe81c7e1c
|
|
| MD5 |
723a101a287728e7092a81eaf342dc7a
|
|
| BLAKE2b-256 |
30ef389dd02a1196345e0bf029d6f550c85ae801497cc2bc5692f3b0743f4c74
|