Skip to main content

Define a user story in the business transaction DSL

Project description

travis codecov pyup codacy pypi docs gitter

The business transaction DSL


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

pip install stories


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

from stories import story, argument, Success

class PurchaseProduct:

    def purchase(I):


    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.


Dependencies library is offered under the two clause BSD license.


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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
stories-0.9-py2-none-any.whl (13.4 kB) Copy SHA256 hash SHA256 Wheel py2
stories-0.9-py3-none-any.whl (12.6 kB) Copy SHA256 hash SHA256 Wheel py3
stories-0.9.tar.gz (9.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page