Loads configurations from yaml files
Project description
Config With YAML
Config With YAML is a pure-Python package to load config YAML files.
import config_with_yaml as config
cfg = config.load("demo.yml")
print (cfg.getProperty("Demo.Motors.Server"))
print (cfg.getPropertyWithDefault("Demo.Motors.Server2", "Server2"))
print (cfg)
Config file content:
Demo:
Motors:
Server: ROS # Deactivate, Ice , ROS
Proxy: Motors:default -h localhost -p 9001
Topic: '/turtlebotROS/mobile_base/commands/velocity'
Name: basic_component_pyCamera
maxW: 0.7
maxV: 4
Camera:
Server: ROS # Deactivate, Ice , ROS
Proxy: "CameraL:default -h localhost -p 9001"
Format: RGB8
Topic: "/TurtlebotROS/cameraL/image_raw"
Name: basic_component_pyCamera
NodeName: demo
Output:
loading Config file ./demo.yml
ROS
Server2
Demo:
Camera:
Format: RGB8
Name: basic_component_pyCamera
Proxy: CameraL:default -h localhost -p 9001
Server: ROS
Topic: /TurtlebotROS/cameraL/image_raw
Motors:
Name: basic_component_pyCamera
Proxy: Motors:default -h localhost -p 9001
Server: ROS
Topic: /turtlebotROS/mobile_base/commands/velocity
maxV: 4
maxW: 0.7
NodeName: demo
Extra Configuration
by default config_with_yaml uses the path to the file that is passed to it, but if you have all the cofiguration files in directory or several, you can set the value of the environment variable "YAML_CONFIG_PATHS" with these files separated by :, so just put the file name is able to find it.
export YAML_CONFIG_PATHS=path/to/folder1:path/to/folder2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file config_with_yaml-0.1.0.tar.gz
.
File metadata
- Download URL: config_with_yaml-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f358b9c8f3a2ec0742ecbd3d30712cea4a195f36ac7a764f64ac08371cca16e0 |
|
MD5 | 1db2b98bf0654b71b01b73de1338a3a7 |
|
BLAKE2b-256 | 93407229e9ef6431d54dd5d9f70c5a59bd1ddcfa052192f757a37833b246ae1b |
File details
Details for the file config_with_yaml-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: config_with_yaml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 296924d3fd17ecc98e3d9870d8c6e2874f78be07e54e3f94e6890f865e027604 |
|
MD5 | fbf279ba8af76f09f506222c19d42634 |
|
BLAKE2b-256 | 78b7c2a2aecb20675ed3f104e71aa3ba41db7e0238a4c3ecaf3385eff8a27cdd |