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

Uploaded Python 3

File details

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

File metadata

  • Download URL: objectstore_client-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 f949f399fcaef8eccaae2bb09e551bcf8de28259bfa6a8d3c9d886355309b9ad
MD5 3a5f1ece8a87df613daba77b560e24aa
BLAKE2b-256 22171ada0da3901bec1ffec0255c48bd1ad3bff10c792787ed67da001e9b4a60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for objectstore_client-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d6aef5a29c8eb89f972623f3f40c9cb1cfab243acbdf95393407dbe41f26bcde
MD5 64d5d89697bec0188723a882c5374378
BLAKE2b-256 205c6bb2d8576208069accf31d2dbc84ef9390722287a39ca8098b4152c4b2f5

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