A Python library dedicated to exemplify and facilitate the start of Flask projects for APIs 💫. Download flask-structure and streamline the "start" of your projects with ease 🚀.
Project description
Flask-Structure - Base Structure for API Projects 🧱
A Python library dedicated to exemplify and facilitate the start of Flask projects for APIs 💫. Download flask-structure and streamline the "start" of your projects with ease 🚀.
Organized and Scalable Structure. 😎📱
Structure
Details
- Controllers: Contains controllers that manage the application logic, connecting routes to specific operations.
- Drivers: Stores the drivers and libraries necessary to connect and operate with other services or hardware.
- Errors: Defines specific error types and custom exceptions that can be triggered during code execution.
- Main: The main entry point of the application. Within this folder, "Routes" manages API routes, and "Server" is responsible for starting and managing the web server.
- Models: Contains data models, usually classes representing tables in the database.
- Static: Stores static files such as CSS, JS, images, etc., needed to render front-end web pages.
- Templates: Maintains HTML templates and documentation related to the structure or usage of the API.
- Validators: Includes scripts or modules to validate input data or API requests.
- Views: Defines different types of HTTP responses and views associated with presentation logic.
API Structure Features 🔨
- Info: Welcomes users and provides relevant information about the API and contacts.
- Docs: A place to learn about the API and how to use it interactively and dynamically.
- Favicon.ico: Icon to be displayed in the website window.
Key Technologies Used 🌐
- Flask: Framework used for web application development, providing a flexible and efficient structure for creating APIs and user interfaces.
- Python: Primary programming language chosen for its versatility, simplicity, and large developer community.
- Cerberus: Python data validation library, used to ensure the integrity and consistency of data manipulated by the application.
- Other Libraries: The rest of the libraries can be found in requirements.txt, including various tools and utilities that complement and enhance the application's functionality.
Documentation 📃
API:
An API (Application Programming Interface) is a set of rules and definitions that allows communication between different software. It enables applications and services to exchange information and functionality efficiently and standardized.
Key Uses in Development:
- Service Integration: APIs facilitate integration between different services and platforms, allowing applications to share data and functionality.
- Mobile Application Development: APIs are essential for mobile app development, providing access to resources such as location, camera, notifications, among others.
- Access to External Data: Used to obtain data from external sources, such as social networks, databases, third-party services, providing up-to-date information.
- Integration with Web Platforms: APIs are crucial for integrating web applications, enabling efficient communication between the front-end and back-end.
- Microservices Development: In microservices architectures, APIs are essential for communication between the various distributed components of an application.
- Task Automation: APIs allow the automation of routine tasks, optimizing processes and improving operational efficiency.
- Plugin and Extension Development: Used to create plugins and extensions in various platforms, expanding the functionalities of existing software.
- Resource Economy: Facilitate development by allowing the reuse of already implemented functionalities, saving time and resources.
How to Run the Library Locally 🛠️
- Virtual Environment (Optional) For organization and ease of running the project, I suggest creating a virtual environment. To do this, use the following command:
python -m venv .venv
.venv\Scripts\activate
- Download the library:
pip install flask-structure
- Run the command to create the project structure
flask-structure create
- Install dependencies:
pip install -r requirements.txt
- Run the application:
python run.py
- Use the structure your way ;)
Demonstrated Features of the Generated Structure 💻
- Main Route ("/"): Returns a template that renders Swagger documentation.
(http://127.0.0.1:3000)
- API Information Route ("/info"): Returns a JSON with information about the API.
(http://127.0.0.1:3000/info)
{
"status": True,
"message": "Welcome to the Structure Flask API!",
"version": "1.0v",
"endpoints": {
"docs": "/",
"info": "/info",
},
"documentation": "/",
"contact": {
"email_personal": "pedro.henrique.martins404@gmail.com",
"email_academic": "pedro.borges@alu.unibalsas.edu.br",
"github": "piedro404",
"linkedin": "pedrohenrique404"
}
}
License
This project is licensed under the MIT License - see the LICENSE file for details.
About 📒
Thanks to everyone, I wish you great studies. If you want, contact me at pedro.henrique.martins404@gmail.com.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask-structure-0.1.0.tar.gz.
File metadata
- Download URL: flask-structure-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e54960e77c50b3b9038d9b364a2dcc2477e01525ea23589958cacbfe4b291f27
|
|
| MD5 |
15fd3a795be7661cb97040cf1f558b11
|
|
| BLAKE2b-256 |
9cfcc6c6228669c291cff7153159615a2f04889d0938426232bdaf573dd0c8b1
|
File details
Details for the file flask_structure-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flask_structure-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36dbac937da9a7214f17426d56586c1c5676787de9cfbe00c1567dff8a2596d8
|
|
| MD5 |
4fce673f351b12e945b98ea687a41ffb
|
|
| BLAKE2b-256 |
9f1c62ecc3c2ae5a7d520d5e9b2d5b7bf49f9df5bacc5c529caa4c1ec5cd1746
|