Metadata-Version: 2.1
Name: stories
Version: 0.9
Summary: Define a user story in the business transaction DSL
Home-page: https://github.com/proofit404/stories
Author: Artem Malyshev
Author-email: proofit404@gmail.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development


.. |travis| image:: https://travis-ci.org/dry-python/stories.svg?branch=master
    :target: https://travis-ci.org/dry-python/stories

.. |codecov| image:: https://codecov.io/gh/dry-python/stories/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/dry-python/stories

.. |pyup| image:: https://pyup.io/repos/github/dry-python/stories/shield.svg
     :target: https://pyup.io/repos/github/dry-python/stories/

.. |codacy| image:: https://api.codacy.com/project/badge/Grade/bd0a5736bc2f43d6b3fcbf3803d50f9b
    :target: https://www.codacy.com/app/dry-python/stories/

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

.. |docs| image:: https://readthedocs.org/projects/stories/badge/?version=latest
    :target: https://stories.readthedocs.io/en/latest/?badge=latest

.. |gitter| image:: https://badges.gitter.im/dry-python/stories.svg
    :target: https://gitter.im/dry-python/stories

.. image:: https://raw.githubusercontent.com/dry-python/brand/master/logo/stories.png

|travis| |codecov| |pyup| |codacy| |pypi| |docs| |gitter|

----

The business transaction DSL
============================

- `Source Code`_
- `Issue Tracker`_
- `Documentation`_
- `Discussion`_

Installation
------------

All released versions are hosted on the Python Package Index.  You can
install this package with following command.

.. code:: bash

    pip install stories

Usage
-----

``stories`` provide a simple way to define a complex business scenario
that include many processing steps.

.. code:: python

    from stories import story, argument, Success

    class PurchaseProduct:

        @story
        @argument('user')
        @argument('product')
        @argument('shipment_details')
        def purchase(I):

            I.create_order
            I.calculate_price
            I.request_payment
            I.notify_user

        def create_order(self, ctx):

            return Success(order=Order.objects.create(user=ctx.user, product=ctx.product))

        def calculate_price(self, ctx):

            return Success(...

This code style allow you clearly separate actual business scenario
from implementation details.

License
-------

Dependencies library is offered under the two clause BSD license.

.. _source code: https://github.com/dry-python/stories
.. _issue tracker: https://github.com/dry-python/stories/issues
.. _documentation: https://stories.readthedocs.io/en/latest/
.. _discussion: https://gitter.im/dry-python/stories

.. :changelog:

Changelog
---------

0.9 (2018-11-28)
++++++++++++++++

- Enforce ``I`` noun with non callable attributes in the story
  definition.
- ``Context`` is passed as an argument into story step methods.
- Pass real class instances into step method.
- Show story execution path in the ``Context`` representation.
- Add Sentry, Py.test and Django Debug Toolbar plugins with
  ``Context`` reporter built in.
- Raise an exception on ``Failure`` when the story was called
  directly.
- Support iterable protocol in the ``Context`` class.
- Add ``Failure`` reason.
- Fix ``Skip`` result behavior in deeper sub-story hierarchy.

0.8 (2018-05-12)
++++++++++++++++

- Add ``dir()`` and ``repr()`` support to the context class.
- Failed result holds a link to the context.

0.7 (2018-05-06)
++++++++++++++++

- Add ``run`` interface to the story.

0.6 (2018-04-19)
++++++++++++++++

- Representation methods for story, context and point result classes.
- Python 2 support.

0.5 (2018-04-07)
++++++++++++++++

- Do not execute nested stories of the skipped story.

0.4 (2018-04-07)
++++++++++++++++

- Package was rewritten with linearization algorithm.
- ``Skip`` result was added to finish nested stories without finish
  the caller.

0.0.3 (2018-04-06)
++++++++++++++++++

- Nested stories support.

0.0.2 (2018-04-03)
++++++++++++++++++

- Fix class and instance attribute access.
- Validate return values.
- Make context append only.

0.0.1 (2018-04-02)
++++++++++++++++++

- Initial release.


