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.1.tar.gz (7.8 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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: objectstore_client-0.0.1.tar.gz
  • Upload date:
  • Size: 7.8 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.1.tar.gz
Algorithm Hash digest
SHA256 f07c344498f1518ccd0a538b54619d93f3c5afe0795b5e19da9cc596965e5e66
MD5 6a9a26dccd87ecce081ef67fee1cb38d
BLAKE2b-256 0428cbd2cc73d42ec18cfeee160cc60d9a4cfc7a9f42fcb868af570424114069

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for objectstore_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 649717effd8d106127ba78e071ab82c8f0bca5f23040d73be89fdb254b0e1c22
MD5 e72c9d9cc18da496bf96c1ddb763469a
BLAKE2b-256 3ff3ff1582c53f58c3d6eea93e940e848b4a6c318ba8edb1b52e0b0eaaccfbcf

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