All Projects → tomasrasymas → flask-restful-api-template

tomasrasymas / flask-restful-api-template

Licence: MIT license
Template for flask-restful api project

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to flask-restful-api-template

maniwani
Imageboard software for the 21st century
Stars: ✭ 66 (-7.04%)
Mutual labels:  flask-sqlalchemy, flask-restful
flask-restful-api-boilerplate
This is boilerplate template for a Python Flask application with things you need to get started.
Stars: ✭ 14 (-80.28%)
Mutual labels:  flask-sqlalchemy, flask-restful
Resume-Generator
A Resume builder which allows users to build their own custom resumes with details like experience,projects , skills ,education etc. Users can also have the feature to download their resumes . To contribute send PR at development branch from where it will be merged in master once checked.
Stars: ✭ 28 (-60.56%)
Mutual labels:  flask-sqlalchemy, flask-restful
web trader
📊 Python Flask game that consolidates data from Nasdaq, allowing the user to practice buying and selling stocks.
Stars: ✭ 21 (-70.42%)
Mutual labels:  flask-restful
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+3878.87%)
Mutual labels:  flask-restful
Deploy-machine-learning-model
Dockerize and deploy machine learning model as REST API using Flask
Stars: ✭ 61 (-14.08%)
Mutual labels:  flask-restful
flask-rest-paginate
Pagination Extension for flask-restful
Stars: ✭ 18 (-74.65%)
Mutual labels:  flask-restful
peach
Lightweight framework built on top of flask, falcon with a touch of magic
Stars: ✭ 19 (-73.24%)
Mutual labels:  flask-restful
flask-arrested
Flask-Arrested: A Framework For Rapidly Building REST APIs with Flask.
Stars: ✭ 40 (-43.66%)
Mutual labels:  flask-sqlalchemy
GitDigger
The community for open source project. It provides new ways to help developers discover and contributing to open source projects.
Stars: ✭ 15 (-78.87%)
Mutual labels:  flask-sqlalchemy
eleanor
Code used during my Chaos Engineering and Resiliency Patterns talk.
Stars: ✭ 14 (-80.28%)
Mutual labels:  flask-sqlalchemy
flask-tweeeter
A full-stack Twitter clone made using the Flask framework for Python 🐦
Stars: ✭ 28 (-60.56%)
Mutual labels:  flask-sqlalchemy
MagicPress
Based on the flask of the personal blog, simple and elegant, full-featured, suitable for humans
Stars: ✭ 20 (-71.83%)
Mutual labels:  flask-sqlalchemy
Flask Sqlalchemy
Adds SQLAlchemy support to Flask
Stars: ✭ 3,658 (+5052.11%)
Mutual labels:  flask-sqlalchemy
github-traffic-stats
Manage and automatically collect Github traffic statistics for repositories
Stars: ✭ 30 (-57.75%)
Mutual labels:  flask-sqlalchemy
flask-authz
Use Casbin in Flask, Casbin is a powerful and efficient open-source access control library.
Stars: ✭ 100 (+40.85%)
Mutual labels:  flask-sqlalchemy
CampusDailyAutoSign
今日校园/体温签到/海南大学/QQ机器人
Stars: ✭ 15 (-78.87%)
Mutual labels:  flask-restful
Flask movie project
🎬 Flask构建的小花椒视频网站(重新配置 ing……)
Stars: ✭ 15 (-78.87%)
Mutual labels:  flask-sqlalchemy
artifacts
A clone of Etsy, an e-commerce site themed around selling items procured by time travelers.
Stars: ✭ 16 (-77.46%)
Mutual labels:  flask-sqlalchemy
Mask
A gRpc server like Flask (像Flask一样的gRpc服务)
Stars: ✭ 16 (-77.46%)
Mutual labels:  flask-sqlalchemy

Flask-RESTful API project template

This project shows one of the possible ways to implement RESTful API server.

There are implemented two models: User and Todo, one user has many todos.

Main libraries used:

  1. Flask-Migrate - for handling all database migrations.
  2. Flask-RESTful - restful API library.
  3. Flask-Script - provides support for writing external scripts.
  4. Flask-SQLAlchemy - adds support for SQLAlchemy ORM.

Project structure:

.
├── README.md
├── app.py
├── endpoints
│   ├── __init__.py
│   ├── todos
│   │   ├── __init__.py
│   │   ├── model.py
│   │   └── resource.py
│   └── users
│       ├── __init__.py
│       ├── model.py
│       └── resource.py
├── manage.py
├── requirements.txt
└── settings.py
  • endpoints - holds all endpoints.
  • app.py - flask application initialization.
  • settings.py - all global app settings.
  • manage.py - script for managing application (migrations, server execution, etc.)

Running

  1. Clone repository.
  2. pip install requirements.txt
  3. Run following commands:
    1. python manage.py db init
    2. python manage.py db migrate
    3. python manage.py db upgrade
  4. Start server by running python manage.py runserver

Usage

Users endpoint

POST http://127.0.0.1:5000/api/users

REQUEST

{
	"name": "John John"
}

RESPONSE

{
    "id": 1,
    "name": "John John",
    "todos": []
}

PUT http://127.0.0.1:5000/api/users/1

REQUEST

{
	"name": "Smith Smith"
}

RESPONSE

{
    "id": 1,
    "name": "Smith Smith",
    "todos": []
}

DELETE http://127.0.0.1:5000/api/users/1

RESPONSE

{
    "id": 3,
    "name": "Tom Tom",
    "todos": []
}

GET http://127.0.0.1:5000/api/users

RESPONSE

{
    "count": 2,
    "users": [
        {
            "id": 1,
            "name": "John John",
            "todos": [
                {
                    "id": 1,
                    "name": "First task",
                    "description": "First task description"
                },
                {
                    "id": 2,
                    "name": "Second task",
                    "description": "Second task description"
                }
            ]
        },
        {
            "id": 2,
            "name": "Smith Smith",
            "todos": []
        }
    ]
}

GET http://127.0.0.1:5000/api/users/2

{
    "id": 2,
    "name": "Smith Smith",
    "todos": []
}

GET http://127.0.0.1:5000/api/users?name=John John

{
    "count": 1,
    "users": [
        {
            "id": 1,
            "name": "John John",
            "todos": [
                {
                    "id": 1,
                    "name": "First task",
                    "description": "First task description"
                },
                {
                    "id": 2,
                    "name": "Second task",
                    "description": "Second task description"
                }
            ]
        }
    ]
}

GET http://127.0.0.1:5000/api/users?limit=1&offset=1

{
    "count": 1,
    "users": [
        {
            "id": 2,
            "name": "Smith Smith",
            "todos": []
        }
    ]
}

Todo endpoint is similar to Users endpoint.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].