This Airbyte Connector uses the HTTP API provided by the Pennsylvania DOT in Python. With this connector, data is easily pulled from Pennsylvania DOT and loaded into the ViaWarn Postgres database, and are available in the ViaWarn app.
The connector is built on top of the Airbyte open-source platform, which provides a standardized way of integrating data sources and destinations. It is designed to be simple and easy to use. The required configuration is show in the the sections below.
The pulled resources from the PENN DOT API are the following:
After creating the Airbyte connector template, modify the next files to retrieve data from Pennsylvania DOT .
documentationUrl: https://docsurl.com
connectionSpecification:
$schema: http://json-schema.org/draft-07/schema#
title: VIAWARN USA PA DOT - Spec
type: object
description: Credentials obtained from https://www.penndot.pa.gov/Doing-Business/OnlineServices/Pages/Developer-Resources-DocumentationAPI.aspx
required:
- username
- password
properties:
username:
type: string
airbyte_secret: true
password:
type: string
airbyte_secret: true
BasicHttpAuthenticator:
type: object
additionalProperties: true
required:
- username
- password
properties:
"$options":
"$ref": "#/definitions/$options"
username:
type: string
password:
type: string
{
"username":"[username]"
"password":"[password]"
}
{
"streams":
[
{
"stream": {
"name": [STREAM_NAME],
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh", "destination_sync_mode": "overwrite"
}
]
}
Location: source-viawarn-us-pa-dot/source.py
This field is the common part of the URL for all streams.
String
Pagination is not provided by this API.
return None
return an empty dictionary
It is a placeholder to store the request.response object and constructs the appropriate mapping object for each parsed element by each Stream class.
yields an empty dictionary.
Unique field required in the stream associate to each output record.
String
subdomain and parameters to pass into the URL.
return a string
Definition of how a response is parsed.
Set a definition to: primary key and ewkt fields.
return an iterable containing each record in the response.
Set up a test to verify the connection between the connector and the API. This test should return two variables: the first one is a boolean that indicates the status of the connection, while the second one shows a log message if the connection fails.
return True, None