Skip to content
Snippets Groups Projects
README.rst 755 B
Newer Older
Eliot Berriot's avatar
Eliot Berriot committed
Retribute API
=============


Agate's avatar
Agate committed
Install (dev)
-------------
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
.. code-block: shell
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  pip3 install --user virtualenv
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # create a Python3 virtualenv
  python3 -m virtualenv venv/
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # install dependencies
  venv/bin/pip3 install -e ".[dev]"
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # create and edit your env file
  cp env.sample .env
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # launch redis
  docker-compose up -d redis
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # launch the dev server
  venv/bin/python retribute_api/manage.py runserver
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
Querying the API
----------------
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
.. code-block: shell
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # list available lookups (sources)
  curl http://127.0.0.1:8000/v1/sources
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # list available providers)
  curl http://127.0.0.1:8000/v1/providers
Eliot Berriot's avatar
Eliot Berriot committed

Agate's avatar
Agate committed
  # retrieve data for a specifing profile
  curl http://127.0.0.1:8000/v1/search/webfinger:lila_bliblu@mastodon.opportunis.me