The predictor "Pico y Placa" is a program written in Python language that predicts whether a car will be able to circulate on the streets on a date and time specified by the user through the command-line interface (CLI). To develop this application we consider the past rules of the Pico&Placa.
Day | Censored plates |
---|---|
Monday | Plates ending in 1 and 2. |
Tuesday | Plates ending in 3 and 4. |
Wednesday | Plates ending in 5 and 6. |
Thursday | Plates ending in 7 and 8. |
Friday | Plates ending in 9 and 0. |
Saturday | Free circulation all day. |
Sunday | Free circulation all day. |
Traffic limitation hours are from 07:00 to 09:30 and from 16:00 to 19:30, from Monday to Friday, according to the last digit of the license plate.
-
The class
Car
insidecar.py
, has all the logical methods of the program. The class is composed of three attributes:license plate
,date
andtime
. -
A specific output is presented depending on the inputs of the
main.py
. -
Also,
schedule.py
has the methods to convert the date input from string datatype to object datatype and then get the day in string datatype. -
test_car.py
is the validator script. Only run it to verify the program.
Please, check if you have Python installed on your machine.
python --version
If not, download and install it.
This program was developed on Debian 11 OS with Python 3.9.2 version.
The following program is based on Daniel Erazo's Pico y Placa Predictor under MIT License.
-
Open your CLI and run
main.py
file from the container directory.python main.py
-
Enter only the alphanumeric characters of the license plate.
-
Enter the date in format
dd/mm/yyyy
. -
Enter the time in 24 hours format
hh:mm
. -
The result of the query is displayed on the screen.