Fast API is web framework used for building APIs using Python programming language by using various in-built libraries. It is as per the name is fast and can implement the APIs for interaction among front-end, back-end, database and browser.
Why we use the Fast-API:
Authentication as fast api provides the gives the python developers best security.
CRUD(create read update and delete), we can perform this operations, using the APIs.
Validation, the validation of data of user present in database, can easily be authenticated using Fast API.
How we can test APIs build using Fast API?
We can test the APIs using either using Swagger UI or using Postman. Testing the APIs urls and checking whether the crud operations are working fine or not, is essential after building APIs. We can test the APIs by checking, either the requests and response from server, are transferring validated data or not.
What are the commands used for installing the Fast API library using Python?
There are certain commands used for installing the Fast API. The commands are as follows:
pip3 freeze(Used for listing all the installed libraries) or pip3 list
pip install fastapi(installing specific versions)
pip install fastapi[all]
pip install uvicorn(for starting the fast api apps)
uvicorn main: app
What operations we can perform using Fast API?
C - Post: url/post@app("/posts")
R - Get: url/posts/id or /posts@app.get("/posts/{id}")
U - Update: Put/Patch url/posts/id@app.get("posts/{id}")
D - Delete: url/posts/id@app.delete("/posts/{id}")
Where we can deploy the Fast APIs apps?
Ubuntu
Heroku
CI/CD Pipeline
Which library of data is used for data validation?
The Pydantic model library is mostly used for data validation. The library has different metadata which are annotated inside the python defined functions.
The basic understanding of Fast API and what it's use, how and why it is used.
Top comments (0)