Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
modify README, fix version in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
laike9m committed Apr 16, 2015
1 parent aa1a280 commit e0aefbe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
13 changes: 11 additions & 2 deletions README.md
Expand Up @@ -11,10 +11,14 @@ especially for reading configuration files.

OK, stop talking, show us some code!

On the left is what you'll normally do, on the right is the ezcf way. Much more elegant isn't it?
On the left is what you'll normally do, on the right is the ezcf way.
**All you need is `import ezcf` first, then `import filename` without extension.** Nothing else!

![](https://github.com/laike9m/ezcf/raw/master/code_compare.png)

For instance, here we want to load file `config.json`. With a single line of code `import config`,
everything is done and you're happy.

## Install

pip install ezcf
Expand Down Expand Up @@ -66,6 +70,8 @@ only one of them will be loaded. So it's better not to use multiple documents;
3. All values in `.ini` files are kept as it is and loaded as a string;
4. Since XML only allows single root, the whole xml will be loaded as one dict with root's name as variable name;
5. Namespace package is not supported yet, pull requests are welcome.
6. Use [**valid variable names**][1], this means key strings in JSON/YAML/INI/XML should be valid Python variable name.
Invalid variable name won't do any harm to your program nor will it crash, but you can't use them as expected.

## Run Tests
```
Expand All @@ -86,4 +92,7 @@ python setup.py test
- [x] pypi

## License
MIT
MIT


[1]: https://docs.python.org/3.4/reference/lexical_analysis.html#identifiers
15 changes: 12 additions & 3 deletions README.rst
Expand Up @@ -10,12 +10,16 @@ from these formats, especially for reading configuration files.

OK, stop talking, show us some code!

On the left is what you'll normally do, on the right is the ezcf way.
Much more elegant isn't it?
| On the left is what you'll normally do, on the right is the ezcf way.
| **All you need is ``import ezcf`` first, then ``import filename``
without extension.** Nothing else!

.. figure:: https://github.com/laike9m/ezcf/raw/master/code_compare.png
:alt:

For instance, here we want to load file ``config.json``. With a single
line of code ``import config``, everything is done and you're happy.

Install
-------

Expand Down Expand Up @@ -84,6 +88,11 @@ Something to note before using ezcf:
4. Since XML only allows single root, the whole xml will be loaded as
one dict with root's name as variable name;
5. Namespace package is not supported yet, pull requests are welcome.
6. Use `**valid variable
names** <https://docs.python.org/3.4/reference/lexical_analysis.html#identifiers>`__,
this means key strings in JSON/YAML/INI/XML should be valid Python
variable name. Invalid variable name won't do any harm to your
program nor will it crash, but you can't use them as expected.

Run Tests
---------
Expand All @@ -109,7 +118,7 @@ Roadmap
License
-------

MIT
MMIT

.. |Build Status| image:: https://travis-ci.org/laike9m/ezcf.svg
:target: https://travis-ci.org/laike9m/ezcf
Expand Down
2 changes: 1 addition & 1 deletion ezcf/__init__.py
@@ -1,6 +1,6 @@
__author__ = "laike9m (laike9m@gmail.com)"
__title__ = 'ezcf'
__version__ = '0.0.1'
__version__ = '0.2.0'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 laike9m'

Expand Down

0 comments on commit e0aefbe

Please sign in to comment.