Skip to content

Commit

Permalink
Docs updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Oct 21, 2017
1 parent a05e1c5 commit 71a5d4d
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 4 deletions.
32 changes: 31 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,37 @@ Description

*Detect environment type and work within*

Here will be an introductory description.

Features
~~~~~~~~

* Environment type detection (extendable system);
* Convenient ``os.environ`` proxying.


Code sample
~~~~~~~~~~~

.. code-block:: python
from envbox import get_environment
# Detect current environment type
# and get its object.
env = get_environment()
env.name
# >> development
env.is_production
# >> False
env.get('HOME')
# The same as env['HOME'] and env.HOME
# >> /home/idle/
env.getmany('PYTHON')
# {'UNBUFFERED': '1', 'IOENCODING': 'UTF-8', 'PATH': ...}
Expand Down
26 changes: 26 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
API
===


Basic
-----

.. automodule:: envbox.base
:members:
:inherited-members:


Environments
------------

.. automodule:: envbox.envs
:members:
:inherited-members:


Environment detection
---------------------

.. automodule:: envbox.detectors
:members:
:inherited-members:
9 changes: 7 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Description

*Detect environment type and work within*

Here will be an introductory description.
Features
~~~~~~~~

* Environment type detection (extendable system);
* Convenient ``os.environ`` proxying.



Expand All @@ -24,8 +28,9 @@ Table of Contents
-----------------

.. toctree::
:maxdepth: 2
:maxdepth: 3

quickstart
api


39 changes: 38 additions & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
Quickstart
==========

Here will be a short and basic usage sample.

Basic usage
~~~~~~~~~~~

.. code-block:: python
from envbox import get_environment
# Let's detect current environment type and get its object.
# * See and use arguments to impose restrictions upon detection system.
env = get_environment()
env.name
# >> development
env.is_production
# >> False
env.get('HOME')
# The same as env['HOME'] and env.HOME
# >> /home/idle/
env.getmany('PYTHON')
# {'UNBUFFERED': '1', 'IOENCODING': 'UTF-8', 'PATH': ...}
Environment type aliases
~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python
from envbox import get_environment, PRODUCTION
# Let's make `prod` string identify production environment.
register_type(PRODUCTION, alias='prod')
# Now if someone has used `prod`
# we correctly identify it as production environment.
get_environment().is_production # True

0 comments on commit 71a5d4d

Please sign in to comment.