Skip to main content

A convenient utility for managing configurations.

Installation

python3 -m pip install config-kit

Usage

Use in Python

from config_kit.core import ConfigKit

# Intialize a ConfigKit instance
config = ConfigKit(config_file='config.ini', section='common')

# Set configuration items
config.username = 'admin'
config.password = '123456'

# Remove configuration items
del config.username

# Save configuration items
config.save()

# Retrieve configuration items
print(config.username)
print(config.password)


# Use a context manager to automatically save changes
with ConfigKit(config_file='config.ini') as config:
    config.host = 'localhost'
    config.port = 8080

Use in Shell

config-kit --help

config-kit -c config.ini -s common sub-command [arguments]

# Set configuration items
config-kit set username admin
config-kit set password 123456

# Remove configuration items
config-kit remove username

# Retrieve configuration items
config-kit get username
config-kit get password

Configuration File Format

The configuration file is in the INI format, with sections and key-value pairs. For example:

[common]
username = admin
password = 123456

[database]
host = localhost
port = 3306

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

config_kit-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

config_kit-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file config_kit-1.0.0.tar.gz.

File metadata

  • Download URL: config_kit-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for config_kit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 421f1d46fa2b969b8ca6684ba3bbc1af331086f02b3f3d3116eaffbe1fe3c3c8
MD5 438ff79e6dd320415b9ccd107615d93f
BLAKE2b-256 496f29eeaf9893301c7a48baa133f48658eee5a975a1121ad3bb936149bc4cfe

See more details on using hashes here.

File details

Details for the file config_kit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: config_kit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for config_kit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc27d1cea39373bafcd2e2c108a564f75e37ca4963045c9bf2e0803d285dbbdd
MD5 99bd6c8894d82e7eceb446b5525fabff
BLAKE2b-256 10f95b50d1d0a555f2182e09c2f8564426d516051f2ca748bc3bc9d0bcde6938

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page