Welcome to mini-project-1’s documentation!¶
This code is open source, and is available on GitHub.
mini-project-1¶
Requirements¶
- Python 3.6+
Overview¶
mini-project-1 is a simple command line interface (CLI) tool for interacting with a database service that provide information similar to popular ride sharing applications.
Installation¶
mini-project-1 can be installed from source by running:
pip install .
Within the same directory as mini-project-1’s setup.py
file.
Usage¶
After installing mini-project-1’s shell can be started by the following console command:
mini-project-1 -i example.db -v
This will create an initial mini-project-1 database named example.db
at
your current directory and will immediately give you a prompt to login to
such database.
To get additional usage help on starting mini-project-1 run the following console command:
mini-project-1 --help
Command Line Use¶
Start the mini-project-1 shell
usage: mini_project_1 [-h] [-r] (-d DATABASE | -i INIT_DATABASE)
[--log-level LOG_LEVEL] [--log-dir LOG_DIR] [-v]
Named Arguments¶
-r, --register | Before reaching the login screen access the registration screen to register a new member to the mini-project-1 database Default: False |
Database¶
-d, --database | Path to an existing SQLITE database file or mini-project-1 to connect to |
-i, --init-database | |
Create a example SQLITE database file for mini-project-1 at the path specified and connect to it |
Logging¶
--log-level | Set the logging output level Default: INFO |
--log-dir | Enable TimeRotatingLogging at the directory specified |
-v, --verbose | Enable verbose logging Default: False |
Mini-Project-1 Shell Command Line Use¶
Below is usage documentation on using the mini-project-1 shell and the various commands associated with it.
Note
For an in-depth look at the mini-project-1 shell please look at the
shell.MiniProjectShell
directly.
book_member¶
Book a member on a ride
usage: book_member email seats price pickup dropoff
Positional Arguments¶
Email of the member who will be booked on the ride | |
seats | The number of seats booked |
price | The cost per seat for the ride |
pickup | Keyword for the pickup location of the ride |
dropoff | Keyword for the dropoff location of the ride |
cancel_booking¶
Cancel a booking
usage: cancel_booking bno
Positional Arguments¶
bno | The booking identification number |
delete_request¶
Delete a ride request by rid
usage: delete_request rid
Positional Arguments¶
rid | The ID of the ride request to delete |
List all the bookings that you offer
usage: list_bookings
offer_ride¶
Offer a ride
usage: offer_ride [--cno [CNO]] [--enroute ENROUTE [ENROUTE ...]]
date seats price luggage src dst
Positional Arguments¶
date | Date the ride should start on (eg: 1975-05-21T22:00:00) |
seats | The number of seats offered |
price | The amount you want per seat for the ride |
luggage | Description of car luggage |
src | Keyword for the start location of the ride |
dst | Keyword for the end location of the ride |
Named Arguments¶
--cno | Your car number to use |
--enroute | Enroute locations to go to Default: set() |
post_request¶
Post a ride request
usage: post_request date pickup dropoff price
Positional Arguments¶
date | Date the ride should start on (eg: 1975-05-21T22:00:00) |
pickup | The location code for the pickup location of the ride |
dropoff | The location code for the dropoff location of the ride |
price | The maximum amount you are willing to pay per seat for the ride |
search_requests_lcode¶
Search ride requests by location code
usage: search_requests_lcode lcode
Positional Arguments¶
lcode | The location code to search by |
search_requests_city¶
Search ride requests by city name
usage: search_requests_city city
Positional Arguments¶
city | The name of the city to search by |
search_rides¶
Search for a ride and if one is selected sent a message of intent to join
usage: search_rides term1 [term2] [term3]
Positional Arguments¶
term1 | Location search term to use to look rides |
term2 | Location search term to use to look rides |
term3 | Location search term to use to look rides |