Skip to main content

Start your own Algo provider from a Python function, interface it DebiAI or something else

Project description

Algo Provider Python module

License

This Algo-Provider Python module allows you to easily deploy your own algorithm through the Algo Provider API.

What is an Algo Provider?

An Algo Provider is a service that provides algorithms to be used by different applications such as (DebiAI)[https://debiai.irt-systemx.fr/dashboard/algoProviders/] or any other application that uses the Algo Provider API.

Creating an algo-provider requires to create a server, it requires some skills and a lot of time.

The goal of this project is to create a new solution that makes it easier to start an algo-provider, without the need for Docker or advanced developer skills. The targets are Data Scientists that want to use their algorithms with DebiAI.

Getting started

Install the module with pip:

pip install algo-provider

Then, create a Python file with the following content:

# First define your algorithm following a strict docstring format
def my_algo1(input1: int, input2: int) -> int:
    """
    This is a simple algorithm that adds two numbers together.

    Parameters:
        input1 (int): The first number to add.
        input2 (int): The second number to add.

    Returns:
        int: The sum of the two numbers.
    """
    return input1 + input2

# Then create an AlgoProvider object and add your algorithm to it
from algo_provider import AlgoProvider
provider = AlgoProvider()
provider.add_algo(my_algo1)

# Finally, start the server
provider.start_server()

Run the Python file and your algorithm is now available through the Algo Provider API!

Expected output

The content of the docstring will be used to generate Algo descriptions in the DebiAI interface, and the function will be called with the parameters provided by the user. The return value will be sent back to the user and displayed in the DebiAI interface.

Parameters

You can specify the following parameters when adding an algorithm:

provider.add_algo(
    my_algo_3,
    author="DebiAI",
    version="1.0.0",
    creation_date="2024-01-01",
    update_date="2024-01-01",
    tags=["Math", "Addition"],
)

Project details


Download files

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

Source Distribution

algo-provider-1.0.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

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

algo_provider-1.0.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file algo-provider-1.0.1.tar.gz.

File metadata

  • Download URL: algo-provider-1.0.1.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for algo-provider-1.0.1.tar.gz
Algorithm Hash digest
SHA256 502d419bee0384ca85cad2dfb290fe987901be3610b93b35e67877db21fe748c
MD5 588d02d56bcd40ce27a2fb38a85c47da
BLAKE2b-256 1f7560d0ee87b65a794b729f9fd3ead35ff9a2ca88d77ca9ecc13cbb38ef6b6d

See more details on using hashes here.

File details

Details for the file algo_provider-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: algo_provider-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for algo_provider-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b19aa454a7ae45cb543046de06fe313b3be511cbceaa1b452ff31ed61b3097
MD5 b874515a679587734099d58f9551b56b
BLAKE2b-256 7325a9b4f6451f6e5fbbbb3fa8ca7414f8a0c089625f7137a263d02fc789cd8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page