Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: docs

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v5
- run: uv sync --group docs
- run: uv run mkdocs build
- if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions docs/api/gtfs/enqueue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Enqueue Utils

This page documents enqueue functions in the GTFS module.

::: ingestor.chalicelib.gtfs.enqueue
rendering:
show_root_heading: true
8 changes: 8 additions & 0 deletions docs/api/gtfs/gtfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# GTFS Overview

This page documents the main `gtfs` module.

::: ingestor.chalicelib.gtfs
rendering:
show_root_heading: true
show_root_full_path: true
7 changes: 7 additions & 0 deletions docs/api/gtfs/ingest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GTFS Ingest

This page documents ingest functions in the GTFS module.

::: ingestor.chalicelib.gtfs.ingest
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/gtfs/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GTFS Utils

This page documents utility functions in the GTFS module.

::: ingestor.chalicelib.gtfs.utils
rendering:
show_root_heading: true
8 changes: 8 additions & 0 deletions docs/api/service_ridership_dashboard/gtfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Service Ridership Dashboard GTFS

This page documents gtfs functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.gtfs
rendering:
show_root_heading: true
show_root_full_path: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/ingest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Ingest

This page documents ingest functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.ingest
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Queries

This page documents query functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.queries
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/ridership.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Ridership

This page documents ridership functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.ridership
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/s3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard S3

This page documents S3 functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.s3
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/service_levels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Service Levels

This page documents service level functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.service_levels
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/service_summaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Service Summary

This page documents service summary functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.service_summaries
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Summary

This page documents summary in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.summary
rendering:
show_root_heading: true
7 changes: 7 additions & 0 deletions docs/api/service_ridership_dashboard/time_series.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Service Ridership Dashboard Time Series

This page documents time series functions in the Service Ridership Dashboard module.

::: ingestor.chalicelib.service_ridership_dashboard.time_series
rendering:
show_root_heading: true
24 changes: 24 additions & 0 deletions docs/index.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just use the README? Or does it require being copied?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question! Apparently we can reference the README instead of copying. I hadn't thought of that so thanks!

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# data-ingestion

![lint](https://github.com/transitmatters/data-ingestion/workflows/lint/badge.svg?branch=main)
![test](https://github.com/transitmatters/data-ingestion/workflows/test/badge.svg?branch=main)
![deploy](https://github.com/transitmatters/data-ingestion/workflows/deploy/badge.svg?branch=main)

This is an app that can host all our data crunching jobs, especially those that use s3.

It uses Chalice, which makes it easy to add new functions that can be triggered on an interval or via rest API endpoint.

So far we have:

- Store MBTA Alerts data daily.
- Store number of trips with new trains on Orange and Red line daily.
- Store Bluebikes station status data every 5 min.
- Store ridership data
- Process and store speed restrictions

To add a new lambda function, put the methods you need in a new file in chalicelib/.
Then add your trigger in app.py.
Then, add a policy.json file for any permissions you might need in .chalice/, updating .chalice/config.json accordingly.
Lastly, if you need secret environment variables, update resources.json and make sure they are passed
with --parameter-override in the cloudformation deploy step of deploy.sh.
(Non-secret envvars can be added to config.json directly.)
73 changes: 73 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
site_name: Data Ingestion
site_description: Automated data crunching jobs by TransitMatters
site_url: https://transitmatters.github.io/data-ingestion
repo_url: https://github.com/transitmatters/data-ingestion
repo_name: transitmatters/data-ingestion

theme:
name: material
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: red
accent: indigo
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: deep purple
accent: amber
toggle:
icon: material/brightness-4
name: Switch to light mode
features:
- content.code.copy
- navigation.sections
- navigation.expand
- toc.follow

markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- toc:
permalink: true

plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [src]
options:
show_source: true
show_root_heading: true
members_order: source
docstring_style: google

nav:
- Home: index.md
- API Reference:
- GTFS:
- Overview: api/gtfs/gtfs.md
- Utils: api/gtfs/utils.md
- Ingest: api/gtfs/ingest.md
- Enqueue: api/gtfs/enqueue.md
- Service Ridership Dashboard:
- GTFS: api/service_ridership_dashboard/gtfs.md
- Ingest: api/service_ridership_dashboard/ingest.md
- Queries: api/service_ridership_dashboard/queries.md
- Ridership: api/service_ridership_dashboard/ridership.md
- S3: api/service_ridership_dashboard/s3.md
- Service Levels: api/service_ridership_dashboard/service_levels.md
- Service Summaries: api/service_ridership_dashboard/service_summaries.md
- Summary: api/service_ridership_dashboard/summary.md
- Time Series: api/service_ridership_dashboard/time_series.md
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ dev = [
"pytest~=9.0.1",
"pre-commit>=4.4.0",
]

docs = [
"mkdocs-material>=9.6",
"mkdocstrings[python]>=0.27",
]
[tool.uv]
package = false

Expand Down
Loading