Skip to main content

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

  1. Table (Hive/Delta)
  2. Parquet folder stored in Cloud Storage (AWS/GCS/ADLS)
  3. 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

Download files

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

Source Distribution

orion_py_client-0.1.15.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orion_py_client-0.1.15-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file orion_py_client-0.1.15.tar.gz.

File metadata

  • Download URL: orion_py_client-0.1.15.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for orion_py_client-0.1.15.tar.gz
Algorithm Hash digest
SHA256 13c77b50f471f05e97ff3469f653fadcc39ecbe1c6897099163343df32904371
MD5 5a8f9a04ac43d2ab62c986fde03fab89
BLAKE2b-256 f377709c7179c3d4a7223c0f1e4e7ab9c9ca883c0dd5e71ca209682117d6717d

See more details on using hashes here.

File details

Details for the file orion_py_client-0.1.15-py3-none-any.whl.

File metadata

File hashes

Hashes for orion_py_client-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 ff17602d1a70cd4e44cf421e25349beaa931745822a26a5dc02c800bf5405064
MD5 b9cd02d051e5f24398280a0222869768
BLAKE2b-256 7fad8e06b2d825a2d1ebbbc875541abbb38f56d9c1fbf7ffc46614e10b8fb2ef

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.17

2 files

0.1.16

2 files

This release

0.1.15 This release

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

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