
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Implements the JSON, INI, YAML and TOML parser for Python setting and writing of configuration file.
The Python package 'pycnf' implements the json, configparser, yaml and toml parser for python setting and writing of configuration file.
The configuration file are necessary for many projects that will help us to manage and set project environment variables easily.
Configuration files, from INI/XML/JSON/YAML to TOML, readability and maneuverability have been improved too much in the past few years, and there are serveral parsers be created in Python and other programming language. That have made us becomes more efficient, but, we need to remember the different functions for different format configuration file that sometimes we only just want to read it and regardless of that format. So, using single function to read or/and write most of configuration file are good way to reduce memory burden.
pycnf have done some work to relax us on configuration files that can be used to parse and generate JSON/INI/YAML/TOML format configuration file.
{ "default":{
"debug":"{{debug}} {{debug2}}"
},
"comments":{
"version":"0.2.0",
"test_parse":"{{key:test_parse}} {{key:test_parse2}}",
"test_parse2":"@>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}",
"test_parse3":"{{key:test_parse}}",
"test_parse4":"@>@ str_replace('{{key:test_parse2}}', '2', '00')@<@ @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}"
}
}
More infomation and example of JSON can be founded in json.org, JSON Example and JSON-wikipedia. {{key:key:value}}/{{key}}
can be parsed by parse.extra using extra.list
and other.config
parameters. @>@ str_replace("123", "2", "1")@<@
can be parsed by parse.extra
setting parameter rcmd.parse
to TRUE
. Example of that can be founded in this document tail.
[default]
debug = {{debug}} {{debug2}}
[comments]
version = 0.2.0
test_parse = {{key:test_parse}} {{key:test_parse2}}
test_parse2 = @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}
test_parse3 = {{key:test_parse}}
test_parse4 = @>@ str_replace('{{key:test_parse2}}', '2', '00')@<@ @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}
More infomation and example of INI can be founded in INI-wikipedia.
default:
debug: '{{debug}} {{debug2}}'
comments:
version: 0.2.0
test_parse: '{{key:test_parse}} {{key:test_parse2}}'
test_parse2: '@>@ str_replace(''{{key:test_parse}}'', ''2'', ''00'')@<@ {{key:test_parse2}}
{{debug2}}'
test_parse3: '{{key:test_parse}}'
test_parse4: '@>@ str_replace(''{{key:test_parse2}}'', ''2'', ''00'')@<@ @>@ str_replace(''{{key:test_parse}}'',
''2'', ''00'')@<@ {{key:test_parse2}} {{debug2}}'
More infomation and example of YAML can be founded in yaml.org and YAML-wikipedia.
title = "TOML Example"
[default]
debug = true
[comments]
version = "0.1.0"
More infomation and example of TOML can be founded in and toml-lang/toml and TOML-wikipedia.
#You can install this package directly from PYPI by running:
pip install pycnf
FAQs
Implements the JSON, INI, YAML and TOML parser for Python setting and writing of configuration file.
We found that pycnf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.