No description
Find a file
2023-07-31 17:06:43 +02:00
mysuitablephone search 2023-03-30 00:22:48 +02:00
suitablephones removed network arrayobject 2023-07-31 17:06:43 +02:00
.gitignore setting 2023-03-29 21:47:37 +02:00
docker-compose.yml test postgres 2023-01-16 17:29:23 +01:00
manage.py first commit 2022-12-30 00:25:56 +01:00
Readme.md readme 2023-04-04 17:29:00 +02:00
requirements.txt search 2023-03-30 00:22:48 +02:00
start.sh storage 2023-06-12 17:36:50 +02:00

Suitable Phones

LineageOS Supported Devices Catalog and API

This project aims to provide a comprehensive catalog of all devices that are officially supported by the LineageOS project, as well as an API for accessing this information programmatically.

Features

The project provides the following features:

  • A catalog of all devices with official support for LineageOS, including device name, codename, LineageOS version(s) supported, and a link to the official LineageOS wiki page for each device.
  • A RESTful API for accessing the device catalog programmatically. The API supports the following endpoints:
    • /search
      • q: string in codename or name or vendor
    • /devices
      • name: contains string
      • megapixel: greater than decimal
      • size_in: less than decimal
      • resolution: contains string (es 1280)
      • version: contains string Returns a list of all mantained devices in the catalog matching search filters, with basic device information.
    • /device
      • codename: Returns detailed information about a specific device, including supported LineageOS versions and a link to the official wiki page.

Installation

git clone https://git.lattuga.net/d0c/suitablephones.git
virtualenv .
source bin/activate
pip install -r requirements.txt

DB is in docker container

docker compose up -d
python manage.py migrate
python manage.py createsuperuser

Download Lineage official wiki as data source. Yaml files descripting all devices are in _"lineage_wiki/data/devices/"

git clone https://github.com/LineageOS/lineage_wiki.git

Set LINEAGEWIKI variable in mysuitablephone/settings_local.py with the proper path of lineage_wiki.

es.

LINEAGEWIKI = '/home/d0c/lineage_wiki'

Populate database:

python manage.py fetchphones

Run

python manage.py runserver

API Usage

To use the API, you'll need to obtain an API key by registering an account on the project website. Once you have an API key, you can use it to authenticate your API requests.

Here are some example API requests: Get all devices

bash


GET /devices

Response:

json

[
  {
    "name": "Samsung Galaxy S20",
    "codename": "beyond2",
    "versions": ["18.1"],
    "wiki_url": "https://wiki.lineageos.org/devices/beyond2"
  },
  {
    "name": "OnePlus 6T",
    "codename": "fajita",
    "versions": ["18.1"],
    "wiki_url": "https://wiki.lineageos.org/devices/fajita"
  },
  ...
]

Get a specific device

bash


GET /devices/fajita

Response:

json


{
  "name": "OnePlus 6T",
  "codename": "fajita",
  "versions": ["18.1"],
  "wiki_url": "https://wiki.lineageos.org/devices/fajita"
}

Contributing

Contributions to this project are welcome! If you'd like to improve the API or search results, please submit a pull request. Be sure to read the contributing guidelines first.

ToDo

  • API key authentication to restrict access to authorized clients. ?