{"id":15858994,"url":"https://github.com/nitrocode/phone-code-names","last_synced_at":"2025-04-01T19:46:32.899Z","repository":{"id":52671422,"uuid":"215901319","full_name":"nitrocode/phone-code-names","owner":"nitrocode","description":"Map of phone code names to actual names combined with lineageos data","archived":false,"fork":false,"pushed_at":"2021-04-21T15:13:39.000Z","size":751,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T12:49:05.536Z","etag":null,"topics":["code","devices","google-spreadsheet","lineageos","names","phones","sheet"],"latest_commit_sha":null,"homepage":"https://bit.ly/2l8yswT","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nitrocode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-17T23:13:12.000Z","updated_at":"2024-09-01T19:44:33.000Z","dependencies_parsed_at":"2022-08-21T15:00:23.934Z","dependency_job_id":null,"html_url":"https://github.com/nitrocode/phone-code-names","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrocode%2Fphone-code-names","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrocode%2Fphone-code-names/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrocode%2Fphone-code-names/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitrocode%2Fphone-code-names/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitrocode","download_url":"https://codeload.github.com/nitrocode/phone-code-names/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246705550,"owners_count":20820758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code","devices","google-spreadsheet","lineageos","names","phones","sheet"],"created_at":"2024-10-05T21:02:36.342Z","updated_at":"2025-04-01T19:46:32.876Z","avatar_url":"https://github.com/nitrocode.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Phone Codenames\n\nThe objective of this project is to vet the best officially supported LineageOS phones by using the most popular phones currently used according to the [LineageOS Stats](https://stats.lineageos.org).\n\n[Google Sheets Demo](https://docs.google.com/spreadsheets/d/1jPNMhV0SpWhsCrsvQY5CXokgTlbqypKyHTUcnr9Y2lw/edit?usp=sharing)\n\n## Methodology\n\nI had a lot of trouble finding a relation between code names and phone brand and model. After trawling the web for a bit, I found Google has a [`supported_devices.csv`](http://storage.googleapis.com/play_public/supported_devices.csv) file for their Google Play support which contains the data I want. This data doesn't completely fit the LineageOS data so I had to correct some of it by researching and adding my own corrections.\n\nAfter collecting that data, I then hit the fonoapi to expand each phone's fields which gave me an additional 60 records. Some data is incomplete but still very useful. Going forward, I need to also collect cost for each phone to find budget phones. I'd also like to do a 3D bubble graph of a phone's price (z) vs specs score (y) vs release date (x).\n\nData Used\n\n* Google Play supported devices\n* LineageOS Stats\n* Fono API\n* Manual research\n\n## Supported Devices\n\nUpdate google api supported devices, convert to utf8, and remove BOM\n\n    curl -s http://storage.googleapis.com/play_public/supported_devices.csv | iconv -f UTF-16LE -t UTF-8 | sed '1s/^\\xEF\\xBB\\xBF//' \u003e data/google_devices.csv\n\nThe file `missing_devices.csv` was built manually and the rest are automatic.\n\n## Build manually\n\n1. Follow the steps in this [tutorial](https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html) and you should have your own sheet with permission set to the email in your `client_secret.json`\n\n2. Get fono api key and place it in a `.envrc` file to load the env variable using [`direnv`](https://github.com/direnv/direnv) or export `FONO_API` manually\n\n        $ cat .envrc\n        export FONO_API=abcdefghijklmnopqrstuvwxyz0123456789...\n\n2. Create pip environment and install dependencies\n\n        pipenv shell\n        pipenv install\n\n3. Remove old data (optional)\n\n        rm data/fono_fields.csv\n        rm data/lineageos*\n\n4. Run\n\n        python run.py\n\nYou should now see data in your Google Spreadsheet\n\n## TODO\n\nImportant\n\n* DONE - scrape lineageos stats\n* DONE - find and scrape trove of code names from google data\n* DONE - find and scape trove of code names from lineage data\n* DONE - insert all device info into devices table\n* DONE - hit fono api\n* DONE - combine lineageos stats with google data\n* DONE - combine new data with fono data\n* DONE - upsert a google spreadsheet\n* DONE - move cached data to data/ directory\n* DONE - get devices that don't have any data\n* Add a new `missing_devices_fono.csv` for devices like the Xiaomi Pocophone F1 that do not exist in the fono API but info does exist publicly\n    * This is where we can add manual data from gsmarena or another source\n* Scrape lineageos download page to get versions\n    * `[...document.querySelectorAll('table.striped.bordered tr td:nth-child(2)')].map((val) =\u003e val.innerText)`\n    * also get if this version is officially supported or not. might be able to tell if it's missing from `search.json`.\n    * include links to supported devices\n    * include links for unsupported devices\n* Scrape ifixit for fixit scores\n* Create separate Python SDK similar to [jaredrummler/AndroidDeviceNames](https://github.com/jaredrummler/AndroidDeviceNames)\n* Get average or min/max cost metrics per phone. If new is unavailable, find used.\n    * Amazon, Craigslist, FB Marketplace, Ebay\n\nMedium\n\n* DONE - get the top 100 lineageos phones instead of only 10\n    * FIXED - getting 429 quota exceeded for quota group 'WriteGroup'. Now writes to google sheets in a single batched command.\n* redownload files if last scrape is more than 7 days ago\n    * save all files with a timestamp\n* find a way to improve match rates. Roughly 50 to 70% right now.\n    * once improved, go from top 100 to top 200 and keep iterating\n* audit matches to see if they are correct\n\nMinor\n\n* strip out `android_x86` as it may be an android virtual machine\n* save data to database file instead of memory\n    * why? what does a db even buy us?\n    * create better db schema\n        * devices table\n        * stats table\n        * fono api table\n        * create_at timestamp from when data was retrieved\n* prefix comma delimited sources of data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrocode%2Fphone-code-names","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitrocode%2Fphone-code-names","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitrocode%2Fphone-code-names/lists"}