suitablephones/Readme.md

117 lines
2.6 KiB
Markdown
Raw Normal View History

2022-12-30 00:25:56 +01:00
# Suitable Phones
2023-03-29 16:47:28 +02:00
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:
* /devices: Returns a list of all devices in the catalog, with basic device information.
* /devices/{codename}: Returns detailed information about a specific device, including supported LineageOS versions and a link to the official wiki page.
2022-12-30 00:25:56 +01:00
2023-01-04 14:27:06 +01:00
## Installation
2022-12-30 00:25:56 +01:00
```
2023-01-04 14:27:06 +01:00
git clone https://git.lattuga.net/d0c/suitablephones.git
virtualenv .
2023-01-04 17:33:13 +01:00
source bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
2022-12-30 00:25:56 +01:00
```
2023-01-04 17:33:13 +01:00
2022-12-30 00:25:56 +01:00
2023-01-04 14:27:06 +01:00
Download Lineage official wiki as data source.
2023-01-04 17:33:13 +01:00
Yaml files descripting all devices are in _"lineage_wiki/_data/devices/"_
2022-12-30 00:25:56 +01:00
2023-01-04 14:27:06 +01:00
```
git clone https://github.com/LineageOS/lineage_wiki.git
```
2023-01-03 11:28:00 +01:00
2023-01-04 14:27:06 +01:00
Set _LINEAGEWIKI_ variable in _mysuitablephone/settings.py_ with the proper path of lineage_wiki.
2023-01-03 11:28:00 +01:00
2023-01-04 14:27:06 +01:00
es.
```
LINEAGEWIKI = '/home/d0c/lineage_wiki'
2023-01-03 12:35:43 +01:00
```
2023-01-04 17:33:13 +01:00
Populate database:
```
python manage.py fetchphones
```
Run
```
python manage.py runserver
2023-01-12 18:31:23 +01:00
```
2023-03-29 16:47:28 +02:00
## 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.
2023-01-12 18:31:23 +01:00
### ToDo
2023-03-29 16:47:28 +02:00
* API key authentication to restrict access to authorized clients. ?