{"library":"simple-settings","title":"Simple Settings","description":"Simple Settings is a Python library designed to provide a flexible and straightforward way to manage project configurations, inspired by Django's settings system. It allows loading settings from various file formats (Python modules, CFG, YAML, JSON, TOML) and supports dynamic settings backends like AWS S3, Memcached, and SQL databases. The current version is 1.2.0, and it maintains an active, though irregular, release cadence.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install simple-settings","pip install simple-settings[all]"],"cli":{"name":"simple_settings","version":"sh: 1: simple_settings: not found"}},"imports":["from simple_settings import settings","from simple_settings import LazySettings"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport sys\nfrom simple_settings import settings\n\n# --- Create a dummy settings file for demonstration ---\nsettings_content = \"\"\"\nFOO = 'bar'\nBAZ = 123\nSIMPLE_SETTINGS = {'required_settings': ['FOO']}\n\"\"\"\n\nsettings_dir = 'my_project_settings'\nos.makedirs(settings_dir, exist_ok=True)\nwith open(os.path.join(settings_dir, 'development.py'), 'w') as f:\n    f.write(settings_content)\n\n# Add the settings directory to Python's path so it can be imported\nsys.path.insert(0, os.getcwd())\n\n# Method 1: Set environment variable (deprecated but common in older setups)\n# os.environ['SIMPLE_SETTINGS'] = 'my_project_settings.development'\n\n# Method 2: Command line argument (preferred for non-programmatic loading)\n# For programmatic loading, you'd typically use LazySettings or a custom loader\n# For this quickstart, we'll demonstrate direct access after 'setting' the module path implicitly.\n# In a real app, you would run like: python your_script.py --settings=my_project_settings.development\n\n# As a workaround for a runnable quickstart, we'll manually set the internal _SETTINGS_MODULE\n# This is NOT how you'd normally configure it in production for the 'settings' singleton\n# Normally, the --settings CLI arg or SIMPLE_SETTINGS env var would handle this.\n# Using LazySettings is the programmatic alternative.\n\n# For this demonstration, we'll mimic the effect of `settings.configure()`\n# if the env var or CLI was set.\n# In a real application, you'd run `python your_app.py --settings=my_project_settings.development`\n# and then `from simple_settings import settings` would automatically pick it up.\n# To make this runnable without CLI args or env vars, we use LazySettings.\n\ntry:\n    # Using LazySettings for a self-contained programmatic example\n    app_settings = LazySettings('my_project_settings.development')\n    print(f\"FOO setting: {app_settings.FOO}\")\n    print(f\"BAZ setting: {app_settings.BAZ}\")\n\n    # Demonstrate a missing required setting (this would raise an error)\n    # with open(os.path.join(settings_dir, 'broken_settings.py'), 'w') as f:\n    #     f.write(\"BAZ = 456\")\n    # broken_app_settings = LazySettings('my_project_settings.broken_settings')\n    # print(f\"Broken FOO: {broken_app_settings.FOO}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\nfinally:\n    # Clean up dummy settings file and directory\n    os.remove(os.path.join(settings_dir, 'development.py'))\n    # if os.path.exists(os.path.join(settings_dir, 'broken_settings.py')):\n    #     os.remove(os.path.join(settings_dir, 'broken_settings.py'))\n    os.rmdir(settings_dir)\n    sys.path.pop(0)\n","lang":"python","description":"This quickstart demonstrates how to define a Python settings file and load it using `LazySettings`. In a typical application, the settings module would be specified via a `--settings` command-line argument (e.g., `python your_app.py --settings=my_project_settings.development`) or the `SIMPLE_SETTINGS` environment variable, after which the global `simple_settings.settings` object becomes populated. Using `LazySettings` allows for explicit, programmatic control over which settings module to load.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"1.2.0","pypi_latest":"1.2.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":65,"avg_install_s":3.5,"avg_import_s":0.1,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.05,"mem_mb":2.4,"disk_size":"17.9M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.04,"mem_mb":2.4,"disk_size":"18M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0.1,"mem_mb":3.3,"disk_size":"70M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.1,"mem_mb":2.8,"disk_size":"19.8M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0.09,"mem_mb":2.8,"disk_size":"20M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"clean","install_time_s":7.3,"import_time_s":0.31,"mem_mb":3.8,"disk_size":"78M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.08,"mem_mb":2.7,"disk_size":"11.7M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.1,"mem_mb":2.7,"disk_size":"12M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.09,"mem_mb":3.4,"disk_size":"11.4M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.09,"mem_mb":3.2,"disk_size":"12M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.05,"mem_mb":2.3,"disk_size":"17.4M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"all","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"simple-settings","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.04,"mem_mb":2.3,"disk_size":"18M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"all","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.9,"import_time_s":0.12,"mem_mb":3.1,"disk_size":"69M"}]}}