Giter Site home page Giter Site logo

predictor_ecu_pico_y_placa_quito's Introduction

Pico Y Placa Quito Ecuador Predictor

A "Pico y Placa" predictor. The inputs are a license plate number (the full number, not the last digit), a date (as a string), and a time (as a string). The program returns whether or not that car can be on the road on the specified date and time. This predictor is developed according to the regulations of the Municipal Ordinance of Quito No. 0305.

Requirements

The following libraries are required:

If you wish to use the abstract Public Holidays API, save the API key in the enviroment variable HOLIDAYS_API_KEY. Note that this API excludes the rules of Reform Law to the LOSEP (in force since December 21, 2016 /R.O # 906) related to the Holidays in Ecuador. Nevertheless, the offline mode of the “Pico y Placa” predictor considers all rules of the law mentioned above.

Usage

usage: pico_y_placa.py [-h] [-o] -p PLATE -d DATE -t TIME

Pico y Placa Quito Predictor: Check if the vehicle with the provided plate can be on the road on the provided date and time

optional arguments:
  -h, --help            show this help message and exit
  -o, --online          use abstract's Public Holidays API
  -p PLATE, --plate PLATE
                        the vehicle's plate: XXX-YYYY or XX-YYYY, where X is a capital letter and Y is a digit
  -d DATE, --date DATE  the date to be checked: YYYY-MM-DD
  -t TIME, --time TIME  the time to be checked: HH:MM

Format of the input data

Plate: following the Ecuador car license plate format, the parameter “Plate” should have this format: XXX-YYYY (commercial, government, official, and private vehicles) or XX-YYYY (diplomatic service and temporary hospitalization vehicles), where X is a capital letter, and Y is a digit. Examples: EBA-0234, CC-0012.

Date: considering the ISO 8601, the parameter “Date” should have the following format: YYYY-MM-DD. Examples: 2021-04-24, 2020-09-10.

Time: the time must always be represented under the 24h system, that is, the number of hours that have elapsed since midnight. The 12h format is not allowed. Format: HH:MM, where HH and MM should be composed of two digits, respectively. Examples: 12:30, 21:10, 09:05, 00:00 (midnight).

To use the abstract Public Holidays API add the flag -o or --online. Otherwise, the predicator will use the class “HolidayEcuador” to check if a date is a holiday or not.

Example

$ python pico_y_placa.py -p EBA-0234 -d 2021-04-23 -t 15:15
The vehicle with plate EBA-0234 CAN be on the road on 2021-04-23 at 15:15.

$ python pico_y_placa.py -p EBA-0234 -d 2021-04-27 -t 17:00
The vehicle with plate EBA-0234 CANNOT be on the road on 2021-04-27 at 17:00.

Automated Testing

To perform automated testing using the unittest framework run: python test.py

License

This project is licensed under the MIT License - see the LICENSE file for details

predictor_ecu_pico_y_placa_quito's People

Contributors

mmacas11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.