Commits

Kelsey Hightower committed 084daac

Updating README and setup.py meta data

Comments (0)

Files changed (3)

 include yamlconfig.py
+recursive-include test *
 YAML configuration file reader with basic variable interpolation.
+
+Requires PyYAML <http://pyyaml.org/wiki/PyYAML>
+
+Example
+-----------
+
+/etc/dummy_config.yaml
+
+main:
+    name: 'Napoleon'
+    age: 15
+    skills: ['Ninja', 'Dancing', 'Nunchucks', $default_skills]
+    net_worth: $10
+
+
+>>> from yamlconfig import YamlConfig
+>>> defaults = {'default_skills': 'KickBall'}
+>>> config = YamlConfig('/etc/dummy_config.yaml', defaults)
+>>> config['main']['name']
+'Napoleon'
+>>> type(config['main']['name'])
+<class 'str'>
+>>> config['main']['age']
+15
+>>> type(config['main']['age'])
+<class 'int'>
+>>> config['main']['skills']
+['Ninja', 'Dancing', 'Nunchucks', 'KickBall']
+>>> type(config['main']['skills'])
+<class 'list'>
+>>> config['main']['net_worth']
+'$10'
+>>> type(config['main']['net_worth'])
+<class 'str'>
+
     description='YAML configuration file reader with basic variable interpolation.',
     author='Kelsey Hightower',
     author_email='kelsey.hightower@gmail.com',
-    url='http://bitbucket.com',
+    url='https://bitbucket.org/khightower/yamlconfig',
     py_modules=['yamlconfig'],
     classifiers=[
         'Development Status :: 1 - Planning',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: GNU General Public License (GPL)',
         'Natural Language :: English',
+        'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.1',
         'Programming Language :: Python :: 3.2',
         'Topic :: Software Development :: Libraries :: Python Modules',