Command line INI editor
Project description
DIG ini-editor
Simple command line INI editor.
- Get list of sections
- Get list of keys from section
- Get value of key from section
- Add/Edit value of key from section
- Delete key from section
- Delete entire section
- Check if section exists
- Check if section and key exists
By default, all output will be written into stdout. It can be changed with option --output FILENAME
or --in-place
wich will use the input file as output.
The input filename "-"
is reserved to read from stdin (cat file.ini | ini-editor ACTION - …
)
Usage
python -m dig_ini_editor ACTION
or
ini-editor ACTION
ACTION
must be one of:
• get
ini-editor get filename [section [key]]
- If
section
is not set, will return a list of sections. - If
key
is not set, will return a list of keys fromsection
. - Otherwise will return the value of
key
fromsection
.
• set
ini-editor set filename section key value
Will add or replace, with value
, the value of key
from section
.
• delete
ini-editor delete filename section [key]
- If
key
is not set, will remove entiresection
. - Otherwise will remove only the
key
fromsection
.
• exists
ini-editor exists filename section [key]
Will return "true"
and exit code 0
if the condition is satisfied, otherwise return "false"
and exit code non-zero.
- If
key
is not set, will only check ifsection
exists.
Installation
From PyPI (preferred):
python -m pip install dig-ini-editor
From github release:
python -m pip install "https://github.com/DIG-/python-ini-editor/releases/download/1.0.1/dig_ini_editor-1.0.1-py3-none-any.whl"
or
python -m pip install "https://github.com/DIG-/python-ini-editor/releases/download/1.0.1/dig_ini_editor.tar.gz"
From github main branch:
python -m pip install "git+https://github.com/DIG-/python-ini-editor.git@master#egg=dig_git_ignore"
License
- You can use and redist freely.
- You can also modify, but only for yourself.
- You can use it as a part of your project, but without modifications in this project.
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
dig-ini-editor-1.0.1.tar.gz
(7.4 kB
view details)
Built Distribution
File details
Details for the file dig-ini-editor-1.0.1.tar.gz
.
File metadata
- Download URL: dig-ini-editor-1.0.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4140c1ae157c74400261986176a259a55552444ca8fce763bc9f8d7bece6b3c9 |
|
MD5 | 1be5bb1fdb021c063cf26cbe133384c9 |
|
BLAKE2b-256 | a2cacbf67adb4c58b7f598e3e3f5c1c12a2872eea43a9da0c2f52a78307a6a12 |
File details
Details for the file dig_ini_editor-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: dig_ini_editor-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f08caf94e694600dd0e10c29718533a347edbfe91ae4d90dc1e916457a3d23 |
|
MD5 | 9da64c79ce7d83b8ecb5b81d6cdc453f |
|
BLAKE2b-256 | 25df8d2710844c1af9747e660f1979ba87d67d9cf8f0a98dcc74d086d0afeb31 |