Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Pythonic redux

Project Description

Pythonic Redux

Pythonic Redux using asyncio. aioredux provides a predictable state container with the following goal: “[Redux] helps you write applications that behave consistently, run in different environments …, and are easy to test” (from the Redux documentation).

  • Free software: Mozilla Public License

This package requires Python 3.4 or higher

Usage

import asyncio
import aioredux

 async def go():
     initial_state = {
         'todos': (),
     }

     def add_todo(text):
         return {'type': 'ADD_TODO', 'text': text}

     def reducer(state, action):
         if action['type'] == 'ADD_TODO':
             todos = state['todos'] + (action['text'],)
             return {'todos': todos}
         return state

     store = yield from aioredux.create_store(reducer, initial_state)
     yield from store.dispatch(add_todo('todo text'))
     print(store.state['todos'])

 asyncio.get_event_loop().run_until_complete(go())

Implementation notes

  • dispatch is marked as async although in most cases it functions like a plain Python function returning a Future. This is done to allow for cases where dispatch performs a more complicated set of (async) actions.
  • A Pythonic version of redux-thunk is also included.
Release History

Release History

This version
History Node

1.1.0

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.3.0

History Node

0.2.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
aioredux-1.1.0-py3-none-any.whl (9.9 kB) Copy SHA256 Checksum SHA256 py3 Wheel Jun 1, 2016
aioredux-1.1.0.tar.gz (14.7 kB) Copy SHA256 Checksum SHA256 Source Jun 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting