Skip to content

Commit

Permalink
v0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpeckham committed Feb 25, 2024
1 parent a169e14 commit 1d5efeb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

## v0.42 (2024-02-24)
## v0.4.3 (2024-02-25)

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

### New Features

* VIN.vpic_version returns NHTSA vPIC data version and release date (https://github.com/davidpeckham/vin/issues/4).

## v0.4.2 (2024-02-24)

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

Expand All @@ -9,7 +17,7 @@
* Uses WMI to find vehicle make when VIN is incomplete or incorrect.
* Series and trim decoding is more reliable

## v0.41 (2024-02-21)
## v0.4.1 (2024-02-21)

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

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
## Why use VIN?

- **Accurate** — Uses U.S. National Highway Traffic Safety Administration vehicle data.
- **Fast** — Validate and decode 1,500 VINs per second.
- **Fast** — Validate and decode hundreds of VINs per second.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion src/vin/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024-present David Peckham <[email protected]>
#
# SPDX-License-Identifier: MIT
__version__ = "0.4.2"
__version__ = "0.4.3"
19 changes: 17 additions & 2 deletions src/vin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from vin.constants import VIN_LENGTH
from vin.constants import VIN_MODEL_YEAR_CHARACTERS
from vin.constants import VIN_POSITION_WEIGHTS
from vin.database import decode_vin, get_vpic_version
from vin.database import decode_vin
from vin.database import get_vpic_version


class DecodingError(Exception):
Expand Down Expand Up @@ -589,7 +590,21 @@ def _decode_vin(self) -> None:
self._electrification_level = vehicle.get("electrification_level", "")

@classmethod
def version(cls):
def vpic_version(cls) -> dict[str, str]:
"""Return vPIC snapshot version and release date.
NHTSA releases monthly vPIC snapshots as SQL Server backups. A subset
of that data is bundled with this package.
Returns:
dict: The vPIC version, release date, effective date, and URL
Examples:
>>> VIN.vpic_version()
{'version': '3.44', 'released': '2024-02-17', 'effective': '2024-02-16T19:41:08+00:00',
'url': 'https://vpic.nhtsa.dot.gov/api/vPICList_lite_2024_02.bak.zip'}
"""
return get_vpic_version()

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


def test_version():
version = VIN.version()
version = VIN.vpic_version()
assert version["version"] == "3.44"
assert version["released"] == "2024-02-17"

0 comments on commit 1d5efeb

Please sign in to comment.