Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

objectstore_client-0.0.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

objectstore_client-0.0.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file objectstore_client-0.0.2.tar.gz.

File metadata

  • Download URL: objectstore_client-0.0.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for objectstore_client-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fc52db1cd6cb1d253821295c2cb2cdd4577c450e70077942088648b5b78b71c3
MD5 8789d4469aa71c9e961e539747c425c9
BLAKE2b-256 239f477efa584f02f885d8f39f5e01034669d12926693644715fa39db7ac90c3

See more details on using hashes here.

File details

Details for the file objectstore_client-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for objectstore_client-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b1ebcd4a5b9798dc8821e8b67653393033565692f5b4b0b56078ff80894050f
MD5 cb130c8afc06ae4b46760d3568248e9e
BLAKE2b-256 c3d1155c7738a595d9e2a3d6f60a1e8d3bf5e52b45ee94b24e0ada7db3bb7888

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page