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.3.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.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: objectstore_client-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6a295ebc53b9154637c27c8de13ba4174604801fb5a209fac8082bccf8db4308
MD5 6860b8f686bf4098d36e5ff97628e5fe
BLAKE2b-256 5969acbc443bfe27f488298bcf7043ba2ecd852636c61d78cebed6156c47a42d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for objectstore_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bba92a4659d7f510e4fe7d339bd5352b281a79c0ac22dd460ec13149fbceb2ce
MD5 a5caf6dce12dc0b63fa534845a428885
BLAKE2b-256 a8800ff77dec42038589a698abe2f1d1ba600f3e255056d94e40f7c8382eda6b

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