The scripts in this repository can be used to consume WSDOT Traveler Information API REST endpoints in ArcGIS software.
To install this package onto your computer using pip, use the following command. For more information on installing packages, see the Installing Packages tutorial from the PyPA Python Packaging User Guide.
pip install git+https://github.com/WSDOT-GIS/wsdot-traffic-gp.git
If you are running this command from PowerShell, you will need to have administrator privileges.
Start-Process pip "install git+https://github.com/WSDOT-GIS/wsdot-traffic-gp.git" -Verb RunAs
You can set a default access code, so you don't need to provide it via function parameter or script argument, by setting an environment variable called WSDOT_TRAFFIC_API_CODE
to the default access code.
See the modules' docstrings for more details on how to use the scripts.
This module provides the ability to query the REST endpoints and return the results as a dictionary.
- Note that this script has no ArcGIS dependencies and can be run without any ArcGIS software installed.
- Should run in either v2.7+ or v3.5.2+ of Python.
Consume the REST endpoints and return the results as a file geodatabase.
- Requires ArcPy
- Should work with either ArcGIS Desktop or ArcGIS Pro, and the versions of Python that they come with.
- Downloads data from API
- Creates feature class and tables if not already existing
- If tables exist, truncates them
- Inserts the data into feature classes and tables inside of a file geodatabase.
- Zips the file geodatabase (which is a folder w/
.gdb
extension).
python -m wsdot.traffic.gp.creategdb
or
createwsdottrafficgdb
Downloads data from API and exports JSON files: one with the data and one with automatically detected field definitions.
python -m wsdot.traffic.dumpjson
or
dumpwsdottrafficjson
The example below shows how to run one of the scripts from within the project directory
python -m src.wsdot.traffic.gp.creategdb
These are test scripts for use with the unittest Python module.
The PowerShell scripts are intended for use by developers working on this project and are not used by consumers of the library. Use the Get-Help command for more info on these scripts.