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

A simple class for converting a *.cfg file to a Python Dictionary

Project Description

-- ConfigToDictionary
Convert a python config file of to a python dictionary

-- Example
Return the information in `info.cfg` as a `JSON` response from a `Flask` server:

name = risk
version = 1
description = A simple game of chance. Risk 1000 Satoshis, win 2000, or lose them all.
project =

price = 1000
description = 49/100 chance you will double your satoshis
from flask import Flask
from flask.ext.responses import json_response
from cfgtodict import ConfigToDictionary

app = Flask(__name__)

def info():
about = ConfigToDictionary('info.cfg').dict()
return json_response(about)

JSON response
"info": {
"description": "A simple game of chance. Risk 1000 Satoshis, win 2000, or lose them all.",
"name": "risk",
"project": "",
"version": "1"
"risk": {
"description": "49/100 chance you will double your satoshis",
"price": "1000"

Release History

This version
History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(1.2 kB) Copy SHA256 Hash SHA256
Source None Dec 12, 2015

Supported By

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 Google Google Cloud Servers