GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 100-python-projects/API with RESTful Routing at main · bicky007/100-python-projects

Expand file tree

/

API with RESTful Routing

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

API with RESTful Routing

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
templates
templates
 
 
cafes.db
cafes.db
 
 
main.py
main.py
 
 
readme.md
readme.md
 
 

readme.md

Outline

Building Your Own API with RESTful Routing

Concepts Practised

  • HTTP Requests (GET, POST, PUT, PATCH, DELETE)
  • Postman Software
  • Publish API Documentation

API with RESTful Routing

Features

  • Retrieve a random cafe: Get a random cafe from the database.
  • Retrieve all cafes: Get a list of all cafes in the database.
  • Search for a cafe: Find a cafe by location.
  • Add a new cafe: Add a new cafe to the database.
  • Update a cafe's coffee price: Update the coffee price of a specific cafe.
  • Delete a cafe: Delete a cafe from the database by ID.

Prerequisites

  • Python 3.x
  • Flask
  • Flask-SQLAlchemy

Installation

  1. Clone the repository or download the script.
  2. Install the required libraries:
    pip install Flask Flask-SQLAlchemy
  3. Create the database:
    python
    >>> from your_script_name import db
    >>> db.create_all()
    >>> exit()

Configuration

  • Ensure that the database URI is correctly set in the script:
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///cafes.db'

Usage

  1. Run the Flask application:
    python your_script_name.py
  2. Access the API endpoints through a tool like Postman or via your web browser.

day66

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.