{"id":6879,"library":"setoptconf-tmp","title":"Setoptconf-tmp","description":"Setoptconf-tmp is a temporary fork of the `setoptconf` library, designed to retrieve program settings from various sources like the command line, environment variables, INI files, JSON files, YAML files, and Python objects/modules. This fork was created to resolve compatibility issues with `setuptools >= 58` that affected the original `setoptconf` library, particularly for tools like `prospector`. The library is explicitly stated as a temporary solution, not actively maintained, and is expected to be purged once `prospector` updates or the original `setoptconf` is fixed. The current version is 0.3.1, last released in September 2021.","status":"abandoned","version":"0.3.1","language":"en","source_language":"en","source_url":"https://github.com/carlio/setoptconf-tmp","tags":["configuration","settings","environment variables","ini","json","yaml","command line","temporary","fork","unmaintained"],"install":[{"cmd":"pip install setoptconf-tmp","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"ConfigurationManager","correct":"from setoptconf import ConfigurationManager"},{"symbol":"StringSetting","correct":"from setoptconf import StringSetting"},{"symbol":"IntegerSetting","correct":"from setoptconf import IntegerSetting"},{"symbol":"BooleanSetting","correct":"from setoptconf import BooleanSetting"},{"symbol":"CommandLineSource","correct":"from setoptconf import CommandLineSource"},{"symbol":"EnvironmentVariableSource","correct":"from setoptconf import EnvironmentVariableSource"},{"symbol":"ConfigFileSource","correct":"from setoptconf import ConfigFileSource"}],"quickstart":{"code":"import setoptconf as soc\nimport os\n\n# Simulate environment variables\nos.environ['MYPROGRAM_API_KEY'] = os.environ.get('MYPROGRAM_API_KEY', 'default_api_key_from_env')\nos.environ['MYPROGRAM_DEBUG'] = os.environ.get('MYPROGRAM_DEBUG', 'True')\n\n# Create a dummy config file for demonstration\nwith open('.myprogramrc', 'w') as f:\n    f.write('[myprogram]\\n')\n    f.write('setting_from_file = 123\\n')\n\nmanager = soc.ConfigurationManager('myprogram')\n\nmanager.add(soc.StringSetting('api_key', default='no_key_found'))\nmanager.add(soc.IntegerSetting('setting_from_file', required=False))\nmanager.add(soc.BooleanSetting('debug', default=False))\nmanager.add(soc.StringSetting('app_name', default='MyApp'))\n\n# The order of sources implies priority (later sources override earlier ones)\nconfig = manager.retrieve(\n    soc.CommandLineSource, # Pulls from command line (e.g., --api-key <value>)\n    soc.EnvironmentVariableSource, # Pulls from environment variables prefixed with MYPROGRAM_\n    soc.ConfigFileSource(('.myprogramrc', '/etc/myprogram.conf')) # Pulls from INI files\n)\n\nprint(f\"API Key: {config.api_key}\")\nprint(f\"Setting from file: {config.setting_from_file}\")\nprint(f\"Debug mode: {config.debug}\")\nprint(f\"App Name: {config.app_name}\")\n\n# Clean up dummy config file\nos.remove('.myprogramrc')","lang":"python","description":"This quickstart demonstrates how to define settings and retrieve them from multiple sources. It prioritizes command line arguments, then environment variables (prefixed with `MYPROGRAM_`), and finally INI configuration files. It also shows how to define different setting types and provide defaults or mark them as required."},"warnings":[{"fix":"Avoid using this library for new projects. For existing projects, migrate to the official `setoptconf` once its `setuptools` compatibility is resolved, or switch to a different, actively maintained configuration library.","message":"This library is a temporary, unmaintained fork. It was created solely to address a specific compatibility issue with `setuptools >= 58` affecting the original `setoptconf` for `prospector` builds. Users should be aware that it will not receive updates, may contain unpatched vulnerabilities, and is explicitly stated to be purged once its original purpose is fulfilled.","severity":"breaking","affected_versions":"All versions"},{"fix":"If migrating from original `setoptconf`, verify its compatibility with your current `setuptools` version. This `setoptconf-tmp` version is not a long-term solution for that underlying issue.","message":"The primary `setoptconf` library, which this package forks, historically had issues with `setuptools >= 58`. While `setoptconf-tmp` was created to mitigate this for specific build environments, it highlights a potential underlying fragility or dependency on older Python ecosystem components in the original project design.","severity":"gotcha","affected_versions":"Versions 0.1.0-0.3.1 (original setoptconf)"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}