123 lines
3.0 KiB
Python
123 lines
3.0 KiB
Python
|
|
from vin import VIN
|
|
import requests
|
|
import json
|
|
|
|
vin_no = 'VR7ED9HP6SJ522156'
|
|
|
|
details = {
|
|
# 'Description': VIN(vin_no).description,
|
|
'make': VIN(vin_no).make,
|
|
'year': VIN(vin_no).model_year,
|
|
'model': VIN(vin_no).model,
|
|
'trim': VIN(vin_no).trim,
|
|
'Series': VIN(vin_no).series,
|
|
'body_class': VIN(vin_no).body_class,
|
|
'Type': VIN(vin_no).vehicle_type,
|
|
'Electrification level': VIN(vin_no).electrification_level,
|
|
}
|
|
|
|
print(details)
|
|
|
|
# from vininfo import Vin
|
|
#
|
|
#
|
|
# def vin_info_py(vin_no):
|
|
#
|
|
# # vin_no = 'VR3FDAHD1S3023105'
|
|
# vin_dic = {}
|
|
# vin_info = Vin(vin_no)
|
|
# vin_dic['country'] = vin_info.country
|
|
# vin_dic['manufacturer'] = vin_info.manufacturer
|
|
# vin_dic['region'] = vin_info.region
|
|
# vin_dic['produce_year'] = vin_info.years
|
|
# vin_dic['model_year'] = vin_info.years
|
|
#
|
|
# details = vin_info.details
|
|
# if details:
|
|
# vin_dic['details'] = True
|
|
# vin_dic['body'] = str(details.body)
|
|
# # vin_dic['engine'] = f"{details.engine}"
|
|
# vin_dic['model'] = f"{details.model}"
|
|
# vin_dic['plant'] = f"{details.plant}"
|
|
# vin_dic['serial'] = f"{details.serial}"
|
|
# vin_dic['transmission'] = f"{details.transmission}"
|
|
#
|
|
# for key, value in vin_dic.items():
|
|
# print(f'\t{key}:\t{value}')
|
|
#
|
|
# print("Decoded By ****vin_info****")
|
|
# print(vin_info.vds)
|
|
#
|
|
# else:
|
|
# print(vin_info.country)
|
|
# print(vin_info.manufacturer)
|
|
# print(vin_info.region)
|
|
# print(vin_info.years)
|
|
# print(vin_info.wmi)
|
|
# print(vin_info.vds)
|
|
# print(vin_info.vis)
|
|
# print('vin_info but no details')
|
|
#
|
|
#
|
|
# from pyvin import VIN
|
|
#
|
|
# number_vin = 'VR7ED9HP6SJ522156'
|
|
#
|
|
# vehicle = VIN(number_vin)
|
|
# if vehicle:
|
|
# try:
|
|
# make = vehicle.Make or 'Unknown'
|
|
# model = vehicle.Model or 'Unknown'
|
|
# year = vehicle.ModelYear or 'Unknown'
|
|
# body_class = vehicle.BodyClass or 'Unknown'
|
|
# series = vehicle.Series or 'Unknown'
|
|
# trim = vehicle.Trim or 'Unknown'
|
|
# print("Decoded By ****PYVIN****")
|
|
# print("Make: "+make)
|
|
# print("Model: "+model)
|
|
# print(year)
|
|
# print("Body class: "+body_class)
|
|
# print("series: "+series)
|
|
# print("trim: "+trim)
|
|
# except Exception as e:
|
|
# print(e)
|
|
# else:
|
|
# print("No vehicle found")
|
|
# vin_info_py(number_vin)
|
|
|
|
|
|
# from vpic import Client
|
|
#
|
|
# c = Client()
|
|
#
|
|
# # result = c.decode_vin("1GNDS13S672280804", 2011)
|
|
# result = c.get_models_for_make("TOYOTA", 2025)
|
|
# print(json.dumps(result, indent=4))
|
|
|
|
|
|
|
|
|
|
|
|
# from vin import VIN
|
|
#
|
|
# vin_no = "VR7ED9HP6SJ522156"
|
|
# try:
|
|
#
|
|
# make = VIN(vin_no).make
|
|
# model = VIN(vin_no).model
|
|
# year = VIN(vin_no).model_year
|
|
# body_class = VIN(vin_no).body_class
|
|
# series = VIN(vin_no).series
|
|
# trim = VIN(vin_no).trim
|
|
#
|
|
# print("Make: "+make)
|
|
# print("Model: "+model)
|
|
# print(year)
|
|
# print("Body class: "+body_class)
|
|
# print("series: "+series)
|
|
# print("trim: "+trim)
|
|
#
|
|
# except Exception as e:
|
|
# print(e)
|