
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
The key-value file format with sections
A config file (config.kvf
) with sections encoded with the Paradict text format:
# this comment is part of the
# unnamed section
[section 1]
id = 42
name = 'alex'
books = (dict)
sci-fi = (list)
'book 1'
'book 2'
thriller = (list)
'book 3'
Reading a config file:
import kvf
MY_CONFIG = {"section 1": {"id": 42,
"name": "alex",
"books": {"sci-fi": ["book 1",
"book 2"],
"thriller": ["book 3"]}}}
# read a config file
my_config = kvf.get_config("/path/to/config.kvf")
# my_config is a dictionary object.
# Each key-value item of the dict represents
# a section where the key is the header (string)
# and the value is the body (dictionary)
# test
assert my_config["section 1"] == MY_CONFIG["section 1"]
# load the config from a file object
with open("path/to/config.kvf", "r", encoding="utf-8") as file:
my_config = kvf.load(file)
# test
assert my_config["section 1"] == MY_CONFIG["section 1"]
Writing a config file:
import kvf
MY_CONFIG = {"section 1": {"id": 42,
"name": "alex",
"books": {"sci-fi": ["book 1",
"book 2"],
"thriller": ["book 3"]}}}
# write a config file
kvf.put_config(MY_CONFIG, "path/to/config.kvf")
# write config to a file object
with open("/path/to/config.kvf", "w", encoding="utf-8") as file:
kvf.dump(MY_CONFIG, file)
Feel free to open an issue to report a bug, suggest some changes, show some useful code snippets, or discuss anything related to this project. You can also directly email me.
Following are instructions to setup your development environment
# create and activate a virtual environment
python -m venv venv
source venv/bin/activate
# clone the project then change into its directory
git clone https://github.com/pyrustic/kvf.git
cd kvf
# install the package locally (editable mode)
pip install -e .
# run tests
python -m tests
# deactivate the virtual environment
deactivate
KvF is cross-platform. It is built on Ubuntu and should work on Python 3.5 or newer.
python -m venv venv
source venv/bin/activate
pip install kvf
pip install kvf --upgrade --upgrade-strategy eager
deactivate
Hello world, I'm Alex, a tech enthusiast ! Feel free to get in touch with me !
FAQs
The key-value file format with sections
We found that kvf 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.