Giter Club home page Giter Club logo

mobilemodels-csv's Introduction

MobileModels-csv

这是 https://github.com/KHwang9883/MobileModels 的 csv 格式版本,使用 GitHub Actions 自动生成并更新。

gen_csv.py 脚本说明

这是用于将 markdown 格式的设备型号介绍转为 csv 格式的 python 脚本。
输出列:设备编号,设备类型,品牌代码,品牌名,型号编码,型号昵称,型号名称,版本名称

设备编号 (model)
能从浏览器 UserAgent 中获取到的设备编号,如华为 P40 对应 ANA-AL00
一个 model 可能对应多个版本,也可能多个 model 对应一个版本。
设备类型 (device_type)
包含:手机、手表、平板、电视、电视盒子、笔记本、pod 等
对应 csv 的值:mob,watch,pad,tv,tv_hub,computer,pod
会从一级标题、二级标题、加粗行中尝试提取。如果一级标题不存在则置为空,如果有多个二级标题,后面的二级标题(或加粗行)未检测到有效设备类型,会使用前面的设备类型。
品牌代码 (brand)
从 brands 目录下的文件名中提取第一个单词
品牌名 (brand_title)
从一级标题中按正则提取
型号编码 (code)
从加粗行的前面中括号中提取
型号昵称 (code_alias)
从加粗行的尾部小括号中提取
型号名称 (model_name)
从加粗行去掉 code 和 code_alias 后剩余的内容
注意:一行可能有多个型号名称,以"/"分割
版本名称 (ver_name)
从 model 行,提取冒号之后的内容,再去掉 model_name 的重合部分,只保留版本信息
有些版本名称可能没有完全包含 model_name,而是只包含其中一部分,还有些可能完全没包含model_name
输出 ver_name 中,如果包含 model_name,然后去掉了一部分,则规定以"#"开头。
如果有多个 model_name,且包含的不是第1个,则"#"前面会添加索引 例如 CPH2413 对应 一加 10T 印度版,但所属的型号是 一加 Ace Pro / 一加 10T,有两个,和第二个型号相同,所以版本中去掉相同的 一加 10T部分,变成 #印度版,又因为对应的型号是第二个,索引是1,故最后是 1#印度版

鸣谢

mobilemodels-csv's People

Contributors

khwang9883 avatar

Stargazers

 avatar  avatar JBML avatar skyLee avatar  avatar zeinber avatar Lei1x avatar qtfreet00 avatar  avatar  avatar Yujun Huang avatar iyue_t avatar  avatar  avatar Ikaros avatar  avatar  avatar Robin avatar Salman Selim avatar  avatar

Watchers

 avatar  avatar  avatar

mobilemodels-csv's Issues

生成 csv 时并不是按文件名字母顺序处理

有个小问题,GitHub Actions 在生成 csv 时并不是按文件名字母顺序处理,而是疑似随机,这会导致提交中 models.csv 的变化很大,不利于查看更改内容。而我之前在 PC 本地生成 csv 则一直是按照字母顺序处理。另外之前 https://github.com/jantacy/mobilemodels 也有这个问题。

process: vivo_global_en.md
process: oneplus_en.md
process: meizu_en.md
process: huawei_cn.md
process: zte.md
process: apple_cn.md
process: blackshark.md
process: huawei_global_en.md
process: google.md
process: realme_cn.md
process: apple_all_en.md
process: realme_global_en.md
process: oppo_cn.md
process: zhixuan.md
process: blackshark_en.md
process: vivo_cn.md
process: asus.md
process: xiaomi_en.md
process: nothing.md
process: samsung_global_en.md
process: lenovo.md
process: smartisan.md
process: motorola.md
process: nokia.md
process: oneplus.md
process: xiaomi.md
process: apple_all.md
process: meizu.md
process: mitv_global_en.md
process: letv.md
process: 360shouji.md
process: coolpad.md
process: honor_cn.md
process: sony_cn.md
process: samsung_cn.md
process: mitv_cn.md
process: nubia.md
process: honor_global_en.md
process: oppo_global_en.md
generate complete, out file: ./models.csv

部分平板名称显示不全

如 realme Pad、vivo Pad、nubia Pad 3D

RMP2102,pad,realme,realme,,,,#realme Pad LTE
RMP2103,pad,realme,realme,,,,#realme Pad Wi-Fi
RMP2105,pad,realme,realme,,,mini,#LTE
RMP2106,pad,realme,realme,,,mini,#Wi-Fi
RMP2107,pad,realme,realme,,,X,#5G
RMP2108,pad,realme,realme,,,X,#Wi-Fi
RMP2204,pad,realme,realme,,,2,#LTE
RMP2205,pad,realme,realme,,,2,#Wi-Fi

PA2170,pad,vivo,vivo,,DPD2106,,#vivo Pad
PA2373,pad,vivo,vivo,,DPD2221,2,#
PA2353,pad,vivo,vivo,,DPD2305,Air,#
PA2473,pad,vivo,vivo,,DPD2329,3 Pro,#

LPD-20W,pad,nubia,努比亚,,,3D,#

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.