/bossconf

Config parser with token interpreter'

Primary LanguagePythonMIT LicenseMIT

BossConf


Info:

When it's hard to parse it, BossConf it!
- config library for python application
- CLI tool

Instalation:

  • for installation you need to run pip install bossconf.
  • python 2.6.6 up to 2.7.x version.

Used as CLI:

File as argument

  • bossconf /path/to/file "level1, level2" - this command will access the level you want form file

Used with pipe

  • cat example.json | bossconf "level1, level2" - this command will read and parse data from file and outputs the content.

  • echo '{"key":"value"}' | bossconf 'key' - this command will parse the string containing data for parsing and display the content.

  • curl curl -u user:password 'http://your/url/' | bossconf

Examples

  • given the following files you can have:

  1. bossconf example.yaml "anne, has" and the output will be:

  2. bossconf example.json "anne, marry" and the output:

  3. cat example.json "anne, has" the output will be:

  4. echo '{"anne":{"has":"apples","marry":["has pears"]}}' | bossconf "anne, marry" and the output:

  5. curl -u guest:rate 'http://example.com/api/queues' | bossconf will output:

  6. curl -u guest:rate 'http://example.com/api/queues' | bossconf '0, back' will display:

Used as library:

  • you just need to import the moduel and create a new instance.
  • the next step is to use .get() function and print the output.
  • we will use the same two file form the CLI example.

Examples

  • for BossConfing an json file we will do the following:

  • for BossConfing an yaml file we will need to do: