Skip to main content

Simple Reactive Extensions (Rx) for Python

Project description

=========
RexPython
=========

This is Reactive Extensions (Rx) for Python implementation mimicing RxJava2 API as far as it can.
It is LINQ free btw. The goal to make it hackable on the go.

https://github.com/chexov/rexpython


Installation
============
pip install rexpython

=====
Usage
=====
import rexpython as rx

def on_subscribe(emitter):
emitter.setDisposable(ActionDisposable(lambda: sys.stdout.write("disposed")))

print ("subscribed")
for i in xrange(1, 3):
emitter.onNext(i)
time.sleep(1)

# emitter.onError(Exception("foo"))
emitter.onComplete()

frames = rx.Observable.create(lambda emitter: on_subscribe(emitter, video_url, 2))
mat_img = frames.map(featureextractor.FeatureExtractor.preprocess_image)
vect = mat_img.map(lambda img: fe.get_activations([img]))
words = vect.map(lambda vec: d.getWordsForBatch(vec, 40)) \
.flatMap(lambda wlist: rx.Observable.from_(wlist))
words = words.doOnNext(lambda w: log.info("words=%s" % w)).doOnError(lambda err: log.error("ERRRORRR %s" % err))
value = words.toList().blockingGet()

Project details


Download files

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

Source Distribution

rexpython-0.1.8.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file rexpython-0.1.8.tar.gz.

File metadata

  • Download URL: rexpython-0.1.8.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rexpython-0.1.8.tar.gz
Algorithm Hash digest
SHA256 cb2d7c70895c46b690fee9f717f2eeaa8bf1fc00fe558eaca077a115b9ca7d7c
MD5 0432444be79820d8a3253fb39f856b71
BLAKE2b-256 80dfc9e2919377f7c94bd7ad7eb0bf315f0a4d21f96bcbeaabc83f3d1b527658

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page