Others
Python program to extract car information from VIN number
Hey geek! in this tutorial we are going to learn how to extract the car information from VIN using Python.
VIN stands for Vehicle Identification Number, which is an alphanumeric number of length 17, which consists of digits as well as alphabets.
VIN confirms our car own identity and also it has other uses too:
- It is used in warranty claims.
- For thefts and insurance coverage.
- And also for track calls.
First, we need to install a module in order to extract the information using VIN.
Installation of vininfo in Python
vininfo is a module that needed to be in our system.
The following command will help us in doing that.
With this command, we have installed vinfo in our system.
Let us code this out.
Python program to extract car information from VIN number
from vininfo import Vin
x = Vin('MAJGERTYKGHG56037')
print(x.country) # the country to whcih the vehicle belongs
print(x.manufacturer) # Name of the manufacturer
print(x.wmi)
print(x.vds)
print(x.vis)
print(x.region)
In the above code,
x is an object and with that object, we are extracting various information regarding the vehicle.
wmi stands for world manufacturer identifier,
vds stands for vehicle descriptor section and
vis stands for vehicle identification section.
The x.region in the code refers to, which continent the vehicle is manufactured in.
Output
India
Fords
MAJ
GERTYK
GHG56037
Asia
That’s it for this tutorial.
I hope you enjoyed it while reading.
If you have any queries please be free to comment out, we are with you.
Have a nice day.
Keep learning, keep enjoying.