saasify-to-openapi
Version:
Converts Saasify deployments to OpenAPI specs.
385 lines (384 loc) • 16.8 kB
JSON
{
"enabled": true,
"published": true,
"description": "Generate stylish wordclouds from any webpage.",
"hash": "c88892ed",
"user": "5d5b477eb5fab1199c927a36",
"team": "5dbef994fb93dc256540b0ce",
"project": {
"enabled": true,
"_id": "dev/wordcloud",
"name": "wordcloud",
"alias": "wordcloud",
"user": "5d5b477eb5fab1199c927a36",
"team": "5dbef994fb93dc256540b0ce",
"publishedVersions": [
{
"deployment": "dev/wordcloud@e60484c0",
"version": "0.1.0"
},
{
"deployment": "dev/wordcloud@087b15ec",
"version": "0.1.1"
},
{
"deployment": "dev/wordcloud@a2d01a6d",
"version": "0.1.2"
},
{
"deployment": "dev/wordcloud@361b0292",
"version": "0.1.3"
},
{
"deployment": "dev/wordcloud@aed9f5fa",
"version": "0.1.4"
},
{
"deployment": "dev/wordcloud@341c98c4",
"version": "0.1.5"
},
{
"deployment": "dev/wordcloud@3df3bc38",
"version": "0.1.6"
},
{
"deployment": "dev/wordcloud@c88892ed",
"version": "0.1.7"
}
],
"createdAt": "2019-11-09T08:40:43.728Z",
"updatedAt": "2019-11-19T04:58:56.796Z",
"__v": 8,
"lastPublishedDeployment": "dev/wordcloud@c88892ed",
"lastPublishedVersion": "0.1.7",
"saasUrl": "http://dev_wordcloud.localhost:3000",
"aliasUrl": "https://wordcloud.saasify.sh",
"id": "dev/wordcloud"
},
"version": "0.1.7",
"readme": "# wordcloud\n\n> Generate stylish wordclouds from any webpage.\n\n<a href=\"https://wordcloud.saasify.sh\">\n <img\n src=\"https://raw.githubusercontent.com/saasify-sh/saasify/master/examples/python/wordcloud/examples/promo.png\"\n alt=\"Wordcloud Examples\"\n />\n</a>\n\n## Supporting OSS\n\nThis project provides a hosted API for [stylecloud](https://github.com/minimaxir/stylecloud) and [wordcloud](https://github.com/amueller/word_cloud), by [minimaxir](https://github.com/minimaxir) and [amueller](https://github.com/amueller) respectively.\n\n**We set aside the majority of any revenue generated from this API for the original OSS developers**. If this is you, please [get in touch](https://saasify.sh/#/support) to setup payouts and answer any questions you may have.\n\n## Hosted API\n\n<a href=\"https://wordcloud.saasify.sh\">\n <img\n src=\"https://badges.saasify.sh\"\n height=\"40\"\n alt=\"Use Hosted API\"\n />\n</a>\n\n## Quick Start\n\nWelcome to the quick-start! Below are some examples for common ways of using the API via `cURL`.\n\nAlso be sure to check out the full reference of [API endpoints](https://wordcloud.saasify.sh/docs#tag/service).\n\n### Intro\n\nWordclouds are a graphical cloud of words that fit the shape of free [Font Awesome](https://fontawesome.com/icons?d=gallery&m=free) icons using a color palette from [palettable](https://jiffyclub.github.io/palettable/).\n\nThe most common use case is to generate a wordcloud from a news article or other webpage. For this, we can pass a `url` to the `/stylecloud` API.\n\n### Generating a wordcloud from a URL\n\n```sh\ncurl -X POST -o 'example.png' \\\n 'https://api.saasify.sh/1/call/dev/wordcloud/stylecloud' \\\n -H 'content-type: application/json' \\\n -d '{\n \"url\": \"https://www.bbc.com/sport/athletics/50460861\",\n \"icon\": \"fas fa-running\",\n \"gradient\": \"horizontal\"\n }'\n```\n\nThis example generates an image stored in `example.png`, containing a wordcloud from [this article](https://www.bbc.com/sport/athletics/50460861) with the [running icon](https://fontawesome.com/icons/running?style=solid).\n\n*example.png*\n\n<img src=\"https://raw.githubusercontent.com/saasify-sh/saasify/master/examples/python/wordcloud/examples/running.png\" width=\"256\" />\n\nBreaking down the example above, you can see the payload looks like:\n\n*Default Payload*\n\n```json\n{\n \"url\": \"https://www.bbc.com/sport/athletics/50460861\",\n \"icon\": \"fas fa-running\",\n \"gradient\": \"horizontal\"\n}\n```\n\nChanging these parameters will change the generated image.\n\n### Generating a wordcloud from a Wikipedia article\n\nLet's try changing the shape to a swimming icon [`fas fa-swimmer`](https://fontawesome.com/icons/swimmer?style=solid) from Font Awesome and use the wikipedia page for [Michael Phelps](https://en.wikipedia.org/wiki/Michael_Phelps).\n\n```sh\ncurl -X POST -o 'example.png' \\\n 'https://api.saasify.sh/1/call/dev/wordcloud/stylecloud' \\\n -H 'content-type: application/json' \\\n -d '{\n \"url\": \"https://en.wikipedia.org/wiki/Michael_Phelps\",\n \"icon\": \"fas fa-swimmer\"\n }'\n```\n\n*example.png*\n\n<img src=\"https://raw.githubusercontent.com/saasify-sh/saasify/master/examples/python/wordcloud/examples/michael-phelps.png\" width=\"256\" />\n\n### Generating a wordcloud with custom color palette\n\nNow let's try changing the `palette` to [`cmocean.sequential.Matter_10`](https://jiffyclub.github.io/palettable/cmocean/sequential/#matter_10) from palettable.\n\n```sh\ncurl -X POST -o 'example.png' \\\n 'https://api.saasify.sh/1/call/dev/wordcloud/stylecloud' \\\n -H 'content-type: application/json' \\\n -d '{\n \"url\": \"https://blog.ycombinator.com/ycs-essential-startup-advice/\",\n \"icon\": \"fab fa-y-combinator\",\n \"palette\": \"cmocean.sequential.Matter_10\"\n }'\n```\n\n*example.png*\n\n<img src=\"https://raw.githubusercontent.com/saasify-sh/saasify/master/examples/python/wordcloud/examples/yc.png\" width=\"256\" />\n\nAwesome! To continue playing with the full power of the API, check out [our API docs](https://wordcloud.saasify.sh/docs#tag/service).\n\nHitting our public rate limit? Consider [upgrading](https://wordcloud.saasify.sh/pricing) to remove all rate limits.\n\n## License\n\nMIT © [Saasify](https://saasify.sh)\n",
"services": [
{
"name": "stylecloud",
"timeout": 0,
"adaptor": "python",
"httpMethod": "post",
"examples": [
{
"inputContentType": "application/json",
"outputContentType": "image/png",
"name": "US Constitution",
"input": {
"url": "https://www.constituteproject.org/constitution/United_States_of_America_1992",
"icon": "fas fa-flag",
"palette": "cmocean.sequential.Matter_10"
},
"outputUrl": "https://storage.googleapis.com/saasify-uploads-prod/e5071b44232e62f1a00191994f5a801325642bc5.png",
"output": "example.png"
},
{
"inputContentType": "application/json",
"outputContentType": "image/png",
"name": "News Article",
"description": "Create wordcloud from article",
"input": {
"url": "https://www.cbc.ca/news/canada/ottawa/snow-storm-remembrance-day-1.5355302",
"icon": "fab fa-canadian-maple-leaf",
"palette": "colorbrewer.sequential.Reds_6",
"gradient": "vertical"
},
"outputUrl": "https://storage.googleapis.com/saasify-uploads-prod/bafa37d9d76bea47b4196144759ba4ac4ce81a72.png",
"output": "example.png"
},
{
"inputContentType": "application/json",
"outputContentType": "image/png",
"name": "YC",
"description": "Generate from blog post",
"input": {
"url": "https://blog.ycombinator.com/ycs-essential-startup-advice/",
"icon": "fab fa-y-combinator",
"palette": "cartocolors.qualitative.Pastel_8",
"gradient": "horizontal"
},
"outputUrl": "https://storage.googleapis.com/saasify-uploads-prod/a0b9a485c852c6f797b3b3dc96afef32a29702af.png",
"output": "example.png"
}
],
"config": {},
"headers": {},
"path": "/stylecloud",
"src": "main.py",
"definition": {
"params": {
"schema": {
"title": "StyleCloudRequest",
"type": "object",
"properties": {
"url": {
"title": "Url",
"type": "string",
"description": "URL of webpage to extract text"
},
"text": {
"title": "Text",
"type": "string",
"description": "Source text"
},
"size": {
"title": "Size",
"type": "integer",
"description": "Output width and height in pixels",
"default": 512
},
"icon": {
"title": "Icon",
"enum": [
"fas fa-ad",
"fas fa-address-book",
"fas fa-address-card",
"fas fa-adjust"
],
"type": "string",
"description": "[Font Awesome](https://fontawesome.com/icons?d=gallery&m=free) icon mask",
"default": "fas fa-flag"
},
"palette": {
"title": "Palette",
"enum": [
"cartocolors.diverging.ArmyRose_2",
"cartocolors.diverging.Geyser_7",
"cartocolors.diverging.ArmyRose_2_r"
],
"type": "string",
"description": "Color palette to use from [palettable](https://jiffyclub.github.io/palettable/)",
"default": "cartocolors.qualitative.Bold_6"
},
"background_color": {
"title": "Background_Color",
"type": "string",
"format": "color",
"default": "white"
},
"max_font_size": {
"title": "Max_Font_Size",
"type": "integer",
"default": 200
},
"max_words": {
"title": "Max_Words",
"type": "integer",
"description": "Maximum number of words to include in the stylecloud",
"default": 2000
},
"stopwords": {
"title": "Stopwords",
"type": "boolean",
"description": "Boolean to filter out common stopwords",
"default": true
},
"gradient": {
"title": "Gradient",
"enum": ["horizontal", "vertical"],
"type": "string",
"description": "Direction of gradient"
}
}
}
}
},
"url": "http://localhost:5000/1/call/dev/wordcloud@c88892ed/stylecloud",
"route": "/1/call/dev/wordcloud@c88892ed/stylecloud"
}
],
"build": null,
"env": {
"DIFFBOT_TOKEN": "@diffbot-token"
},
"saas": {
"features": [],
"name": "WordCloud",
"heading": "**Generate Beautiful Wordclouds**",
"subheading": "An API to create attractive wordcloud previews from any text or webpage.",
"repo": "https://github.com/saasify-sh/saasify/tree/master/examples/python/wordcloud",
"logo": "https://storage.googleapis.com/saasify-uploads-prod/7e7f2944fe00196c263ec9087b3bab1ceff0f37e.svg",
"favicon": "https://storage.googleapis.com/saasify-uploads-prod/88466d83b7cddde81a705bcf5d11f2b92e9e7aa2.ico",
"theme": {
"name": "waves",
"backgroundImage": "https://images.unsplash.com/photo-1501630834273-4b5604d2ee31?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2550&q=80",
"buttonStyle": "standard",
"color": "#50A9DA",
"wave": false,
"gradientDark": false,
"codeBlockDark": true,
"codeBlockOutputColor": "white"
}
},
"createdAt": "2019-11-19T04:58:45.196Z",
"updatedAt": "2019-11-19T04:58:56.761Z",
"coupons": [],
"url": "http://localhost:5000/1/call/dev/wordcloud@c88892ed",
"openApiUrl": "http://localhost:5000/1/deployments/openapi/dev/wordcloud@c88892ed",
"saasUrl": "http://dev_wordcloud_c88892ed.localhost:3000",
"openapi": {
"openapi": "3.0.2",
"info": {
"title": "Fast API",
"version": "0.1.0"
},
"paths": {
"/stylecloud": {
"post": {
"responses": {
"200": {
"description": "Successful Response",
"content": {
"image/png": {},
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"summary": "Stylecloud",
"operationId": "stylecloud_stylecloud_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StyleCloudRequest"
}
}
},
"required": true
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"title": "HTTPValidationError",
"type": "object",
"properties": {
"detail": {
"title": "Detail",
"type": "array",
"items": {
"$ref": "#/components/schemas/ValidationError"
}
}
}
},
"StyleCloudRequest": {
"title": "StyleCloudRequest",
"type": "object",
"properties": {
"url": {
"title": "Url",
"type": "string",
"description": "URL of webpage to extract text"
},
"text": {
"title": "Text",
"type": "string",
"description": "Source text"
},
"size": {
"title": "Size",
"type": "integer",
"description": "Output width and height in pixels",
"default": 512
},
"icon": {
"title": "Icon",
"enum": [
"fas fa-ad",
"fas fa-address-book",
"fas fa-address-card",
"fas fa-adjust"
],
"type": "string",
"description": "[Font Awesome](https://fontawesome.com/icons?d=gallery&m=free) icon mask",
"default": "fas fa-flag"
},
"palette": {
"title": "Palette",
"enum": [
"cartocolors.diverging.ArmyRose_2",
"cartocolors.diverging.Geyser_7",
"cartocolors.diverging.ArmyRose_2_r",
"cartocolors.diverging.Geyser_7_r"
],
"type": "string",
"description": "Color palette to use from [palettable](https://jiffyclub.github.io/palettable/)",
"default": "cartocolors.qualitative.Bold_6"
},
"background_color": {
"title": "Background_Color",
"type": "string",
"format": "color",
"default": "white"
},
"max_font_size": {
"title": "Max_Font_Size",
"type": "integer",
"default": 200
},
"max_words": {
"title": "Max_Words",
"type": "integer",
"description": "Maximum number of words to include in the stylecloud",
"default": 2000
},
"stopwords": {
"title": "Stopwords",
"type": "boolean",
"description": "Boolean to filter out common stopwords",
"default": true
},
"gradient": {
"title": "Gradient",
"enum": ["horizontal", "vertical"],
"type": "string",
"description": "Direction of gradient"
}
}
},
"ValidationError": {
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"type": "string"
}
},
"msg": {
"title": "Message",
"type": "string"
},
"type": {
"title": "Error Type",
"type": "string"
}
}
}
}
}
},
"id": "dev/wordcloud@c88892ed"
}