sintonia/api
Jonas L 30b3470a06
Better format enforcing (#1391)
* Add shared python format-check target

* Add .format-check to api lint target

* Format api code with makefile format target

* Add .format-check to tools lint target

* Add .format-check to analyzer lint target

* Format analyzer code with makefile format target

* Add .format-check to celery lint target

* Add .format-check to api_client lint target

* Format api_client code with makefile format target

* Add .format-check to playout lint target

* Run CI linting in parallel

* Disable isort in pre-commit
2021-10-17 16:24:37 +02:00
..
bin Remove python encoding pragma 2021-06-05 00:39:23 +02:00
install/systemd add API v2 2021-05-14 13:04:46 +02:00
libretimeapi Better format enforcing (#1391) 2021-10-17 16:24:37 +02:00
Makefile Better format enforcing (#1391) 2021-10-17 16:24:37 +02:00
README.md Add openapi spec for API v2 (#1388) 2021-10-16 20:34:03 +02:00
packages.ini Install venv instead of virtualenv 2021-08-31 16:07:29 +02:00
setup.py Add openapi spec for API v2 (#1388) 2021-10-16 20:34:03 +02:00

README.md

LibreTime API

This API provides access to LibreTime's database via a Django application. This API supersedes the PHP API.

Deploying

Deploying in a production environment is done in the install script which installs LibreTime. This is how the API is installed in the Vagrant development images too. This method does not automatically reflect changes to this API. After any changes, the libretime-api systemd service needs restarting:

sudo systemctl restart libretime-api

Connections to the API are proxied through the Apache web server by default. Endpoint exploration and documentation is available from http://example.com/api/v2/schema/swagger-ui/, where example.com is the URL for the LibreTime instance.

Development

For a live reloading version within Vagrant:

vagrant up debian-buster
# Run through the web setup http://localhost:8080
vagrant ssh debian-buster
sudo systemctl stop libretime-api
sudo systemctl restart libretime-analyzer libretime-celery libretime-liquidsoap libretime-playout
cd /vagrant/api
sudo pip3 install -e .
sudo -u www-data LIBRETIME_DEBUG=True python3 bin/libretime-api runserver 0.0.0.0:8081

Unit tests can be run in the vagrant environment using

sudo -u www-data LIBRETIME_DEBUG=True python3 bin/libretime-api test libretimeapi

3rd Party Licences

libretimeapi/tests/resources/song.mp3: Steps - Tears On The Dancefloor (Album Teaser) by mceyedol. Downloaded from https://soundcloud.com/mceyedol/steps-tears-on-the-dancefloor-album-teaser released under a Creative Commons Licence (cc-by-sa-nc-sa)