Skip to main content

Bear Config

pypi version

A useful Pydantic based config system with various options

Installation

With uv: uv tool install bear-config

Configuration precedence

Values are merged in order; later sources override earlier ones:

  1. default.toml
  2. {env}.toml (for the active environment, e.g., dev.toml, prod.toml)
  3. local.toml
  4. Environment variables prefixed with your program name (e.g., MY_APP_...)

Search paths (by default): ~/.config/{program}/ and ./config/{program}/.

Quickstart

Define a Pydantic model for your settings, then load it with the ConfigManager.

from pydantic import BaseModel
from bear_config.config_manager import ConfigManager


class Database(BaseModel):
    host: str = "localhost"
    port: int = 5432


class Settings(BaseModel):
    database: Database = Database()
    debug: bool = False


config = ConfigManager[Settings](
    config_model=Settings,
    program_name="my_app",
    env="dev",
).config

print(config.database.host)
print(config.debug)

Environment variables can override nested keys using the program prefix. For example, MY_APP_DATABASE_HOST=prod.db and MY_APP_DEBUG=true will replace the corresponding fields after files are loaded.

Generating a default config

You can scaffold a TOML file with the model’s default values:

from bear_config.config_manager import ConfigManager

config_mgr = ConfigManager[Settings](Settings, program_name="my_app")
config_mgr.create_default_config()  # writes default.toml into the local config dir

Metadata

Release files for bear-config 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bear-config 1.0.10
File Interpreter ABI Platform Actions
bear_config-1.0.10-py3-none-any.whl Python 3 none any Details for bear_config-1.0.10-py3-none-any.whl

Release files / bear_config-1.0.10-py3-none-any.whl

Download URL bear_config-1.0.10-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cea11eefbcaec4227a9a64108a5ef9f37bce3703b02b05c552cb4ab065dbb59d
BLAKE2b-256 checksum
How to use checksums
0b1b9014ca67ad22f0fe60fd2fcc6356657963253d6f7321cc7f97e423dc1377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Security for bear-config 1.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for bear_config-1.0.10-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.10 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page