Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Jun 28, 2024
2 parents cc68a83 + 2b9d25c commit 3984bdf
Show file tree
Hide file tree
Showing 19 changed files with 507 additions and 142 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Apply opinionated DMFR format to PRs
on: [pull_request, push]
jobs:
format:
if: github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install transitland-lib
run: scripts/install-transitland-lib.sh
- name: Format in the opinionated DMFR format
run: |
find ./feeds -type f -name "*.dmfr.json" -exec transitland dmfr format --save {} \;
- name: "If any changes: commit and push"
run: |-
git config user.name "Automated Bot"
git config user.email "[email protected]"
if ! git_status_output="$(git status --porcelain)"; then
error_code="$?"
echo "'git status' had an error: $error_code"
exit 1
elif [ -z "$git_status_output" ]; then
echo "Working directory is clean."
else
echo "Working directory has UNCOMMITTED CHANGES."
git add -A
git commit -m "Apply opinionated DMFR format"
git push
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 change: 1 addition & 0 deletions .github/workflows/update-gbfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
git commit -m "Updated GBFS feeds from https://github.com/NABSA/gbfs/blob/master/systems.csv at $(date -u)"
git push --set-upstream origin ${BRANCH_NAME}
gh pr create --title "Automatic update of GBFS feeds" --fill-verbose
gh workflow run validate.yml --ref ${BRANCH_NAME}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Validate
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.db
dmfr.schema.json
.idea/
15 changes: 0 additions & 15 deletions feeds/alerts.goswift.ly.dmfr.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,6 @@
"info_url": "https://goswift.ly/realtime-api-key"
}
},
{
"id": "f-avalon~ca~rt~alerts",
"spec": "gtfs-rt",
"urls": {
"realtime_alerts": "https://api.goswift.ly/real-time/avalon/gtfs-rt-alerts"
},
"license": {
"url": "https://www.goswift.ly/api-license"
},
"authorization": {
"type": "header",
"param_name": "Authorization",
"info_url": "https://goswift.ly/realtime-api-key"
}
},
{
"id": "f-baytowntrolley~fl~rt~alerts",
"spec": "gtfs-rt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
}
],
"license_spdx_identifier": "CDLA-Permissive-1.0"
}
}
43 changes: 33 additions & 10 deletions feeds/gocary.org.dmfr.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,43 @@
"https://data.trilliumtransit.com/gtfs/cary-transit-nc-us/cary-transit-nc-us.zip"
]
},
"license": {
"url": "https://gocary.org/developer-resources",
"use_without_attribution": "no",
"attribution_text": "Except as otherwise noted, the content of this section is licensed under the Creative Commons Attribution 3.0 License"
},
"tags": {
"gtfs_data_exchange": "cary-transit"
},
"operators": [
}
},
{
"id": "f-dnrg-cary~transit~nc~us~rt",
"spec": "gtfs-rt",
"urls": {
"realtime_vehicle_positions": "https://www.gocarylive.org/gtfs/Realtime/GTFS_VehiclePositions.pb",
"realtime_trip_updates": "https://www.gocarylive.org/gtfs/Realtime/GTFS_TripUpdates.pb",
"realtime_alerts": "https://www.gocarylive.org/gtfs/Realtime/GTFS_ServiceAlerts.pb"
}
}
],
"operators": [
{
"onestop_id": "o-dnrg-carytransit",
"name": "GoCary",
"website": "https://gocary.org/",
"associated_feeds": [
{
"onestop_id": "o-dnrg-carytransit",
"name": "Cary Transit",
"short_name": "GoCary",
"website": "https://gocary.org/",
"tags": {
"us_ntd_id": "40143"
}
"feed_onestop_id": "f-dnrg-cary~transit~nc~us"
},
{
"feed_onestop_id": "f-dnrg-cary~transit~nc~us~rt"
}
]
],
"tags": {
"developer_site": "https://gocary.org/developer-resources",
"us_ntd_id": "40143",
"wikidata_id": "Q5005923"
}
}
],
"license_spdx_identifier": "CDLA-Permissive-1.0"
Expand Down
3 changes: 2 additions & 1 deletion feeds/metrodoporto.pt.dmfr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"id": "f-ez3f-metrodoporto",
"spec": "gtfs",
"urls": {
"static_current": "https://www.metrodoporto.pt/metrodoporto/uploads/document/file/550/google_transit_dez2021.zip",
"static_current": "https://www.metrodoporto.pt/metrodoporto/uploads/document/file/693/horarios_gtfs_08_04_2024.zip",
"static_historic": [
"https://www.metrodoporto.pt/metrodoporto/uploads/document/file/550/google_transit_dez2021.zip",
"https://www.metrodoporto.pt/uploads/document/file/470/google_transit.zip"
]
},
Expand Down
47 changes: 47 additions & 0 deletions feeds/mwasalat.om.dmfr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.5.0.json",
"feeds": [
{
"id": "f-mwasalat",
"spec": "gtfs",
"urls": {
"static_current": "https://app.mwasalat.om/tmsp/data/gtfs/gtfs.zip"
},
"languages": [
"ar-OM",
"en-OM"
],
"license": {
"spdx_identifier": "CC-BY-4.0",
"url": "https://opendata.om/2021/odo-open-data-principles/",
"use_without_attribution": "no",
"commercial_use_allowed": "yes",
"attribution_instructions": "Credit the Source and provide a Link to the License"
},
"operators": [
{
"onestop_id": "o-mwasalat~rt",
"name": "Oman National Transport Company",
"short_name": "Mwasalat",
"website": "https://mwasalat.om",
"associated_feeds": [
{
"feed_onestop_id": "f-mwasalat"
},
{
"feed_onestop_id": "f-mwasalat~rt"
}
]
}
]
},
{
"id": "f-mwasalat~rt",
"spec": "gtfs-rt",
"urls": {
"realtime_vehicle_positions": "https://app.mwasalat.om/tmsp/data/gtfs/vehicle-positions.pb",
"realtime_trip_updates": "https://app.mwasalat.om/tmsp/data/gtfs/trip-updates.pb"
}
}
]
}
57 changes: 57 additions & 0 deletions feeds/mychtransit.org.dmfr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://dmfr.transit.land/json-schema/dmfr.schema-v0.5.0.json",
"feeds": [
{
"id": "f-dnru-chapel~hill~transit~nc~us",
"spec": "gtfs",
"urls": {
"static_current": "http://mychtransit.org/gtfs",
"static_historic": [
"https://data.trilliumtransit.com/gtfs/chapel-hill-transit-nc-us/chapel-hill-transit-nc-us.zip"
]
},
"license": {
"use_without_attribution": "yes",
"create_derived_product": "yes"
},
"tags": {
"gtfs_data_exchange": "chapel-hill-transit"
}
},
{
"id": "f-dnru-chapel~hill~transit~nc~us~rt",
"spec": "gtfs-rt",
"urls": {
"realtime_vehicle_positions": "http://mychtransit.org/gtfs-rt/vehiclepositions",
"realtime_trip_updates": "http://mychtransit.org/gtfs-rt/tripupdates",
"realtime_alerts": "http://mychtransit.org/gtfs-rt/alerts"
},
"license": {
"url": "https://gtfs-directory.syncromatics.com/"
}
}
],
"operators": [
{
"onestop_id": "o-dnru-chapelhilltransit",
"name": "Chapel Hill Transit",
"short_name": "CHT",
"website": "https://www.townofchapelhill.org/government/departments-services/transit",
"associated_feeds": [
{
"feed_onestop_id": "f-dnru-chapel~hill~transit~nc~us"
},
{
"feed_onestop_id": "f-dnru-chapel~hill~transit~nc~us~rt"
}
],
"tags": {
"developer_site": "https://gtfs-directory.syncromatics.com/",
"twitter_general": "chapelhillgov",
"us_ntd_id": "40051",
"wikidata_id": "Q5073024"
}
}
],
"license_spdx_identifier": "CDLA-Permissive-1.0"
}
Loading

0 comments on commit 3984bdf

Please sign in to comment.