Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Easily configure Python apps via environment variables, YAML, and AWS SSM Param Store.
Configure your applications as easily as possible.
# "ConfigSchema" is pydantic's BaseModel renamed and re-exported for easier use
from flex_config import ConfigSchema, construct_config
class Config(ConfigSchema):
a_string: str
an_int: int
# Raises ValidationError
my_bad_config = construct_config(Config, {"a_string": ["not", "a", "string"], "an_int": "seven"})
my_good_config = construct_config(Config, {"a_string": "my_string", "an_int": "7"})
assert isinstance(my_good_config.an_int, int)
from pathlib import Path
from typing import Dict, Any
# "ConfigSchema" is pydantic's BaseModel renamed and re-exported for easier use
from flex_config import ConfigSchema, construct_config, AWSSource, YAMLSource, EnvSource, ConfigSource
class Config(ConfigSchema):
env: str
my_thing: str
def get_ssm_params(config_so_far: Dict[str, Any]) -> ConfigSource:
# env is set to live or dev via environment variables in the deployment environment
env = config_so_far.get("env")
if env == "local": # Not a live deployment, my_thing is in a local yaml file
return {}
return AWSSource(f"my_app/{config_so_far['env']}")
my_config = construct_config(Config, [EnvSource("MY_APP_"), YAMLSource(Path("my_file.yaml")), get_ssm_params])
Basic install: poetry install flex_config
With all optional dependencies (support for AWS SSM, YAML, and TOML): poetry install flex_config -E all
For a full tutorial and API docs, check out the hosted documentation
FAQs
Easily configure Python apps via environment variables, YAML, and AWS SSM Param Store.
We found that flex-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.