Skip to main content

Library to parse and validate Vietnamese vehicle plate

Project description

Library to parse and validate Vietnamese vehicle plate

Install

pip3 install biensoxe

Usage

Call VietnamVehiclePlate.from_string, passing the number string, to create VietnamVehiclePlate object.

>>> from biensoxe import VietnamVehiclePlate

>>> VietnamVehiclePlate.from_string('44A-112.23')
VietnamVehiclePlate(compact='44A11223', vehicle_type=<VehicleType.DOMESTIC_AUTOMOBILE: 1>,
series='A', order='11223', locality='44', dip_country=None)

The method raises ValueError if the string could not be parsed.

To format the plate number as in daily life, pass VietnamVehiclePlate to str:

>>> plate = VietnamVehiclePlate.from_string('72E101130')

>>> plate
VietnamVehiclePlate(compact='72E101130', vehicle_type=<VehicleType.DOMESTIC_MOTORCYCLE_50_TO_175CC: 3>, series='E1', order='01130', locality='72', dip_country=None)

>>> str(plate)
'72-E1 011.30'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biensoxe-0.8.1.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

biensoxe-0.8.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page