Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyvin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyvin

Python VIN decoder

  • 0.0.2
  • PyPI
  • Socket score

Maintainers
1

PyVIN

A Vehicle Identification Number (VIN) decoder for Python. This leverages the NHTSA API to decode VINs into collections of vehicle data that can be easily explored (https://vpic.nhtsa.dot.gov/api/)

Basic Usage:

In [0]: from pyvin import VIN

In [1]: vehicle = VIN('JT2AE09W4P0038539')

In [2]: (vehicle.Make, vehicle.Model, vehicle.ModelYear)
Out[2]: ('TOYOTA', 'Corolla', '1993')

In [3]: my_vins = ('JT2AE09W4P0038539', 'KMHD35LH5EU205042')

In [4]: my_vehicles = VIN(*my_vins)

In [5]: for veh in my_vehicles:
   ...:     print(veh.Make, veh.Model, veh.ModelYear)
TOYOTA Corolla 1993
HYUNDAI Elantra 2014

Advanced Usage:

The user can also specify how invalid VINs are handled, be it raising an exception or ignoring them:

In [6]: import pyvin
In [7]: new_car = pyvin.VIN('Foo', error_handling=pyvin.RAISE)
Out[7]: VINError: Invalid char "o"the u

To simply clean a VIN list, with no decoding involved, the following can be called:

In [8]: import pyvin

In [9]: my_vins = ('JT2AE09W4P0038539', 'Foo')

In [10]: cleaned_vins = pyvin.clean_vins(my_vins)

In [11]: cleaned_vins
Out[11]: ['JT2AE09W4P0038539']

For simple validation, no calls to the NHTSA API are used, as there is a formula to validate VINs

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc