Skip to main content

An automatic code API generator for Flask and JS.

Project description

Sharp

Sharp is an automatic API generation library for Python Flask and JavaScript. You just define functions in the backend, and they are magically available to you on the frontend, with type checking built-in.

Example

Server-side code,

app = Flask(__name__)
sharp = Sharp(app)

@sharp.function()
def add(a: int, b: int):
    return {
        "result": a + b,
    }

And magically on your front-end,

const result = await API.add(4, 3);

Sharp can be combined with a modern frontend framework and any web asset bundler, the code-gen is emmitted to a standalone JavaScript file,

sharp.generate("src/js/sharp.gen.js")

All Sharp messages are in plain JSON, producing human-readable messages and API routes.

For a more fully fledged example, please see the example/ directory.

License

Copyright (c) 2020 Shreyas Kapur. Released under 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Flask_Sharp-0.0.1-py3.6.egg (6.9 kB view hashes)

Uploaded Source

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