Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Use configtool from the shell to validate, pretty-print, get or set config values::

Project Description
Use configtool from the shell to validate, pretty-print, get or set config values::

With no arguments you will output the same config file, you can use this feature
to validate the file.

$ config.ini > python -m configtool
[app]
name = rocket
description = A app to launch a Space Rocket
[uwsgi]
socket = /var/run/spacerocket.socket

-get argument will print the value of the key on the section you want, you can
also do -section and -get will use that for section.

$ cat config.ini | python -m configtool -get app.name
rocket
$ cat config.ini | python -m configtool -section app -get description
A app to launch a Space Rocket

Specify just the section, and it will output the config syntax for just that
section

$ cat config.ini | python -m configtool -get app
[app]
name = rocket
description = A app to launch a Space Rocket

Easily update values, just by using set

$ python -m configtool -set app.name "spacerocket" > config.ini
$ cat config.ini
[app]
name = spacerocket
description = A app to launch a Space Rocket

You can also convert syntax if you had json or yaml python modules available::

$ cat config.ini | python -m configtool -o yaml
app:
name: spacerocket
description: A app to launch a Space Rocket

$ config.ini > python -m configtool -o json
{"app":{"name":"spacerocket","description":"A app to launch a Space Rocket"}}
Release History

Release History

This version
History Node

0.1a

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting