Metadata-Version: 2.1
Name: atenvironment
Version: 0.2.0
Summary: Decorator for convenient loading of environment variables
Home-page: https://github.com/eghuro/atenvironment
Author: Alexandr Mansurov
Author-email: alex@eghuro.cz
License: MIT license
Keywords: atenvironment
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System
Classifier: Topic :: Utilities

============
@environment
============


.. image:: https://img.shields.io/pypi/v/atenvironment.svg
        :target: https://pypi.python.org/pypi/atenvironment

.. image:: https://img.shields.io/travis/eghuro/atenvironment.svg
        :target: https://travis-ci.org/eghuro/atenvironment

.. image:: https://readthedocs.org/projects/atenvironment/badge/?version=latest
        :target: https://atenvironment.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status


.. image:: https://pyup.io/repos/github/eghuro/atenvironment/shield.svg
     :target: https://pyup.io/repos/github/eghuro/atenvironment/
     :alt: Updates


.. image:: https://codecov.io/gh/eghuro/atenvironment/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/eghuro/atenvironment



Decorator for convenient loading of environment variables


* Free software: MIT license
* Documentation: https://atenvironment.readthedocs.io.


Getting started
---------------
Install @environment from pip:

   pip install atenvironment


Using @environment is as simple as::

  from atenvironment import environment

  @environment('API_KEY', 'TOKEN')
  def check(a, b, c, key, token):
      # API_KEY is in key
      # TOKEN is in token

Then call the function as::

   check(a, b, c)

Environment variables are checked and provided to the function. In case the token is not in environment an ``atenvironment.EnvironMiss`` exception is raised.


See the docummentation for more details.


=======
History
=======

0.1.0 (2018-06-12)
------------------

* First release on PyPI.

0.2.0 (2018-06-24)
------------------

* on error: optional function to be called if any of the environment tokens in value is not present in environment
* in self: optional variable name in case instance property is to be initialized
* package slightly restructured


