Skip to main content

Generate opyrator UIs and webservices and docker containers from python functions

Project description

opyratorfront

Generate opyrator UIs and webservices and docker containers from python functions

To install: pip install opyratorfront

What it's about

opyrator

(From the readme of opyrator):

opyrator allows us to write code like this:

from pydantic import BaseModel

class Input(BaseModel):
    message: str

class Output(BaseModel):
    message: str

def hello_world(input: Input) -> Output:
    """Returns the `message` of the input data."""
    return Output(message=input.message)

Putting this in a file named my_opyrator.py and running

opyrator launch-ui my_opyrator:hello_world

from the command-line, we can get a web UI that looks like this:

image

Not only that, we can also get the underlying webservice, along with an openAPI specification of the latter, by doing this:

opyrator launch-api my_opyrator:hello_world

And more!

opyratorfront

We have tools (namely py2dash and streamlitfront ) to get from a set of functions to a web UI.

Now streamlitfront, like opyrator, uses streamlit to make a UI from python, but streamlit doesn't provide a way to remove the UI concern and only use the underlying web-service independently. (Though there's interest in this.) opyrator not only offers that possibility, but also many other desirable "dispatches".

That said, opyrator doesn't come with all the boilerplate minimized multi-function get-from-python-functions-to-a-ui-wrapper stuff we'd want. So we made opyratorfront to try to get the best of both worlds.

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

opyratorfront-0.1.1.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file opyratorfront-0.1.1.tar.gz.

File metadata

  • Download URL: opyratorfront-0.1.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for opyratorfront-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c57eb736642483fb5091ac3cf10ea71a5309a69c02a1c9b34c5b9ffc8e8ab4a3
MD5 f007192692640d3063f9c724b55fac10
BLAKE2b-256 7296e1bb67c9a0330939acb174efed4d8522f58e8d79f7ef26c07fea3c38f0b2

See more details on using hashes here.

Supported by

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