Skip to content

Commit

Permalink
version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpeckham committed Feb 3, 2024
1 parent 783a828 commit aa1e804
Show file tree
Hide file tree
Showing 23 changed files with 210 additions and 406 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
vin/.DS_Store
docs/changelog.md
5 changes: 5 additions & 0 deletions .linkcheckerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://linkchecker.github.io/linkchecker/man/linkcheckerrc.html
[filtering]
ignore=

[AnchorCheck]
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

## v0.2.0 (2024-02-03)

[GitHub release](https://github.com/davidpeckham/vin/releases/tag/v0.2.0)

### New Features

* Validate VIN length, characters, and check digit, with the option to correct the check digit.
* Decode the manufacturer and model year from a VIN
* Documentation

### Fixes

* Updated annotations for `VIN.vds` and `VIN.vis` to show that they don't return None
* Annotated `VIN.model_year` to show that it returns int, and removed the else condition that allowed it to return None
* Inlined `VIN.is_vin_character` in the default constructor
* Converted property `VIN.check_digit` to class method `VIN.calculate_check_digit`
* Converted ``constants.VIN_CHARACTERS`` from list to string
* Renamed GitHub workflows as .yml (from .yaml)
49 changes: 0 additions & 49 deletions CHANGELOG.rst

This file was deleted.

73 changes: 65 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,80 @@

[![PyPI - Version](https://img.shields.io/pypi/v/vin.svg)](https://pypi.org/project/vin)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/vin.svg)](https://pypi.org/project/vin)
[![license](https://img.shields.io/github/license/davidpeckham/vin.svg)](https://github.com/davidpeckham/vin/blob/main/LICENSE)


-----

**Table of Contents**
**Contents**

- [Why use VIN?](#why-use-vin)
- [Vehicle Identification Number](#vehicle-identification-number)
- [Vehicle Data](#vehicle-data)
- [Installation](#installation)
- [License](#license)

## Installation
VIN validates Vehicle Identification Numbers and decodes the vehicle's manufacturer, make, model, and model year.

```console
pip install vin
```
>>> from vin import VIN

## License
>>> vin("5FNYF5H59HB011946").manufacturer
Honda

>>> vin("YT9NN1U14KA007175").manufacturer
Koenigsegg

>>> vin("5FNYF5H59HB011946").model_year
2017

## Why use VIN?

- **Accurate** — Vehicle information is provided by the National Highway Traffic Safety Administration.
- **Fast** — Vehicle data is included and periodically updated, so validation and decoding are fast.

## Vehicle Identification Number

A ``VIN`` is a unique 17-character Vehicle Identification Number.

* Assigned by vehicle manufacturers
* Uniquely identifies vehicles manufactured for sale or use in the United States since 1980
* Governed by the U.S. National Highway Traffic Safety Administration (NHTSA)

The structure of the VIN is:

`vin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
model year
|
WMI check digit | plant
|-----| | | | |--- serial ----|
Position 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|-----------| |---------------------|
VDS VIS

The World Manufacturer Identifier (WMI) holds the country, region, and
name of the vehicle manufacturer. Mass-market manufacturers are assigned
a three-character WMI. Specialized manufacturers are assigned a six-
character WMI (positions 1-3 and 12-14)

The Vehicle Description Section (VDS) is defined by manufacturers to
identify the vehicle make, model, body type, engine type, restraints,
and the weight class (for trucks and multi-purpose vehicles).

The Vehicle Identification Section (VIS) identifies the model year,
plant where the vehicle was made, and the vehicle's serial number.

For more information, see the [VIN specification](https://www.ecfr.gov/current/title-49/subtitle-B/chapter-V/part-565).

Installation
------------

Use ``pip`` to install the library:

$ pip install vin

## Vehicle Data

Vehicle data is provided by the U.S. National Highway Traffic Safety Administration (NHTSA) [Product Information Catalog and Vehicle Listing (vPIC)](https://vpic.nhtsa.dot.gov).

## License

More
`VIN` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
20 changes: 0 additions & 20 deletions docs.sphinx/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion docs.sphinx/requirements.txt

This file was deleted.

13 changes: 0 additions & 13 deletions docs.sphinx/source/api.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs.sphinx/source/changelog.rst

This file was deleted.

87 changes: 0 additions & 87 deletions docs.sphinx/source/conf.py

This file was deleted.

31 changes: 0 additions & 31 deletions docs.sphinx/source/index.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/.snippets/abbrs.txt

This file was deleted.

6 changes: 0 additions & 6 deletions docs/.snippets/links.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# VPIC API
# API

::: vin.VIN
options:
Expand Down
9 changes: 9 additions & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Help

## :material-api: API Documentation

The [API documentation](api.md) is the best way to learn what VIN can do for you.

## :simple-github: GitHub Issues

Use [GitHub issues](https://github.com/davidpeckham/vin/issues) to ask questions, report issues, and suggest changes.
5 changes: 5 additions & 0 deletions docs/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import shutil


def copy_history(*args, **kwargs):
shutil.copy("CHANGELOG.md", "docs/changelog.md")
Loading

0 comments on commit aa1e804

Please sign in to comment.