polars-streaming
This library helps to process streaming data using Polars.
Installation
pip install polars-streaming
Install from sources
Alternatively, you can also clone the latest version from the repository and install it directly from the source code:
pip install -e .
Quick tour
Socket
>>> from polars_streaming import StreamProcessor
>>> s = StreamProcessor()
>>> s.readStream.format('socket').options({'host':'localhost','port':12345}).load()
>>> def transformation(df):
>>> # Add your transformation code here
>>> df = df.sum() # For example purpose, I am calculating the sum.
>>> return df # Return the transformed dataframe
>>> s.add_transform(transformation)
>>> s.writeStream.format('console').trigger('3 seconds')
>>> s.start()
Kafka
>>> from polars_streaming import StreamProcessor
>>> s = StreamProcessor()
>>> s.readStream.format('kafka').options({'kafka.bootstrap.servers':'localhost','subscribe': 'topic_name',
'startingOffsets': 'earliest',
'kafka.group.id': 'g1'}).load()
>>> def transformation(df):
>>> # Add your transformation code here
>>> df = df.sum() # For example purpose, I am calculating the sum.
>>> return df # Return the transformed dataframe
>>> s.add_transform(transformation)
>>> s.writeStream.format('console').trigger('10 seconds')
>>> s.start()
File Sources
>>> from polars_streaming import StreamProcessor
>>> s = StreamProcessor()
>>> s.readStream.format('csv').load('read_path_of_file_source') # Reads the csv file from the path once it is created
>>> def transformation(df):
>>> # Add your transformation code here
>>> df = df.sum() # For example purpose, I am calculating the sum.
>>> return df # Return the transformed dataframe
>>> s.add_transform(transformation)
>>> s.writeStream.option('path','write_path').format('avro') # Write the processed data to the write path in avro format
>>> s.start()
Sources
- Socket
- File Sources
- CSV
- JSON
- AVRO
- PARQUET
- Kafka
Sinks
- Console
- File Sources
- CSV
- JSON
- AVRO
- PARQUET
- MongoDB
- ElasticSearch
Metadata
Release files for polars-streaming 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polars-streaming-0.3.0.tar.gz | 15.6 kB | Without provenance | Details for polars-streaming-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polars_streaming-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for polars_streaming-0.3.0-py3-none-any.whl |
Total release size: 33.6 kB
Release files / polars-streaming-0.3.0.tar.gz
| Download URL | polars-streaming-0.3.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2e69b5a737b65f1d5c12b180870e34a8fba9da076d0ad335b7603dc407e306b
|
|
BLAKE2b-256 checksum How to use checksums |
a8a9d132a3cc42c41b7038661eb27a1e121a2c508c9bfee0b075aed7a6055e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.16
|
Release files / polars_streaming-0.3.0-py3-none-any.whl
| Download URL | polars_streaming-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea7c59eef153b4add113286e9160930a63ebe76a17cd712e92a3c5f40e93507e
|
|
BLAKE2b-256 checksum How to use checksums |
0a6d24ec1bb746770a6669b6db5315df76aa770323508aa2b42cee5584059b07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.16
|
Security for polars-streaming 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.