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.6.tar.gz (8.5 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.6-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: objectstore_client-0.0.6.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

Hashes for objectstore_client-0.0.6.tar.gz
Algorithm Hash digest
SHA256 26ad9341f8e29892fc0418bcf5da8d3d964310a58a64163178caef2e61763de1
MD5 dd4ded52fbb1edd837812e4ba5fe1934
BLAKE2b-256 4465ed0a08603bc883731e7b36728fb137ed46058aa0e0af26749f41662e71d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for objectstore_client-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a27ca0a5901dc2a317ca8c3bc7a7ef797d38fafe8f87f4378404454dd5d1b673
MD5 8235ff8cacfece49c6627f6e7cdb6ed7
BLAKE2b-256 53e5b4c176fb97c6f9f3749dd7f826db5d4da6d015bd9dc9c5b51da8c2edd4de

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