snip.api.snippets¶
Interface with snippet related endpoints.
Allows to generate previews, test snippets and upload snippets to a deployment.
Functions
|
Get a PIL ImageFont object for the given font and size. |
|
Generate a preview image for the given snippet as dict /json. |
|
Upload a snippet given a token. |
Module Functions
- snip.api.snippets.get_font(font: str, **kwargs)¶
Get a PIL ImageFont object for the given font and size.
- snip.api.snippets.get_snip_preview(dict: dict, token: Token, **kwargs) Image¶
Generate a preview image for the given snippet as dict /json.
This method only checks the validity of the dict on the server side and returns the preview image as a PIL Image object if it is valid.
- Parameters:
- Returns:
The preview image as a PIL Image object.
- Return type:
Image.Image