Python tool for completion time analysis of batch pizza orders
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file DomApi-1.7.0.tar.gz
.
File metadata
- Download URL: DomApi-1.7.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1cef89377f4261a0bc49b46160ed55a4644a07c9519914845b4ce96427b1d19 |
|
MD5 | 514422d4d5e799548863cab074fb8406 |
|
BLAKE2b-256 | 51550bb5f27241c060f68bc355326f1d9404a36f6ad90c0750ce811d49fb8ebb |
File details
Details for the file DomApi-1.7.0-py3-none-any.whl
.
File metadata
- Download URL: DomApi-1.7.0-py3-none-any.whl
- Upload date:
- Size: 14.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ceeb88dc31650e7b2e689909add69f5dd9419ec2361b64566c6988cb6dea879 |
|
MD5 | d4df4072f343bedb08de8589298adebe |
|
BLAKE2b-256 | baa48c71fe9791d713953dde7d3eb39547c85915832cdfac6b7c0626bb0b8afe |