Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Hyped Serve Extension

Tests Linting Coverage Status PyPi version PyPi license

Serve hyped data flows as REST APIs

Installation

You can install the add-on directly from PyPI using pip:

pip install hyped-extensions-serve

Getting Started

Hyped serve leverages the power of FastAPI to create a robust serving environment.

To get started, simply define your data pipeline and its expected input features in a Python script, and then serve it using hyped-extensions-serve.

Here's a basic example:

# app.py
from hyped import DataFlow
from hyped.typing import Mapping, Int
from hyped.extensions.serve import HypedAPI

# Define your input schema
class Inputs(Mapping):
    x: Int

# Define your data flow
flow = DataFlow[Inputs]()
flow = flow.build(collect={"y": flow.source["x"] * 2})

# Create the app to be served
app = HypedAPI().serve_flow(flow, prefix="/")

Once you've defined your app, you can serve it using uvicorn:

uvicorn app:app --host 0.0.0.0 --port 80

This will start the server, allowing you to interact with your data pipeline via HTTP requests.

Endpoints

The Hyped Serve API provides the following endpoints for interacting with your data pipeline:

Endpoint Method Description
/health GET Simple health check always returns "ok" and code 200.
/readiness GET Simple readiness check always returns "ok" and code 200.
<prefix>/readiness GET Readiness check to determine if the flow is ready to receive requests.
<prefix>/apply POST Apply the data flow to a single example. Expects a single example in JSON format.
<prefix>/batch POST Apply the data flow to a batch of data. Expects a list of examples.

Additionally, a Swagger UI API documentation is available at /docs.

Serving multiple Data Pipes

The serving environment also supports serving multiple data pipes simultaneously. You can configure this by providing multiple data pipes and their respective features.

# app.py

app = (
    HypedAPI()
    .serve_flow(flowA, prefix="/A")
    .serve_flow(flowB, prefix="/B")
)

This example demonstrates serving two different data pipes (pipe_one and pipe_two) with their corresponding features, each accessible via different prefixes (/one and /two).

Running Tests

Hyped Serve includes a suite of tests to ensure its functionality. You can run these tests using pytest:

pytest tests

Ensure that you have pytest installed in your environment. You can install it via pip:

pip install pytest

Running the tests will execute various test cases to validate the behavior of Hyped Serve.

License

tbd

Download files

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

Source Distribution

hyped_extensions_serve-0.1.0a0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

hyped_extensions_serve-0.1.0a0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file hyped_extensions_serve-0.1.0a0.tar.gz.

File metadata

  • Download URL: hyped_extensions_serve-0.1.0a0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hyped_extensions_serve-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 d24a0e019a383d738d970fbfa9b3e6a30e2bcf7662b8b8222eed4208de6afe57
MD5 73d1f9d7c2e042aab0cca536b6c4f57b
BLAKE2b-256 d386f076b74d9d3b1973c0603bdb753260467b81a760a244a611e41c1a60d094

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyped_extensions_serve-0.1.0a0.tar.gz:

Publisher: publish.yml on open-hyped/hyped-extensions-serve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hyped_extensions_serve-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for hyped_extensions_serve-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 90b6f4a95065f5fcbd2d26f65dae4ceb58842bde624adc0cd113dd509cc47ef2
MD5 245997c6c85960ae3e471e70412cf426
BLAKE2b-256 440237f189eaf9896de0ef23eef8a3562fb4971d30b742d771738ea8b85d5a36

See more details on using hashes here.

Provenance

The following attestation bundles were made for hyped_extensions_serve-0.1.0a0-py3-none-any.whl:

Publisher: publish.yml on open-hyped/hyped-extensions-serve

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0a0 This release

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