Skip to main content
https://github.com/ReactiveX/RxPY/workflows/Python%20package/badge.svg https://img.shields.io/coveralls/ReactiveX/RxPY.svg https://img.shields.io/pypi/v/rx.svg Documentation Status

A library for composing asynchronous and event-based programs using observable collections and query operator functions in Python

RxPY v3.0

For v1.X please go to the v1 branch.

RxPY v3.x runs on Python 3.6 or above. To install RxPY:

pip3 install rx

About ReactiveX

Reactive Extensions for Python (RxPY) is a set of libraries for composing asynchronous and event-based programs using observable sequences and pipable query operators in Python. Using Rx, developers represent asynchronous data streams with Observables, query asynchronous data streams using operators, and parameterize concurrency in data/event streams using Schedulers.

import rx
from rx import operators as ops

source = rx.of("Alpha", "Beta", "Gamma", "Delta", "Epsilon")

composed = source.pipe(
    ops.map(lambda s: len(s)),
    ops.filter(lambda i: i >= 5)
)
composed.subscribe(lambda value: print("Received {0}".format(value)))

Learning RxPY

Read the documentation to learn the principles of RxPY and get the complete reference of the available operators.

If you need to migrate code from RxPY v1.x, read the migration section.

There is also a list of third party documentation available here.

Community

Join the conversation on Slack!

The gracious folks at PySlackers have given us a home in the #rxpy Slack channel. Please join us there for questions, conversations, and all things related to RxPy.

To join, navigate the page above to receive an email invite. After signing up, join us in the #rxpy channel.

Please follow the community guidelines and terms of service.

Differences from .NET and RxJS

RxPY is a fairly complete implementation of Rx with more than 120 operators, and over 1300 passing unit-tests. RxPY is mostly a direct port of RxJS, but also borrows a bit from RxNET and RxJava in terms of threading and blocking operators.

RxPY follows PEP 8, so all function and method names are lowercase with words separated by underscores as necessary to improve readability.

Thus .NET code such as:

var group = source.GroupBy(i => i % 3);

need to be written with an _ in Python:

group = source.pipe(ops.group_by(lambda i: i % 3))

With RxPY you should use named keyword arguments instead of positional arguments when an operator has multiple optional arguments. RxPY will not try to detect which arguments you are giving to the operator (or not).

Metadata

Release files for Rx 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Rx 3.2.0
File Size Uploaded
Rx-3.2.0.tar.gz 105.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Rx 3.2.0
File Interpreter ABI Platform
Rx-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 304.8 kB

Release files / Rx-3.2.0.tar.gz

Download URL Rx-3.2.0.tar.gz
Size 105.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b657ca2b45aa485da2f7dcfd09fac2e554f7ac51ff3c2f8f2ff962ecd963d91c
BLAKE2b-256 checksum
How to use checksums
34b5e0f602453b64b0a639d56f3c05ab27202a4eec993eb64d66c077c821b621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

Release files / Rx-3.2.0-py3-none-any.whl

Download URL Rx-3.2.0-py3-none-any.whl
Size 199.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
922c5f4edb3aa1beaa47bf61d65d5380011ff6adcd527f26377d05cb73ed8ec8
BLAKE2b-256 checksum
How to use checksums
e2a9efeaeca4928a9a56d04d609b5730994d610c82cf4d9dd7aa173e6ef4233e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.1

2 release files

3.1.0

1 release file

3.0.1

2 release files

3.0.0

2 release files

1.6.3

1 release file

1.6.1

2 release files

1.6.0

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.2.6

2 release files

1.2.5

1 release file

1.2.4

2 release files

1.2.3

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page