parKING is a desktop app that helps drivers choose the best place to park via the Command Line Interface (CLI). parKING allows users to search, save and look at carpark availability information at a glance, while interfacing with LTA’s real-time API. Whenever you launch parKING, it automatically gets the latest carpark availability and updates the local data immediately. The best part about parKING is that it can be used offline (based on the data you have saved the last time you are connected to the internet).
With parKING, you can plan your parking destination in advance or simply check lot availability before you leave. We strive to become your driving companion, keeping you at ease while ensuring that your vehicle will always get a parking lot when you arrive at your destination. We got you and your loved ones parked!
We understand that an API key is something personal and should not be shared with everyone. However, for the purpose of NUS CS2113, we have provided a default API key for testing purposes. This default API key will be removed at the end of module in Q4 2022.
java -jar parKING.jar
to start the program!resources
to store local data files.auth API_KEY
.find CARPARK_ID
.filter QUERY
.favourite CARPARK_ID
/unfavourite CARPARK_ID
to add / remove certain carparks into your favourite list.See more details in the Features Section below.
Notes about the command format:
- Words in
UPPER_CASE
are the parameters supplied by the user.
Command | Shortcuts | Description |
---|---|---|
auth API_KEY |
a API_KEY |
Authenticate API using user’s API key |
auth default |
a default |
Authenticate API using default key |
auth status |
a status |
Authentication status |
find CARPARK_ID |
fin CARPARK_ID |
Find number of lots available by carpark ID |
filter QUERY |
fil QUERY |
Filter carparks based on address |
filter -id QUERY |
fil -id QUERY |
Filter carparks based on carpark ID |
list |
l |
Get a list of available carparks on the app |
update |
u |
Update data from API |
favourite CARPARK_ID |
fav CARPARK_ID |
Favourite carparks by carpark ID |
unfavourite CARPARK_ID |
ufav CARPARK_ID |
Unfavourite carparks by carpark ID |
favourite list |
fav list |
List lot availability of favourite carparks |
help |
h |
List all possible commands |
exit |
e |
Exiting the program |
Authenticate and subscribe to the API Service (LTA Data Mall) using the user’s API key.
Format :
auth API_KEY
ora API_KEY
API_KEY
is case-sensitive and unique.auth
to change the current key. Only one and the most recent key will be stored.Example of usage:
Input (assuming 12345678 is a valid API key)
auth 12345678
Output
2316 rows of carpark data received from LTA!
Authenticated successfully.
Authenticate using the default API key.
Format:
auth default
ora default
Example of usage:
Input
auth default
Output
2316 rows of carpark data received from LTA!
Authenticated successfully using default API Key.
Get the status of the API key authentication status.
Format:
auth status
ora status
Example of usage:
Input
auth status
Output
You have authenticated your API key successfully. API key stored in the local file
is ********
You have not authenticated your personal API key. Currently you have access to the
API but you are using our default key!
Returns detailed information about the carpark that the user has chosen to find.
Format:
find CARPARK_ID
orfin CARPARK_ID
find
is case-insensitive and will find the carpark with the correct ID even if lowercase is used.Example of usage:
Input:
find a9
Output:
===========================================
BLK 202/203 ANG MO KIO STREET 22
===========================================
Carpark code: A9
Favourited: No
Number of available lots (total): 52
Cars: 52 lots
Motorcycles: 0 lots
Heavy Vehicles: 0 lots
Last Updated: 04-11-2022 19:28:10
===========================================
Shows a summarised list of carparks that match a given query based on its address.
Format:
filter QUERY
,fil QUERY
(dashed argument-address
optional)
BLK 208 CLEMENTI AVE 6
- a query of clementi
or 208
will return this
carpark as one of its results.clementi ave
will
also give the above carpark as one of its results. The carparks displayed will have matches for all the space-separated words in the query.filter
command also matches substrings at the beginning of a word. Following the previous
example, clem
will also match the above carpark, but ti
will not.Note: The
filter
command allows for dashed arguments-address
and-id
to switch modes, but if none is provided it defaults to address mode above.
Related: Filter carparks based on carpark ID
Example of usage:
Input:
filter clem ave 2
Output:
CarparkID C28M at BLK 208 CLEMENTI AVE 6
--> 233 available lots total
CarparkID C5 at BLK 358-360,362-363,366-367 CLEMENTI AVE 2
--> 173 available lots total
CarparkID C6 at BLK 328-334 CLEMENTI AVE 2
--> 129 available lots total
CarparkID C7 at BLK 349-355 CLEMENTI AVE 2
--> 223 available lots total
CarparkID C8 at BLK 335/338 CLEMENTI AVE 2
--> 240 available lots total
Shows a summarised list of carparks that match a given query.
Format:
filter -id QUERY
orfil -id QUERY
find
command, the filter -id
command displays a list of partial matches as well as full matches. For example, a carpark with ID A35
can be matched by fil -id A
or fil -id 35
.filter
command in address mode, rather than matching all words in the query, a carpark only needs to match one or more words in the query.filter -id
command also matches substrings anywhere in the ID. For example, any of A35
, a
or 5
will match the above carpark.Note: To use the
filter
command in ID mode, a dashed argument-id
is required.
Related: Filter carparks based on address
Example of usage:
Input:
filter -id 7a 8a
Output:
CarparkID B7A at BLK 216/218 BEDOK NORTH ST 1
--> 0 available lots total
CarparkID C18A at BLK 426/427 CLEMENTI AVE 3
--> 25 available lots total
CarparkID CK8A at BLK 203A CHOA CHU KANG AVE 1/CENTRAL
--> 297 available lots total
CarparkID T47A at BLK 864B TAMPINES STREET 83
--> 123 available lots total
Returns a list of all the available carparks stored in parKING.
Format:
list
orl
Note: This produces a very long list with Carpark ID in alphabetical order, and result in a long output in your terminal. Do not use if you need to refer to output already printed to the console before this.
Example of usage:
Input:
list
Output:
CarparkID T0129 at TANJONG KATONG COMPLEX
182 available lots total
CarparkID KU1 at BLK 301/305-306/311-318 UBI AVENUE 1
376 available lots total
CarparkID SAM2 at BLK 61 STRATHMORE AVENUE
302 available lots total
CarparkID HG80 at BLK 941A HOUGANG STREET 92
730 available lots total
Fetches the most updated availability data and stores it locally.
Format:
update
oru
Note: Tampering with the
.json
files generated can result in the data fetched from theupdate
command to be skipped and not loaded in. For more information seeltaResponse.json
andltaResponseSample.json
JSON files from the API
Example of usage:
Input
update
Output
2316 rows of carpark data received from LTA!
Update Successful.
Saves the carpark to a list of favourited carparks for easy subsequent access.
Format:
favourite CARPARK_ID
orfav CARPARK_ID
Example of usage:
Input (assuming carpark ID 1 is not favourited):
favourite 1
Output:
Added Carpark 1 to favourites!
Input (assuming carpark ID J8 is already favourited):
favourite J8
Output:
Carpark already in list.
Nothing to add to favourites!
Input:
favourite not_a_carpark_ID
Output:
No carpark was found.
For advanced users:
- Favourite multiple carparks at once by entering more than one carpark ID after
favourite
.- Example of usage:
favourite 1 2 J8
Removes the carpark from a list of favourited carparks.
Format:
unfavourite CARPARK_ID
orufav CARPARK_ID
Example of usage:
Input (assuming carpark ID 1 is favourited):
unfavourite 1
Output:
Removed Carpark 1 from favourites!
Input (assuming carpark ID M32 is not favourited):
unfavourite M32
Output:
Some carparks not found in favourite list! Skipping...
Nothing to remove from favourites!
For advanced users:
- Unfavourite multiple carparks at once by entering more than one carpark ID after
unfavourite
.- Example of usage:
unfavourite 3 4 5
Displays the name, ID and total lot availability of all favourite carparks.
Format:
favourite list
orfav list
Example of usage:
Input:
favourite list
Output:
CarparkID D0006 at DUXTON HILL OFF STREET: 104 lots available
===========================================
CarparkID CKM6 at BLK 462A CHOA CHU KANG AVE 4: 1606 lots available
===========================================
CarparkID A9 at BLK 202/203 ANG MO KIO STREET 22: 102 lots available
===========================================
CarparkID J8 at BLK 232/240 JURONG EAST ST 21: 318 lots available
===========================================
Returns a list of all the available command of the program.
Format :
help
orh
Example of usage:
Input:
help
Output
Here are the list of available commands to use! Refer to the user guide at
https://ay2223s1-cs2113-t17-4.github.io/tp/UserGuide.html for more information.
`help` or `h` : To display all possible commands.
`exit` or `e` : To quit parKING.
`list` or `l` : List the carparks and its details.
`auth API_KEY` or `a API_KEY` : To authenticate your personal API key.
`auth default` or `a default` : To authenticate using the default key provided
by parKING.
`auth status` or `a status` : To get the authentication status.
`update` or `u` : To fetch the latest data from LTA.
`filter QUERY` or `fil QUERY` : Filter carparks based on Carpark information.
`filter -address QUERY` or `fil -add QUERY` : Filter carparks based on its
Carpark address.
`filter -id QUERY` or `fil -id QUERY` : Filter carparks based on its Carpark ID.
`find CARPARK_ID` or `fin CARPARK_ID` : Display information about the specific
queried carpark based on carpark ID.
`favourite list` or `fav list` : To get the list of favourited carparks.
`favourite CARPARK_ID` or `fav CARPARK_ID` : Favourite carpark by its ID.
`unfavourite CARPARK_ID` or `ufav CARPARK_ID` : Unfavourite carpark by its ID.
Terminates the program.
Format:
exit
ore
Input:
exit
Output
Exiting program.
Goodbye.
Advanced users may want to enter data more efficiently, or customise the data in ways currently not possible through the CLI. For example, you may want to enter favourites without the need to run the program in a command prompt, or edit the names of carparks for convenient finding. Below are the various files generated by parKING.
NOTE: Please do not tamper with the files with permissions settings, e.g. making them read-only or hidden. For parKING to function it must be able to read and write to all files it generates.
If no files exist at the time of running the program, the necessary files and directories will be created within the directory that the .jar file was run from.
favourites.txt
Favourites listLocation: .\resources\api\favourite\favourite.txt
favourite
and unfavourite
command.favourite
and unfavourite
command.favourite
or unfavourite
command.favourite
or unfavourite
command.secret.txt
Access token fileLocation: .\resources\api\secret.txt
carparkList.txt
Carparks listLocation: .\resources\carparkList.txt
carparksList.txt
contains data for all the carparks found in the program. It reflects the data stored within the program that is used by the commands.update
command is called.Each row corresponds to one carpark, and fields can be edited and retained to be updated. For example, a
carpark with a development of BLK 309 CLEMENTI AVE 1
can be renamed to Mum's place
, and future updates to this file
will retain that information for easy tracking and use within the program.
The carparkList.txt
file is only loaded at initialisation, and should only be edited while the program is not open. Editing the carparkList.txt
file while
the program is running will result in your changes being overwritten.
Any files with invalid format will be erased and written over with a valid format from within the program. Please make sure that the format is strictly adhered to or risk losing all your data.
Note: Updating this file requires both the incoming carpark data and the existing data to have the same Carpark ID. Changing the Carpark ID is not recommended, and files with duplicate Carpark ID will be discarded and regenerated.
Format of one row in the carparkList.txt
file is shown below:
1 || Marina || Suntec City || 1.29375 103.85718 || 1051 || 1051 0 0 || false ||
LTA || 04-11-2022 19:28:10
||
.a
, B
, ABCDE
.1
, 34
, 340
.A5
, p3
, abc123
.5A
, 3b
, 123abc
.A5R
, p3NBC
, B132A
.35A9
, 29+A_
.||
.||
.||
.0
.Car
, Motorcycle
, Heavy Vehicle
.0
.favourites.txt
to change the favourites list.DD-MM-YY HH:MM:SS
format, and must be a valid date-time (36:99:99
is an invalid time).update
command.||
or not enough delimiters will result in an invalid format.ltaResponse.json
and ltaResponseSample.json
JSON files from the APIWARNING: These are raw files generated from data fetched from the API, and are not recommended to be edited. Any files with formatting errors will be deleted completely and will not be loaded in to the program. As such, editing these files is unsupported.
ltaResponse.json
is a file with data generated by the API over the internet, fetched whenever update
is used or on initialisation of the program. If the program fails to fetch data from the API, or it is in an incorrect format, this file will be skipped and not loaded in.
ltaResponseSample.json
is backup data generated from the program internally, meant as a “demo mode” to test and use parKING’s features offline if there isn’t an internet connection. If the program fails to load properly the data from ltaResponse.json
, data from ltaResponseSample.json
is loaded in instead.
If both .json
files produce errors, a valid ltaResponseSample.json
file is regenerated from within the program and then loaded in.
Do not edit these files unless you know what you are doing. Edit the
carpark.txt
file instead if you would like to change details about the carparks.
Q: How is the data for the carparks stored? Can I change or edit this data?
A: The carpark data is first fetched in a .json
format, under
.\resources\api\ltaResponse.json
. Then, this carpark data is written
to a .txt
file at .\resources\carparkList.txt
. If you wish to manually edit any
carpark data, you can do so as long as the format is maintained. These changes will be reflected
when you restart the program.
Command | Shortcuts | Description |
---|---|---|
auth API_KEY |
a API_KEY |
Authenticate API using user’s API key |
auth default |
a default |
Authenticate API using default key |
auth status |
a status |
Authentication status |
find CARPARK_ID |
fin CARPARK_ID |
Find number of lots by carpark ID |
filter QUERY |
fil QUERY |
Filter carparks based on address |
filter -id QUERY |
fil -id QUERY |
Filter carparks based on carpark ID |
list |
l |
Get a list of available carparks on the app |
update |
u |
Update data from API |
favourite CARPARK_ID |
fav CARPARK_ID |
Favourite carparks by carpark ID |
unfavourite CARPARK_ID |
ufav CARPARK_ID |
Unfavourite carparks by carpark ID |
favourite list |
fav list |
List lot availability of favourite carparks |
help |
h |
Lists all possible commands |
exit |
e |
Exiting the program |