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_mobile_model_name("A1324"))
# Output:
# {"brand": "苹果", "model": "iPhone 3G (China mainland)"}
print(m2n.get_mobile_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.3.tar.gz (10.9 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for brand-model2name-0.0.3.tar.gz
Algorithm Hash digest
SHA256 224d148c6e39fc7bbeaa2cb1457ac02d21ccb29e79384cc5b7314681e0a28166
MD5 df4374864fba5d6d210391d5b9fc8912
BLAKE2b-256 ed38e437d91013086d9c200ae45b211fb6331efad783360e136c0ebdd7f5c267

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