dsymbol / music-api

REST API created using FastAPI and SQLite3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

music-api

REST API created using FastAPI and SQLite3 with a music database 🎵
SQLAlchemy was not used as I wanted to expand my knowledge of SQL by implementing raw SQL

Endpoints

Artist

1

Album

2

Song

3

Quick Start

Install dependencies:

git clone https://github.com/dsymbol/music-api
pip install -r requirements.txt

Generate database and run the API:

python src/database.py
python -m uvicorn --port 5000 server:app

You can view the API docs by visiting http://localhost:5000

Example

Request:

GET http://localhost:5000/api/artist?name=drake

Response:

[
  {
    "artist_id": 3,
    "name": "Drake",
    "first_name": "Aubrey",
    "last_name": "Graham",
    "phone": "615-541-4518",
    "website": "drakerelated.com",
    "is_group": false
  }
]

PyTest

Tests are independent of each other, database must be reset after every test file ran.

About

REST API created using FastAPI and SQLite3

License:The Unlicense


Languages

Language:Python 100.0%