Skip to main content

Pipeline Core

51Degrees Python Pipeline Core

Developer Documentation

Introduction

The Pipeline is a generic web request intelligence and data processing solution with the ability to add a range of 51Degrees and/or custom plug ins (Engines)

This package fiftyone_pipeline_core

This package defines the essential components of the Pipeline API such as flow elements, flow data and evidence. It also packages together JavaScript served by a pipeline and allows for client side requests for additional data populated by evidence from the client side.

It can be used on its own or with the following additional packages.

  • fiftyone_pipeline_engines - Adds a specialized type of flow element called an engine which allows for additional features including an auto-updating data file for properties, a service called when a requested property is missing and a caching system.

Engines created by 51Degrees:

Web integration

The fiftyone_pipeline_core.web module helps use a Pipeline in a Flask web application. webevidence takes the evidence from a request, set_response_header sets the response headers the results ask for, and javascript_response and json_response answer the requests of the client-side JavaScript.

A Flow Data cannot be used by two threads at once. Create one for each request, use it only in the code that handles that request, and close it when the request ends, which a with statement does. To hand work to another thread or task, read the values it needs from the Flow Data first and pass those values, not the Flow Data. The example below does both, with a Pipeline that holds a device detection engine and a concurrent.futures executor.

@app.route("/")
def index():
    with pipeline.create_flowdata() as flowdata:
        flowdata.evidence.add_from_dict(webevidence(request))
        flowdata.process()

        # The other thread gets the browser name, not the Flow Data.
        browser = flowdata.device.browsername
        if browser.has_value():
            executor.submit(record_browser, browser.value())

        response = make_response(render_template("index.html", data=flowdata))
        set_response_header(flowdata, response)
        return response

Element data is reused

Some flow elements reuse their element data from one request to the next. When a flow data is closed, by calling close() or at the end of a with block, its element data goes back to a pool, and a later request gets a copy of it. So read the values you need before the flow data is closed. A reference to element data, such as flowdata.device, that you keep after that raises an exception when you read a property from it, and never gives you another request's values. A value you've already read is unchanged.

Requirements

  • Python 3.8+
  • The flask python library to run the web examples

Find out more

Metadata

Release files for fiftyone-pipeline-core 4.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fiftyone-pipeline-core 4.6.2
File Size Uploaded Provenance Actions
fiftyone_pipeline_core-4.6.2.tar.gz 124.9 kB Without provenance Details for fiftyone_pipeline_core-4.6.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fiftyone-pipeline-core 4.6.2
File Interpreter ABI Platform Actions
fiftyone_pipeline_core-4.6.2-py3-none-any.whl Python 3 none any Details for fiftyone_pipeline_core-4.6.2-py3-none-any.whl

Total release size: 210.1 kB

Release files / fiftyone_pipeline_core-4.6.2.tar.gz

Download URL fiftyone_pipeline_core-4.6.2.tar.gz
Size 124.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4f4e399950d77962d7fe442343ff6cfba00b42a1459b409838bcaaf86182e6bf
BLAKE2b-256 checksum
How to use checksums
951a5c29277ec80b0a80127a96c2ee8d8b28a4e7297e18ba5506fa274a6c34f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / fiftyone_pipeline_core-4.6.2-py3-none-any.whl

Download URL fiftyone_pipeline_core-4.6.2-py3-none-any.whl
Size 85.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a2900547cdd5af0696c347c33d2bb80151dbea67398ca037926a9f2b16a974a
BLAKE2b-256 checksum
How to use checksums
15993dbb2fa82a7602277b9ef95c2f291fa21d36065cc18a4988bb6518cecd7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for fiftyone-pipeline-core 4.6.2

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.

Release history Release notifications | RSS feed

This release

4.6.2 This release

2 release files No provenance

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