Package: gridder-rest
Gridder-RESTA REST-ful API forGridder.
Generate grids or tiles over existing images or as stand-alone images.UsageServerSet up a server and runmain.pyto be able to receive requests.Be sure to create a directory namedoutputat the same level as the main script.NOTE:Gridder-REST stores the uploaded images and the prepared images before
sending them back to the user, but no clean up occurs. It is the responsibility
of the server to clean up the directory of all the png files created by
Gridder-REST.ClientSend a request containing, at a minimum, thesizeparameter, to one of the
available endpoints (see below) depending on the desired shape of the grid.See below for a list of allowed and required parameters.MethodsRequests can be made with two possible methods:GETGET requests create brand-new images. In addition to thesizeparameter,widthandheightparameters are required to determine the size of the output.POSTPOST requests draw grids over pre-existing images. In addition to thesizeparameter, the base image to draw on must be provided in the form-data under thebasekey.EndpointsRequests with the allowed methods and parameters must be sent to one of the
following endpoints.All endpoints accept GET and POST methods, with the exception of the/index endpoint, which only accepts GET./Provides basic usage instructions./squareA square grid. Thesizeparameter equals the side of the square./vlineA grid of vertical lines. Thesizeparameter equals the distance between
the lines./hlineA grid of horizontal lines. Thesizeparameter equals the distance between
the lines./vhexA grid of hexagonal tiles arranged vertically (with top and bottom being flat).
Thesizeparameter equals the height of each hex./hhexA grid of hexagonal tiles arranged horizontally (with left and right being flat).
Thesizeparameter equals the width of each hex.ParametersAll parameters are optional except forsizeand, for GET method,widthandheight.Where applicable, measures can be entered in centimetres, millimetres or inches by
appendingcm,mmorinto the amount.sizeDetermines the size of the grid. For details, refer to specific endpoints.height,widthHeight and width of the output image. Only allowed with GET method.bgcolColour of the background of the image. Can be a colour name or hexadecimal colour
value like#000000. Only allowed with GET method.gridcolColour of the line used to draw the grid.padding,pt,pr,pb,plPadding around the grid, before the image bounds.Options for specific padding on the toppt, rightpr, bottompband leftplmargins are available and, if present, have priority over the genericpaddingoption.lineLine width of the lines used to draw the grid.nameName of the output file. If an extension other than png is entered, it is used as
part of the file name: the output will always be in png format.Response codes200 OKEverything went as expected and appropriate output was produced.400 Bad RequestA POST request was made without correctly including the base file.415 Unsupported Media TypeA POST request was made using a base file in a format unreadable by the backend.
Convert the file to a more common format and retry.422 Unprocessable EntityOne or more required parameter are missing or were provided in unreadable form.500 Server ErrorSomething went wrong with the backend. Please contact the author providing details
on what you tried so the problem may be fixed, if it's due to a bug.