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

Commit

Permalink
Refine the example table in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyseek committed Sep 23, 2016
1 parent 79c2fe9 commit 0ee3d52
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions README.rst
Expand Up @@ -38,35 +38,19 @@ Supported Formats
- ``import envcfg.smart.foo as config``:
Try to import each ``FOO_*`` environment variable as JSON body, if fail then import it as string.

There is an example table:

+----------------------+---------------------------+-----------------------+
| Environment Variable | Python Import Statement | Python Variable Value |
+======================+===========================+=======================+
| ``FOO_NAME=foo`` | ``envcfg.raw.foo.NAME`` | ``'foo'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NAME="foo"`` | ``envcfg.raw.foo.NAME`` | ``'"foo"'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1=42`` | ``envcfg.raw.foo.NUM1`` | ``'42'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1="42"`` | ``envcfg.raw.foo.NUM1`` | ``'"42"'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NAME=foo`` | ``envcfg.json.foo.NAME`` | *ImportError* |
+----------------------+---------------------------+-----------------------+
| ``FOO_NAME="foo"`` | ``envcfg.json.foo.NAME`` | ``'foo'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1=42`` | ``envcfg.json.foo.NUM1`` | ``42`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1="42"`` | ``envcfg.json.foo.NUM1`` | ``'42'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NAME=foo`` | ``envcfg.smart.foo.NAME`` | ``'foo'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NAME="foo"`` | ``envcfg.smart.foo.NAME`` | ``'foo'`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1=42`` | ``envcfg.smart.foo.NUM1`` | ``42`` |
+----------------------+---------------------------+-----------------------+
| ``FOO_NUM1="42"`` | ``envcfg.smart.foo.NUM1`` | ``'42'`` |
+----------------------+---------------------------+-----------------------+
There is an example:

+-------------------+------------------------+-------------------------+--------------------------+
| | ``envcfg.raw.foo.VAL`` | ``envcfg.json.foo.VAL`` | ``envcfg.smart.foo.VAL`` |
+===================+========================+=========================+==========================+
| ``FOO_VAL=foo`` | ``'foo'`` | ``ImportError`` | ``'foo'`` |
+-------------------+------------------------+-------------------------+--------------------------+
| ``FOO_VAL="foo"`` | ``'"foo"'`` | ``'foo'`` | ``'foo'`` |
+-------------------+------------------------+-------------------------+--------------------------+
| ``FOO_VAL=42`` | ``'42'`` | ``42`` | ``42`` |
+-------------------+------------------------+-------------------------+--------------------------+
| ``FOO_VAL="42"`` | ``'"42"'`` | ``'42'`` | ``'42'`` |
+-------------------+------------------------+-------------------------+--------------------------+

Examples
--------
Expand Down

0 comments on commit 0ee3d52

Please sign in to comment.