Orion Python Client
A lightweight Python client for interacting with Orion Feature Store. This client provides functionality for feature metadata retrieval, protobuf serialization, and Kafka integration. 🚀
This client helps in pushing ML model's features stored in offline sources (like tables, Cloud storage objects in parquet/delta format, etc) to Orion Feature Store
Key Features
- Feature metadata retrieval
- Protobuf serialization of feature values and produce to Apache Kafka
- Support for features of different various data types:
- Scalar types (FP32, FP64, Int32, Int64, UInt32, UInt64, String, Bool)
- Vector types (Vectors of each of the above Scalar Types)
- Kafka integration with configurable settings
📥 Installation
pip install orion-py-client==0.1.1
Prerequisites
- Python 3.7+
- (Optional) Apache Spark 3.0+ & spark-sql-kafka for Kafka feature push functionality
Usage
Basic Usage
from orion_py_client import OrionPyClient
# Initialize the client
client = OrionPyClient(
features_metadata_source_url="your_features_metadata_source_url",
job_id="your_job_id",
job_token="your_job_token"
)
# Get feature details
(
offline_src_type_columns,
offline_col_to_default_values_map,
entity_column_names
) = opy_client.get_features_details()
Push Feature Values from Offline sources to Orion via Spark -> Kafka
Supported Offline Sources
- Table (Hive/Delta)
- Parquet folder stored in Cloud Storage (AWS/GCS/ADLS)
- Delta folder stored in Cloud Storage (AWS/GCS/ADLS)
Refer to the examples for detailed example of how to configure a job and push the feature values
Followng is a simple flow / outline of the steps involved in above example
# create a new orion client
opy_client = OrionPyClient(features_metadata_source_url, job_id, job_token)
# get the features details
feature_mapping, offline_col_to_default_values_map, onfs_fg_to_onfs_feat_map, onfs_fg_to_ofs_feat_map, fg_to_datatype_map, entity_label, entity_column_names = opy_client.get_features_details(fgs_to_consider)
# read the data from different sources
df = get_features_from_all_sources(spark, entity_column_names, feature_mapping, offline_col_to_default_values_map)
# serialize of protobuf binary
proto_df = opy_client.generate_df_with_protobuf_messages(df, intra_batch_size=20)
# Produce data to kafka so that consumers write features to Orion Feature Store
opy_client.write_protobuf_df_to_kafka(proto_df, kafka_bootstrap_servers, kafka_topic, additional_options)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For support, please create an issue
Metadata
Release files for orion-py-client 0.1.17
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 | |
|---|---|---|---|---|
| orion_py_client-0.1.17.tar.gz | 9.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| orion_py_client-0.1.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / orion_py_client-0.1.17.tar.gz
| Download URL | orion_py_client-0.1.17.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
922dd2d0a91bdbcc29ef6c72fa7d6bee9b52abfb3e69fec5e8526d68de820ba7
|
|
BLAKE2b-256 checksum How to use checksums |
d096f76d0b3d1b5892afedb01e039dc29ce46c899510ddc9fab3efd23bd37372
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / orion_py_client-0.1.17-py3-none-any.whl
| Download URL | orion_py_client-0.1.17-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e8ad50acf192a87c11f3341530042139402a057c3ddb383ea59046bf49e9abb
|
|
BLAKE2b-256 checksum How to use checksums |
780d5d56b06e4696122fbf46febd3eb57dd2ee89b36b25d56aa655808cccda15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Security for orion-py-client 0.1.17
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.