A basic configuration loader intended for my own scripts, but might be useful for other people.
Load a JSON configuration from a file, or from multiple folders on the filesystem.
This project has no dependencies. Yay!
pip install basic-config-loader
This project is licensed under the MIT License - see the LICENSE.md file for details
import configLoader as cl ... CONFIG = cl.loadConfig(...) ...
:param path: the path to look for the file. It is recommended to provide the result of os.path.join() rather than a manually typed path because a certain OS which must not be named has different path conventions than everyone else.
:param default: the configuration to return if loading from the filesystem fails.
:param fromHome: if True, look from the current user's home directory. If False, look from the root directory.
:param topSearchPath: if None, only look in the specified path for the file. Otherwise, a path should be provided. 'HOME' can be filled in as a shortcut for os.environ['HOME']. The exact behavior depends on fullSearchAlways.
:param fullSearchAlways: if False, and the directory specified in path is empty, move up one folder, up to topSearchPath, until a config file is found, and use the first file found. If no file is found, use the default config. If True, start with the default configuration and apply any changes from topSearchPath to path in order.
:return: the configuration if loading was successful, or the default configuration if loading failed.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size basic_config_loader-0.2.0-py3-none-any.whl (7.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size basic-config-loader-0.2.0.tar.gz (3.0 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for basic_config_loader-0.2.0-py3-none-any.whl
Hashes for basic-config-loader-0.2.0.tar.gz