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.main import Envbee

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

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

# Retrieve multiple variables
variables = 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(variable_name: str) -> str

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) -> list[dict]

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

Caching

The SDK uses local caching to store variable values, improving efficiency by reducing API calls.

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.3.0.tar.gz (8.2 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.3.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: envbee_sdk-1.3.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for envbee_sdk-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ef1c8be60a31beaced259a6ee5aee42aa3fe8f6b14bf7e7d32b4ff06ac65d1c1
MD5 0a53d7017631979549313a9446c73ca4
BLAKE2b-256 2f7615abac0dd0a2ce1158d877e89b6360ee3d66415224e520c35cd294654e6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envbee_sdk-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for envbee_sdk-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 512391e4e50a32fc6279a751402ae6fbd4582d06bc4fe711a32bcc4175a9cca1
MD5 d44d8a44fcbdfb29622593a3c81793f4
BLAKE2b-256 0e37a972b3c99652b8f887583376b2a0135cdc4944bd8cb3c5310d0b228cc50e

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