Skip to main content

A module to operate with license plates and its patterns

Project description

License Plate Toolbox

Tests

This project provides a simple way to operate with license plates and its patterns.

Installation

To install the module, just run on the command line:

pip install plates

Module usage

For example, to get the number of possible plates with a given pattern:

from plates import *
combinations("CCCDDD") # 17576000

In the example above, the pattern given corresponds to 3 characters and 3 digits. ABC123 is a plate that matches with this pattern, then:

matches_pattern("CCCDDD", "ABC123") # True

The above pattern can be shortened as "3C3D", meaning 3 chars and 3 digits.

Some standard patterns are already given, and can be accessed through dictionary:

# Argentina's old pattern
STD_PATTERNS["AR-1"] # "CCCDDD"

# Argentina's new pattern
STD_PATTERNS["AR-2"] # "CCDDDCC"

# California pattern
STD_PATTERNS["US-CA"] # "DCCCDDD"

STD_PATTERNS.keys() will show all the patterns provided.

Command line usage

The tools provided can be used directly through the command line, invoking the plates module and passing the function name with it's proper positional or keyword arguments. Here's an example:

python -m plates get_pattern AB5472D

will produce CCDDDDC as the result.

To get a list of all the available functions for the command line, call the module with the -lf or --list-functions flag, and it will print a list of supported functions with its arguments and respective types.

For help using the module via the command line, pass the -h or --help flag.

Some basics examples are:

python -m plates max_plate --pattern CCDDDC
python -m plates get_plate -p CCDDDC -i 168700
python -m plates get_plate_index -pl GA155RT

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

plates-1.0.tar.gz (204.0 kB view hashes)

Uploaded Source

Built Distribution

plates-1.0-py3-none-any.whl (243.5 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