Skip to main content

A simple example project on how to use the flask-ligand library.

Project description

Build PyPI Codecov pre-commit

A simple example project on how to use the flask-ligand library. This example project is based on the example from the flask-smorest project. (Which is a core library that flask-ligand is built upon)

Quick Start Guide

Follow the instructions below to start exploring this example project!

Prerequisites

Clone Repo

$ git clone git@github.com:cowofevil/flask-ligand-example.git

Make Targets

Execute the following command to get a full list of make targets:

$ make help

Setup Python Environment

  1. Create a Python virtual environment:

    $ mkvirtualenv -p py310 flask-ligand-example
  2. Setup develop environment:

    $ make develop-venv
  3. Setup git pre-commit hooks:

    $ make setup-pre-commit
  4. Verify that environment is ready for development:

    $ make test-tox

Setup Docker Environment

The included docker environment used for integration testing can also be used for exploring the example project as well!

  1. Setup the Docker environment:

    $ make setup-integration
  2. Verify that the Docker environment is ready:

    $ make check-integration
  3. (Optionally) Execute the integration tests:

    $ make test-integration

Explore with SwaggerUI Docs

This example project has all the bells and whistles enabled for the flask-ligand library which can be explored by using the included SwaggerUI documentation. Follow the instructions below to start start running a local Flask server to serve the SwaggerUI documentation.

  1. Generate a ‘.env’ file to configure Flask server to use the included Docker environment:

    $ make gen-local-env-file
  2. Initialize the database:

    $ make setup-db
  3. Generate a JWT access token with admin rights for accessing the included example project endpoints:

    $ make gen-admin-access-token
  4. Start the local Flask server:

    $ make run
  5. Open a browser and navigate to ‘http://localhost:5000/apidocs’.

  6. Click the ‘Authorize’ button and paste in the JWT access token you created previously.

Now go ahead and start playing around with the API!

Access Keycloak Admin Console

If you would like to make changes to the Keycloak IAM clients to explore authentication then you can access the admin console by navigating to ‘http://localhost:8080/admin/master/console/’. The admin credentials can be found in the ‘docker/env_files/integration.env/’ file.

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-ligand-example-0.2.0.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

flask_ligand_example-0.2.0-py2.py3-none-any.whl (21.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flask-ligand-example-0.2.0.tar.gz.

File metadata

  • Download URL: flask-ligand-example-0.2.0.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.1 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.12.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for flask-ligand-example-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aee8bd26a1c913b1230c3467bee6534eb9e441aa5efc4806f19102760f5af0a6
MD5 64bebafef6498b3c184092afad26bc24
BLAKE2b-256 38055e6b708c0c6bcbb7c7f84ac12d8dc3f4aec612d63a4680b0dcc9408aa25f

See more details on using hashes here.

File details

Details for the file flask_ligand_example-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: flask_ligand_example-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.1 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.12.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for flask_ligand_example-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ccbd37ad7c1bd50858511af8ba270428a55e85cf380e793a4b56ee6e1905f084
MD5 eee6c4ef771d709f0e3f07912660b88c
BLAKE2b-256 62608e435f1ee9a493a12caf0fda48c7333a202e7d416a935c110c255b954ccc

See more details on using hashes here.

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