Skip to main content

Pythonic redux

Project description

pypi version travis-ci build status pypi download statistics

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


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'))


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.

Project details

Download files

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

Built Distribution

aioredux-1.0.3-py3-none-any.whl (9.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page