Code Monkey home page Code Monkey logo

home_music_api's Introduction

Home Music API

  • REST api to organize, catalog local mp3 files

technologies used

  • Django 3
  • django rest framework
  • eyed3 to read mp3 file metadata (i.e. song title, artist, album, etc)
  • psycopg2 to connect to postgresql database
  • python-dotenv for environment variables (.env file)
  • urllib3 for opening mp3 files to read metadata
  • python venv environment for development
  • docker for deployment

require .env file in project root in the following format
DJANGO_SECRET=
DATABASE_NAME=
DATABASE_USER=
DATABASE_PASSWORD=
DATABASE_HOST_IP=
DATABASE_PORT=
CORS_ALLOWED_LIST=
ADMIN_USER_NAME=
ADMIN_USER_EMAIL=
ADMIN_USER_PASSWORD=

required postgresql database running on the local network with a database already created

Endpoints

GET songapi/song/

  • return json of all songs in database
  • id, title, remote_url, album, artist
  • search allowed, songapi/song/?search=

POST songapi/song/

  • write song data to database
  • title, remote_url, album_id, artist_id

GET songapi/album/

  • return json of all albums in database
  • id, name
  • search allowed, songapi/album/?search=

POST songapi/album/

  • write album data to database
  • name

GET songapi/artist/

  • return json of all artists in database
  • id, name
  • search allowed, songapi/artist/?search=

POST songapi/artist/

  • write artist data to database
  • name

GET songapi/playlist/

  • return json of all playlist names in database
  • id, name
  • search allowed, songapi/playlist/?search=

POST songapi/playlist/

  • write playlist name to database
  • name

GET songapi/playlistsong/

  • return json of all linked playlists and songs (join table)
  • id, playlist_id, song_id
  • search allowed, songapi/playlistsong/?search=

POST songapi/playlistsong/

  • write linked playlist and song id's to database
  • playlist_id, song_id

GET songapi/settings/

  • read all user settings
  • id, source_ip, source_script_path

POST songapi/settings/

  • write user settings to database
  • source_ip, source_script_path

PUT songapi/refresh/

  • return json of both mp3 files added to database and deleted from database
  • when files are added to or deleted from the local harddrive the refresh
    endpoint will update the database to reflect the files in the directory path

GET songapi/randomplaylist/

  • return json message

POST songapi/randomplaylist/

  • create new playlist with designated number of random songs
  • name=newplaylistname, amount=numberofsongs

home_music_api's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.