Skip to main content

envbee SDK for Python

Project description

envbee Python SDK

envbee SDK is a Python client for interacting with the envbee API (see https://envbee.dev). This SDK provides methods to retrieve variables and manage caching for improved performance.

Table of Contents

Installation

To install the envbee SDK, use pip:

pip install envbee-sdk

Usage

Instantiate the Envbee class with your API credentials:

from envbee_sdk import Envbee

client = Envbee(
    api_key="your_api_key",
    api_secret=b"your_api_secret",
    enc_key=b"32-byte-encryption-key-goes-here"  # optional, could be a string or a 32 bytes buffer
)

# Retrieve a variable
value = client.get("VariableName")

# Retrieve multiple variables
variables, metadata = client.get_variables()

Methods

  • get(variable_name: str) -> any: fetch a variable value.
  • get_variables(offset: int = None, limit: int = None) -> tuple[list[dict], Metadata]: fetch multiple variable definitions with pagination.

Encryption

Some variables stored in envbee are encrypted using AES-256-GCM (via the cryptography library). Encrypted values are prefixed with envbee:enc:v1:.

  • If an encrypted variable is fetched and you provide a correct decryption key (enc_key), the SDK will decrypt it automatically.
  • If no key or a wrong key is provided, a RuntimeError will be raised on decryption.
  • The encryption key is never sent to the API; all decryption is performed locally.
  • Cached values are stored exactly as received from the API (encrypted or plain-text).

Example with encryption key:

client = Envbee(
    api_key="your_api_key",
    api_secret=b"your_api_secret",
    enc_key=b"32-byte-encryption-key-goes-here"
)

Logging

Configure logging as needed. The SDK logger name is envbee_sdk. Example:

import logging

logging.basicConfig(level=logging.ERROR)

sdk_logger = logging.getLogger("envbee_sdk")
sdk_logger.setLevel(logging.DEBUG)  # for detailed logs

# Example usage within the SDK
sdk_logger.debug("This is a debug message from the SDK.")
sdk_logger.info("Informational message from the SDK.")

Caching

The SDK caches variables locally to provide fallback data when offline or the API is unreachable. The cache is updated after each successful API call. Local cache stores variables as received from the API, encrypted or plain.

  • Encryption key is never stored in cache or sent to API.
  • All encryption/decryption happens locally with AES-256-GCM.

API Documentation

For more information on envbee API endpoints and usage, visit the official API documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

envbee_sdk-1.8.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

envbee_sdk-1.8.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file envbee_sdk-1.8.0.tar.gz.

File metadata

  • Download URL: envbee_sdk-1.8.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for envbee_sdk-1.8.0.tar.gz
Algorithm Hash digest
SHA256 6038fede3c03a57fc4f57f52753a2772bac21fea0ee4cebc69988186dcba6159
MD5 9b4fccec34c1ec009ab0288fd09da3bd
BLAKE2b-256 d6a79a5d798019154b781f42c9b7ef1d4fe033b842cbb3e6dd114a90286773a0

See more details on using hashes here.

File details

Details for the file envbee_sdk-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: envbee_sdk-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for envbee_sdk-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8353c7565f93455e1ad14935a708805486afd082397ca12562d56c6834414d5f
MD5 5779ce40e2d3adb296afed1fd8ab92dc
BLAKE2b-256 e49c5b2db353dba9ea41617a67b1d2fc4ef41c62fa844e052ae7bb397db7557f

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