Skip to content

moiz-naeem/WEB-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PWP SPRING 2024

LIBRERIAN

Create your own library and share books with others

Group information

Remember to include all required documentation and HOWTOs, including how to create and populate the database, how to run and test the API, the url to the entrypoint and instructions on how to setup and run the client

README checklist

  • Dependencies (external libraries)
  • How to setup the framework.
  • How to populate and setup the database.
  • How to setup (e.g. modifying any configuration files) and run your RESTful API.
  • The URL to access your API (usually nameofapplication/api/version/)=> the path to your application.
  • Instructions on how to run the different tests for your application.

Implementation Details

Database

Database used is SQLite, check wiki for database schema.

Dependencies

Librerian depends on the following python packages

  • flask
  • flask_sqlalchemy
  • flask_restful
  • sqlalchemy
  • jsonschema
  • flasgger
  • pyyaml
  • requests
  • pytest
  • pylint

Setup and Usage

Recommended way to run Create Python virtual enviroment

python3 -m venv venv

Set enviroment variables in the activate script that you will be using

echo "export FLASK_APP=librerian" >> venv/bin/activate
echo "export FLASK_ENV=develpoment" >> venv/bin/activate

Activate virtual enviroment and install required packages

source venv/bin/activate
pip install -r requirements.txt

Initialize the database

flask init-db

And optionally generate dummy data for testing

flask gen-db

Now you can run Flask app using

flask run

Running tests

To run Pytest, it is required to install the Librerian as Python package

pip install -e .

Afterwhich pytest and pylint can be run

pytest tests
pylint librerian

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%