python-decouple
Advanced tools
+11
-4
@@ -11,5 +11,6 @@ # coding: utf-8 | ||
| # Useful for very coarse version differentiation. | ||
| PY3 = sys.version_info[0] == 3 | ||
| PYVERSION = sys.version_info | ||
| if PY3: | ||
| if PYVERSION >= (3, 0, 0): | ||
| from configparser import ConfigParser | ||
@@ -21,2 +22,8 @@ text_type = str | ||
| if PYVERSION >= (3, 2, 0): | ||
| read_config = lambda parser, file: parser.read_file(file) | ||
| else: | ||
| read_config = lambda parser, file: parser.readfp(file) | ||
| DEFAULT_ENCODING = 'UTF-8' | ||
@@ -108,3 +115,3 @@ | ||
| with open(source, encoding=encoding) as file_: | ||
| self.parser.readfp(file_) | ||
| read_config(self.parser, file_) | ||
@@ -135,3 +142,3 @@ def __contains__(self, key): | ||
| if len(v) >= 2 and ((v[0] == "'" and v[-1] == "'") or (v[0] == '"' and v[-1] == '"')): | ||
| v = v.strip('\'"') | ||
| v = v[1:-1] | ||
| self.data[k] = v | ||
@@ -138,0 +145,0 @@ |
+13
-13
| Metadata-Version: 1.1 | ||
| Name: python-decouple | ||
| Version: 3.4 | ||
| Version: 3.5 | ||
| Summary: Strict separation of settings from code. | ||
@@ -41,3 +41,3 @@ Home-page: http://github.com/henriquebastos/python-decouple/ | ||
| Web framework's settings stores many different kinds of parameters: | ||
| The settings files in web frameworks store many different kinds of parameters: | ||
@@ -50,3 +50,3 @@ * Locale and i18n; | ||
| The first 2 are *project settings* the last 3 are *instance settings*. | ||
| The first 2 are *project settings* and the last 3 are *instance settings*. | ||
@@ -108,3 +108,3 @@ You should be able to change *instance settings* without redeploying your app. | ||
| Since `config` is lazy and only opens the configuration file when it's first needed, you have the chance to change | ||
| it's encoding right after import. | ||
| its encoding right after import. | ||
@@ -117,3 +117,3 @@ .. code-block:: python | ||
| If you wish to fallback to your system's default encoding do: | ||
| If you wish to fall back to your system's default encoding use: | ||
@@ -127,3 +127,3 @@ .. code-block:: python | ||
| Where the settings data are stored? | ||
| Where is the settings data stored? | ||
| ----------------------------------- | ||
@@ -153,3 +153,3 @@ | ||
| Simply create a ``.env`` text file on your repository's root directory in the form: | ||
| Simply create a ``.env`` text file in your repository's root directory in the form: | ||
@@ -168,3 +168,3 @@ .. code-block:: console | ||
| Given that I have a ``.env`` file at my repository root directory, here is a snippet of my ``settings.py``. | ||
| Given that I have a ``.env`` file in my repository's root directory, here is a snippet of my ``settings.py``. | ||
@@ -212,4 +212,4 @@ I also recommend using `pathlib <https://docs.python.org/3/library/pathlib.html>`_ | ||
| On the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value to fallback if it does not exist on the ``.env`` file. | ||
| In the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value in case it does not exist in the ``.env`` file. | ||
@@ -235,4 +235,4 @@ If ``SECRET_KEY`` is not present in the ``.env``, *decouple* will raise an ``UndefinedValueError``. | ||
| How it works? | ||
| ============= | ||
| How does it work? | ||
| ================= | ||
@@ -243,3 +243,3 @@ *Decouple* always searches for *Options* in this order: | ||
| #. Repository: ini or .env file; | ||
| #. default argument passed to config. | ||
| #. Default argument passed to config. | ||
@@ -246,0 +246,0 @@ There are 4 classes doing the magic: |
| Metadata-Version: 1.1 | ||
| Name: python-decouple | ||
| Version: 3.4 | ||
| Version: 3.5 | ||
| Summary: Strict separation of settings from code. | ||
@@ -41,3 +41,3 @@ Home-page: http://github.com/henriquebastos/python-decouple/ | ||
| Web framework's settings stores many different kinds of parameters: | ||
| The settings files in web frameworks store many different kinds of parameters: | ||
@@ -50,3 +50,3 @@ * Locale and i18n; | ||
| The first 2 are *project settings* the last 3 are *instance settings*. | ||
| The first 2 are *project settings* and the last 3 are *instance settings*. | ||
@@ -108,3 +108,3 @@ You should be able to change *instance settings* without redeploying your app. | ||
| Since `config` is lazy and only opens the configuration file when it's first needed, you have the chance to change | ||
| it's encoding right after import. | ||
| its encoding right after import. | ||
@@ -117,3 +117,3 @@ .. code-block:: python | ||
| If you wish to fallback to your system's default encoding do: | ||
| If you wish to fall back to your system's default encoding use: | ||
@@ -127,3 +127,3 @@ .. code-block:: python | ||
| Where the settings data are stored? | ||
| Where is the settings data stored? | ||
| ----------------------------------- | ||
@@ -153,3 +153,3 @@ | ||
| Simply create a ``.env`` text file on your repository's root directory in the form: | ||
| Simply create a ``.env`` text file in your repository's root directory in the form: | ||
@@ -168,3 +168,3 @@ .. code-block:: console | ||
| Given that I have a ``.env`` file at my repository root directory, here is a snippet of my ``settings.py``. | ||
| Given that I have a ``.env`` file in my repository's root directory, here is a snippet of my ``settings.py``. | ||
@@ -212,4 +212,4 @@ I also recommend using `pathlib <https://docs.python.org/3/library/pathlib.html>`_ | ||
| On the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value to fallback if it does not exist on the ``.env`` file. | ||
| In the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value in case it does not exist in the ``.env`` file. | ||
@@ -235,4 +235,4 @@ If ``SECRET_KEY`` is not present in the ``.env``, *decouple* will raise an ``UndefinedValueError``. | ||
| How it works? | ||
| ============= | ||
| How does it work? | ||
| ================= | ||
@@ -243,3 +243,3 @@ *Decouple* always searches for *Options* in this order: | ||
| #. Repository: ini or .env file; | ||
| #. default argument passed to config. | ||
| #. Default argument passed to config. | ||
@@ -246,0 +246,0 @@ There are 4 classes doing the magic: |
+12
-12
@@ -33,3 +33,3 @@ Python Decouple: Strict separation of settings from code | ||
| Web framework's settings stores many different kinds of parameters: | ||
| The settings files in web frameworks store many different kinds of parameters: | ||
@@ -42,3 +42,3 @@ * Locale and i18n; | ||
| The first 2 are *project settings* the last 3 are *instance settings*. | ||
| The first 2 are *project settings* and the last 3 are *instance settings*. | ||
@@ -100,3 +100,3 @@ You should be able to change *instance settings* without redeploying your app. | ||
| Since `config` is lazy and only opens the configuration file when it's first needed, you have the chance to change | ||
| it's encoding right after import. | ||
| its encoding right after import. | ||
@@ -109,3 +109,3 @@ .. code-block:: python | ||
| If you wish to fallback to your system's default encoding do: | ||
| If you wish to fall back to your system's default encoding use: | ||
@@ -119,3 +119,3 @@ .. code-block:: python | ||
| Where the settings data are stored? | ||
| Where is the settings data stored? | ||
| ----------------------------------- | ||
@@ -145,3 +145,3 @@ | ||
| Simply create a ``.env`` text file on your repository's root directory in the form: | ||
| Simply create a ``.env`` text file in your repository's root directory in the form: | ||
@@ -160,3 +160,3 @@ .. code-block:: console | ||
| Given that I have a ``.env`` file at my repository root directory, here is a snippet of my ``settings.py``. | ||
| Given that I have a ``.env`` file in my repository's root directory, here is a snippet of my ``settings.py``. | ||
@@ -204,4 +204,4 @@ I also recommend using `pathlib <https://docs.python.org/3/library/pathlib.html>`_ | ||
| On the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value to fallback if it does not exist on the ``.env`` file. | ||
| In the above example, all configuration parameters except ``SECRET_KEY = config('SECRET_KEY')`` | ||
| have a default value in case it does not exist in the ``.env`` file. | ||
@@ -227,4 +227,4 @@ If ``SECRET_KEY`` is not present in the ``.env``, *decouple* will raise an ``UndefinedValueError``. | ||
| How it works? | ||
| ============= | ||
| How does it work? | ||
| ================= | ||
@@ -235,3 +235,3 @@ *Decouple* always searches for *Options* in this order: | ||
| #. Repository: ini or .env file; | ||
| #. default argument passed to config. | ||
| #. Default argument passed to config. | ||
@@ -238,0 +238,0 @@ There are 4 classes doing the magic: |
+1
-1
@@ -9,3 +9,3 @@ # coding: utf-8 | ||
| setup(name='python-decouple', | ||
| version='3.4', | ||
| version='3.5', | ||
| description='Strict separation of settings from code.', | ||
@@ -12,0 +12,0 @@ long_description=open(README).read(), |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
58747
0.39%235
1.73%