Skip to main content

A simple package that takes a brand name as input and returns the corresponding model name.

Project description

brand-model2name

This is a simple package that takes a brand name as input and returns the corresponding model name.

Rely on KHwang9883's MobileModels

Installation

$ pip install brand-model2name

Example

Model2Name init need 2 parameters:

  1. brands:

    A list of brand names, can choose any brand name in the list which includes 'samsung', 'oneplus', 'apple', 'zte', 'honor', 'huawei', 'google', '360shouji', 'mitv', 'oppo', 'blackshark', 'meizu', 'nubia', 'vivo', 'sony', 'coolpad', 'smartisan', 'xiaomi', 'asus', 'nokia', 'lenovo', 'zhixuan', 'motorola', 'nothing', 'realme', 'letv'.

    The default value is set to all of the above brands

  2. device:

    Can choose any one from 'mobile', 'tv', 'wearable' and 'all'.

    The default value is set 'mobile'.

📔: Suggest to use a singleton object to use.

from model2name import Model2Name

m2n = Model2Name()
print(m2n.get_model_name("A1324"))
# Output:
# {"brand": "苹果", "model": "iPhone 3G (China mainland)"}
print(m2n.get_model_name("unknown-model"))
# Output:
# {}

# if you init just like this, it only has 'xiaomi' and 'apple' brands and their TV models.
m2n = Model2Name(device='tv', brands=['xiaomi', 'apple'])

GitHub Actions are supported and automatically updated daily. Please add GITHUB_TOKEN after Fork or PR, refer toGitHub Token

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brand-model2name-0.0.9.tar.gz (86.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brand_model2name-0.0.9-py3-none-any.whl (98.2 kB view details)

Uploaded Python 3

File details

Details for the file brand-model2name-0.0.9.tar.gz.

File metadata

  • Download URL: brand-model2name-0.0.9.tar.gz
  • Upload date:
  • Size: 86.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.11

File hashes

Hashes for brand-model2name-0.0.9.tar.gz
Algorithm Hash digest
SHA256 f3aca75854d885e2fa7e37e2af7be0d51a1f0fa17a0c3339c9d2d8316702489a
MD5 120ad1403cfc5b761ea444f5a65b8614
BLAKE2b-256 d5af630e0cf827032c0481ee72fd1de8e66ba2ddd469cec4a6dc8937212ade37

See more details on using hashes here.

File details

Details for the file brand_model2name-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for brand_model2name-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 11fed87127ea53645f5d0d240e56ad194d9db425ca1ab9f1e695c3aacb42efbf
MD5 def3914de679fb6596b744ee9f56023e
BLAKE2b-256 4edd162f97f9557cf6f93571de39bf982ba42813770624d7814e0155527cdcd4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page