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 instuctions 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. Generate a JWT access token with admin rights for accessing the included example project endpoints:

    $ make gen-admin-access-token
  3. Initialize the database:

    $ make setup-db
  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.1.1.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

flask_ligand_example-0.1.1-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.1.1.tar.gz.

File metadata

  • Download URL: flask-ligand-example-0.1.1.tar.gz
  • Upload date:
  • Size: 49.2 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.1 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for flask-ligand-example-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e9820e6d864840829a481fc0fd25e455012ef6d427f1b5c6a0a1f7015b63e9b
MD5 35a5e86c4ee709d85138481ca265faaf
BLAKE2b-256 0a6cbc69502b5fff53fec6ef1c0ec17de5006a14e1a61d105f17227ecb33be09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flask_ligand_example-0.1.1-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.1 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for flask_ligand_example-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 991a642a17ef0408fdf39764e84883a2b68f7f6eaf2e4f7c4bb54cb3fe80bc62
MD5 8d655938890dc6b9ec7b211bbc6ee0ec
BLAKE2b-256 7cc4d4d8d6b3add796b4433c98de42f1fa90cff9f2d3ed13ca105d0e152d2271

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