API Tackle - Simple Python REST API Framework
Project description
Simple Python REST API Framework …
python3 setup.py sdist bdist_wheel
twine upload dist/*
Quickstart
""" WSGI Flask App for production hosting with e.g.: gunicorn --bind 0.0.0.0:80 -w 1 -t 120 wsgi """
import os
import logging
from tackle.flask_utils import create_flask_app # noqa
from tackle.flask_utils import setup_logging # noqa
from tackle.prometheus_utils import create_prometheus_server # noqa
from tackle.rest_api.wrapper_util import add_auth_token # noqa
from tropical.rest_api import get_path # noqa
create_prometheus_server(9100)
setup_logging(requested_logging_path='~/.tackle/logs',
include_prometheus=True)
flask_app = create_flask_app(specification_dir=get_path() + '',
add_api=True,
swagger_ui=True,
database_url='sqlite://',
database_create_tables=True,
debug=False)
# === Add some auth tokens to the DB ===
add_auth_token('tackleb6-12dd-4104-a7b6-f7d369ff5fec', "Default token e.g. internal hosting.")
# === ===
logging.info(f"rest_wsgi_app.py: __name__ == {__name__}")
application = flask_app.app
if __name__ == "__main__":
logging.info(f"rest_wsgi_app.py: __main__ Starting Flask app in Python __main__ .")
flask_app.run()
Building your own API
…
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
api_tackle-0.1.dev1.tar.gz
(17.3 kB
view hashes)
Built Distribution
Close
Hashes for api_tackle-0.1.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 626a693188433ef65b74658d113fe99d5edb47c0d6ab2f26900638fad69511d2 |
|
MD5 | 043680f728e981e67a55f9796704c147 |
|
BLAKE2b-256 | 88f2dfd6b641b10e41a239638bf1758921fea57f10fbad6c411a701493c7f39d |