Skip to main content

Python SDK for Octopus Energy.

Project description

oe-sdk

Python 3.12+ Pydantic v2 Ruff

Internal Python SDK.

oe-sdk provides standardised, production-ready plumbing for common infrastructure so that all services benefit from consistent, safe, and well-maintained implementations. It is not a collection of high-level API wrappers or opinionated utilities, it provides the core building blocks that every service can use to interact with external systems in a reliable, predictable way.

The goal: uv add oe-sdk[s3], write a with S3Client() as s3:, and get straight to the actual work.

Philosophy

The SDK exists so engineers can focus on business problems, not infrastructure plumbing.

Every team eventually needs to talk to a common service. Without a shared foundation, each team ends up writing its own version, copy-pasted from a blog post, a previous project, or a colleague's Slack snippet. These ad-hoc implementations are rarely tested, inconsistently configured, and silently diverge over time.

The SDK solves this by providing a single, trusted source for that plumbing.

What belongs in the SDK

  • Obviously common things. If nearly every service needs it (S3 access, a common internal API, a team's data control plane, etc.), it belongs here.
  • Patterns duplicated in 2+ places. If two or more teams have independently written the same integration, that's a sign for us. We extract it, test it properly, and put it in the SDK so nobody has to write it again.

What the SDK is not

  • Not a framework. It doesn't dictate how you structure your application, which web framework you use, or how you organise your business logic.
  • Not opinionated about your domain. It handles the infrastructure layer and gets out of the way. Your modelling, your validation rules, your API design.

Design principles

  • Minimal surface, maximum trust. Each module does the smallest useful thing well: lifecycle, config, retries, logging, and exposes the raw underlying client for everything else. No leaky abstractions that go stale when the upstream library adds features.
  • Tested and validated. Every module ships with tests. Configuration is validated at construction. If you can instantiate it, it's correctly configured.
  • Consistent patterns. Same context-manager lifecycle, same Pydantic config, same sync/async split, same naming conventions. Learn one module, you can instinctively know them all.
  • Unopinionated where possible. The SDK follows established best practices but doesn't force architectural choices on callers.

Installation

Install the core SDK:

uv add oe-sdk

Then enable the modules you need via extras:

uv add oe-sdk[s3]          # S3 client plumbing

Multiple extras can be combined:

uv add oe-sdk[s3,...]      # add more as they become available

Modules

Each module has its own README with full usage, configuration, and testing guidance.

Module Extra Description Docs
s3 oe-sdk[s3] Context-managed sync & async S3 clients with retry, timeout, and logging README

Contributing

See CONTRIBUTING.md for development setup, design decisions, and guidance on adding new modules.

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

oe_sdk-0.1.0a1.tar.gz (177.9 kB view details)

Uploaded Source

Built Distribution

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

oe_sdk-0.1.0a1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file oe_sdk-0.1.0a1.tar.gz.

File metadata

  • Download URL: oe_sdk-0.1.0a1.tar.gz
  • Upload date:
  • Size: 177.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oe_sdk-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 74b9229d39abf46130288ac63c36fedb8b57d3ee5e2eb623b72c9578f8dc8bd1
MD5 3fa7bb246f3a542463418b926e272c9e
BLAKE2b-256 5fecde73136c02227e967cb84520f844a10787fb3694468a2da3daf5ab07a64e

See more details on using hashes here.

Provenance

The following attestation bundles were made for oe_sdk-0.1.0a1.tar.gz:

Publisher: publish.yml on octopus-energy/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oe_sdk-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: oe_sdk-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oe_sdk-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 0fcc5dcf3985edb64fa88aeae9468ec2f195c3010e7b4c8bd4df1cdaada7419e
MD5 df0709cb1324b8a89f712e17e6ed32be
BLAKE2b-256 db913c5e0d407eb82621ce2d165664db3c68a34c391f4eb0a8e0b58aee0c6e4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for oe_sdk-0.1.0a1-py3-none-any.whl:

Publisher: publish.yml on octopus-energy/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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