Skip to main content

Python tool for completion time analysis of batch pizza orders

Reason this release was yanked:

deprecated folders present in wheel file

Project description

The Dom API provides a utility for quickly computing order completion times based on order volume and available staff, published through a RESTful interface.

Installing

$ pip install domapi
$ python -m DomApi.rest_wrapper 

Open an incognito browser to http://localhost:8080

Using DomApi

As an OpenAPI-compliant service, the DomApi can be consumed easily by using open-source tools to create client applications in the language of your choice. One such tool is the open source PySwagger package for python.

Alternatively, the service metadata, linked directly beneath the title on the homepage of the service UI, can be imported into the Swagger Editor online utility, which is capable of generating clients in over 50 languages. This metadata is found at http://localhost:8080/swagger.json, if the setup instructions above are followed.

Configuration

This application is designed with a number of configurable values. Given that it's targeted towards a Docker-based runtime environment, it is designed to consume these settings through environment variables within the guest OS.

To make your custom setting visible to the application, set an environment variable using the following scheme:

{appEnvPrefix}{VARIABLE_NAME}=VALUE

For example, to override the "validateOrder" value, set an environment variable named "DOM_API_VALIDATEORDER" (note the use of ALL UPPERCASE).

for Windows, this would look like:

> SET DOM_API_VALIDATEORDER=FALSE

, or for Linux, this would look like:

$ export DOM_API_VALIDATEORDER="FALSE"

Application Variables

Name Type Default Value Description
appEnvPrefix string "DOM_API_" This prefix should be added to all environment variables intended for injection into the service. It cannot be modified at runtime.
apiUrlPrefix string "" This variable can be used to change the root URL of the API. This is useful in situations where multiple services are being aggregated under a single hostname, such as a microservice cluster in Kubernetes with a single ingress. A sample value could be: "/domapi"
apiVersion string "{CURRENT_VERSION}" Sets the version of the API that's published through the interface in through the metadata.
apiTitle string "Dom Order API" Sets the title of the API that's published through the interface in through the metadata.
apiDescription string "" Sets the description of the API that's published through the interface in through the metadata.
validateOrder boolean True Each submission is checked for schema validation prior to processing. This is critical for error management in an environment where there are a variety of consumers for the service, but in a tightly controlled development environment, it may be possible to set this value to False, and safely skip the validation to gain some performance.
orderMakeTimeSeconds integer 120 The time in seconds required to assemble a single pizza.
allowEmployeeOverTime boolean False This value used for testing, not intended for production.
preSortOrders boolean True If orders can be guaranteed to come in pre-sorted chronologically, then a slight gain in performance may be achieved by setting this value to False, and bypassing the initial sort of submitted orders.
loggingLevel string "WARNING" Logging level for the application, can take on one of the following values: {NOTSET,INFO,DEBUG,WARNING,ERROR,CRITICAL}
smtpLoggingEnabled boolean False This application features global exception monitoring; this setting, in conjunction with the next four, enables application exceptions to the reflected back to a mailbox for simple alerting. note: there is no authentication specified, so any MTA specified below will need to behave as an open relay for this service.
smtpServer boolean "" SMTP Logging: mail server hostname or IP address
smtpServerPort boolean 25 SMTP Logging: mail server port
smtpSource string "" SMTP Logging: source email address
smtpRecipient string "" SMTP Logging: recipient email address

License

DomApi is freely distributable under the terms of the MIT license.

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

DomApi-1.6.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

DomApi-1.6.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file DomApi-1.6.0.tar.gz.

File metadata

  • Download URL: DomApi-1.6.0.tar.gz
  • Upload date:
  • Size: 14.3 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.7

File hashes

Hashes for DomApi-1.6.0.tar.gz
Algorithm Hash digest
SHA256 cd2c064ad255d293918b3d0f86f68cc9b82578d15fe5a24d52811f59db551c3f
MD5 6eaba184118cc86dd55e82f8519e4d5c
BLAKE2b-256 bca6cd39fe19dc293e5cd560a96b3ddc9810a35a7acc742725593e815c4310b9

See more details on using hashes here.

File details

Details for the file DomApi-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: DomApi-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • 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.7

File hashes

Hashes for DomApi-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6405e53c9ffa1a71491e278482105e85c4feb0df9fad6735377720f82818fee
MD5 be7cc1c0a9df6e22010b3ff3a436aa75
BLAKE2b-256 67a6be868dc92db92282722d4fe9c2fd06865cb92b922114ea675c036ed7ac99

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