Skip to main content

envbee SDK for Python

Project description

envbee 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

To use the envbee SDK, instantiate the envbee class with your API credentials:

from envbee_sdk import Envbee

eb = Envbee(api_key="your_api_key", api_secret=b"your_api_secret")

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

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

Logging

The root logger name is "envbee_sdk". You can configure the default logging level for the SDK and handle logs as needed. Here's an example of how to set up basic logging for your application using the SDK:

# Basic logging configuration for your application
logging.basicConfig(
    level=logging.ERROR,  # Set default log level for the root logger
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    handlers=[logging.StreamHandler()],  # Send logs to stdout
)

# Get the SDK logger (specific to envbee_sdk)
sdk_logger = logging.getLogger("envbee_sdk")
sdk_logger.setLevel(logging.DEBUG)  # You can set the SDK logger to 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.")

Methods

get(variable_name: str) -> any

Fetches the value of a variable by its name. If the API request fails, it retrieves the value from the cache.

get_variables(offset: int = None, limit: int = None) -> tuple[list[dict], Metadata]

Fetches a list of variables from the API with optional pagination parameters.

Caching

The SDK uses a local cache to store variable values as a failsafe mechanism. The cache is updated with each successful endpoint request and serves as a fallback when the network or Internet connection is temporarily unavailable. Currently, the data is stored unencrypted, but encryption will be implemented in future releases.

API Documentation

For more details on the available API endpoints and their usage, check the official API docs.

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.7.1.tar.gz (9.3 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.7.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for envbee_sdk-1.7.1.tar.gz
Algorithm Hash digest
SHA256 85d4658351a4f7086f2281dbc4cc577c7678201bd7924cedcf30f7b578ad42a9
MD5 e3913422f8e7a7c6e84e383c07affbee
BLAKE2b-256 4c1c173abb09f1073feadf0e5c27e29ef14620b8fc2e7d18e2364dbb787d38d8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for envbee_sdk-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea75a18fb8568d8cecdd89243afd6355bf359243b69c84f8832b45aed727c440
MD5 f8b2ec1402ce6ea04f58d9c3b5b90eee
BLAKE2b-256 da240e555558f4667c86f3596a4511e306016be7a06575b1d2db6325d4aa5620

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