34 Commits

Author SHA1 Message Date
Lucas Oskorep 0e9548801e Update LICENSE copyright to Lucas Oskorep 2026-02-27 19:14:14 -05:00
Lucas Oskorep f8a5d5ab8e Add LICENSE.txt with GPL-3.0-only license and update package.json 2026-02-27 19:11:44 -05:00
Lucas Oskorep 94abb7388b feat: remove useless comments and fix
Build and Push Docker Image / build (pull_request) Successful in 3m9s
2026-02-01 03:33:50 -05:00
Lucas Oskorep c1f940fa57 nit: update comment
Build and Push Docker Image / build (pull_request) Failing after 32s
2026-02-01 02:58:49 -05:00
Lucas Oskorep 03e8fa18f3 feat: fixing package dependencies
Build and Push Docker Image / build (pull_request) Failing after 15s
2026-02-01 01:55:09 -05:00
Renovate Bot a7861455d9 chore(deps): update all-dependencies
Build and Push Docker Image / build (pull_request) Failing after 16s
2026-01-30 20:02:26 +00:00
Lucas Oskorep 5c2111040c Merge pull request 'chore: Configure Renovate' (#2) from renovate/configure into main
Build and Push Docker Image / build (push) Successful in 3m13s
Reviewed-on: #2
2026-01-29 02:28:14 -05:00
Renovate Bot dcf53d101c Add renovate.json
Build and Push Docker Image / build (pull_request) Successful in 3m4s
2026-01-29 07:21:08 +00:00
Lucas Oskorep c7f1e6ab2d nit: update comment
Build and Push Docker Image / build (push) Successful in 3m3s
2026-01-20 23:20:26 -05:00
Lucas Oskorep 7cea369e04 feat: add platforms back to build command
Build and Push Docker Image / build (push) Has been cancelled
2026-01-20 23:18:06 -05:00
Lucas Oskorep 4baf27ca1a feat: gitea debugging
Build and Push Docker Image / build (push) Successful in 47s
2026-01-20 23:17:05 -05:00
Lucas Oskorep 0a394aac33 feat: gitea debugging
Build and Push Docker Image / build (push) Failing after 10s
2026-01-20 23:15:07 -05:00
Lucas Oskorep caefa5eb5b fix: dockerfile reference post refactor
Build and Push Docker Image / build (push) Has been cancelled
2026-01-20 23:04:59 -05:00
Lucas Oskorep 7f7674a13b feat: update runs-on
Build and Push Docker Image / build (push) Has been cancelled
2026-01-20 23:03:41 -05:00
Lucas Oskorep d6968da3ce feat: update runs-on
Build and Push Docker Image / build (push) Failing after 1m50s
2026-01-20 23:00:49 -05:00
Lucas Oskorep 41174b5557 feat: gitea
Build and Push Docker Image / build (push) Has been cancelled
2026-01-20 22:59:23 -05:00
Lucas Oskorep 63897eca0c feat: remove old ui of doom 2026-01-20 22:55:20 -05:00
Lucas Oskorep 33c7a108e2 feat: finish readme and add swagger 2026-01-20 22:50:05 -05:00
Lucas Oskorep dc8a2c9d3e feat: update readme with screenshot and fix end station bug 2026-01-20 22:45:43 -05:00
Lucas Oskorep fb65b607af feat: update readme with screenshot and fix end station bug 2026-01-20 22:45:04 -05:00
Lucas Oskorep 1e420b9375 Merge pull request #2 from lucasoskorep/feat/readme-and-examples
Readmes and Examples
2026-01-20 22:29:23 -05:00
Lucas Oskorep d97a9ef01c feat: documentation and readme 2026-01-20 22:28:00 -05:00
Lucas Oskorep be2b2ecbac feat: documentation and readme 2026-01-20 22:25:25 -05:00
Lucas Oskorep e8ab6cf69d Merge pull request #1 from lucasoskorep/feat/refactor-to-use-protobufs
Feat/refactor to use protobufs
2026-01-20 21:54:11 -05:00
Lucas Oskorep 28a84293c9 feat: rework to use next and host from single dockerfile 2026-01-20 21:48:33 -05:00
Lucas Oskorep dae0625278 shifting-git-host 2024-03-26 02:21:16 -04:00
Lucas Oskorep 77b6b247cc feat: adding dockerfiles to justfile 2024-02-11 03:02:41 -05:00
lucas.oskorep 9aa9122e2b feat: adding openapi spect generation to the frontend client aas well as to fast api. Broke API out into different routes 2023-07-17 02:51:13 -04:00
lucas.oskorep 4a20152ff5 feat: adding openapi spect generation to the frontend client aas well as to fast api. Broke API out into different routes 2023-07-17 02:07:41 -04:00
lucas.oskorep add28cafc6 adding reworked header bar to nextjs frontend UI 2023-07-11 16:28:53 -04:00
lucas.oskorep d24a340c15 adding next.js app which calls the fastAPI AND displays date in the app. 2023-07-10 21:21:41 -04:00
lucas.oskorep aad7babb2c migrating to react and nextjs 2023-07-10 20:51:10 -04:00
lucas.oskorep a287cccb38 adding gitignore for next js app 2023-07-10 18:53:08 -04:00
lucas.oskorep fc78dc7e0e migration to fast-api 2023-07-10 18:43:43 -04:00
108 changed files with 9761 additions and 13895 deletions
+64
View File
@@ -0,0 +1,64 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
env:
IMAGE_NAME: pi-mta-sign
jobs:
build:
runs-on: archlinux
container:
image: docker:cli
steps:
- name: Install dependencies
run: |
apk add --no-cache nodejs npm git
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Log in to Container Registry
if: gitea.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: gitea.chaosdev.gay
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: gitea.chaosdev.gay/${{ gitea.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+65
View File
@@ -0,0 +1,65 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
env:
IMAGE_NAME: pi-mta-sign
jobs:
build:
runs-on: ${{ vars.RUNNER || 'ubuntu-latest' }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY || 'ghcr.io' }}
username: ${{ vars.REGISTRY_USERNAME || github.actor }}
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.REGISTRY || 'ghcr.io' }}/${{ vars.IMAGE_OWNER || github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
+4
View File
@@ -125,3 +125,7 @@ venv.bak/
dmypy.jsons
.ruff_cache
# Frontend build output
static/
mta-sign-ui/out/
+1
View File
@@ -0,0 +1 @@
25.5.0
+33
View File
@@ -0,0 +1,33 @@
FROM docker.io/library/node:25 AS frontend-builder
LABEL authors="lucasoskorep"
WORKDIR /build/mta-sign-ui
COPY mta-sign-ui/package.json mta-sign-ui/pnpm-lock.yaml* ./
RUN npm install -g pnpm
COPY mta-sign-ui/ ./
RUN pnpm install
RUN pnpm build
FROM ghcr.io/astral-sh/uv:python3.13-bookworm
LABEL authors="lucasoskorep"
WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev --no-install-project
COPY mta_api_client ./mta_api_client
COPY mta_sign_server ./mta_sign_server
COPY main.py stops.txt ./
COPY --from=frontend-builder /build/mta-sign-ui/out ./static
RUN uv sync --frozen --no-dev
EXPOSE 8000
ENTRYPOINT ["uv", "run", "python", "main.py"]
+307
View File
@@ -0,0 +1,307 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7.
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices.
A compilation of a covered work with other separate and independent
works is called an "aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.
12. No Surrender of Others' Freedom.
If conditions are imposed on you that contradict the conditions of this License, they do not
excuse you from the conditions of this License.
13. Use with the GNU Affero General Public License.
You have permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER BE LIABLE TO YOU FOR DAMAGES.
17. Interpretation of Sections 15 and 16.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program:
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> Lucas Oskorep
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
========================================================================
Copyright (C) YOUR NAME 2024
Licensed under the GNU General Public License Version 3 (GPL-3.0-only).
This program is free software: you can redistribute it and/or modify
it under the terms of the GPL v3 as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
See <https://www.gnu.org/licenses/> for full license text.
+81 -2
View File
@@ -1,3 +1,82 @@
# pi-mta-sign
# Pi MTA Sign!
Code and documentation for project for turning a raspberry pi into your very own MTA subway sign.
This project gives you a docker image that you can run locally to pull MTA data and self-host a webpage that looks very
similar to the classic MTA Signs found in the metro.
![ui-example.png](attachments/ui-example.png)
Initially designed to run directly on a raspberry pi, it has been containerized and now runs anywhere you can install
podman or docker!
Additionally, this can be run without the frontend in case you just wanted a slightly more sane way to query MTA's data
sources compared to their stock APIs. Swagger is hosted at /swagger
![swagger.png](attachments/swagger.png)
## Features
- **Real-time MTA Data**: Live train arrival times for NYC subway
stations - [available for free here](https://api.mta.info/#/subwayRealTimeFeeds)
- **Configurable Stations**: Monitor multiple stations simultaneously with separate cards
- **Line Filtering**: Show/hide specific transit lines for each station
- **Direction Selection**: Toggle between North/South bound trains independently
- **Responsive Design**: Works on desktop, tablet, and mobile displays
- **Configuration Persistence**: Save your selected stations and preferences to localStorage or export/import them via
JSON
- **Docker Ready**: Easy deployment with Docker or Docker Compose
## Running via Docker
### Quick Start with Docker
Pull the latest image from GitHub Container Registry:
```bash
docker pull ghcr.io/lucasoskorep/pi-mta-sign:latest
```
Run the container:
```bash
docker run -d \
-p 8000:8000 \
--name pi-mta-sign \
ghcr.io/lucasoskorep/pi-mta-sign:latest
```
The application will be available at `http://localhost:8000`
### Environment Variables
| Variable | Description | Default | Required |
|-------------------|------------------------------------------------------------|---------|----------|
| `FRONTEND_ENABLE` | Enable/disable the web frontend | `true` | No |
| `SHOW_SWAGGER` | Enable/disable Swagger API documentation at `/swagger` | `false` | No |
### Running with Docker Compose
For a more convenient setup, use the provided docker-compose configuration:
```bash
# Run with docker-compose
docker-compose up -d
```
See `docker/docker-compose.example.yaml` for a complete example configuration.
### Local Development
To develop on this app locally you can clone the repo and then in the repo root run the following
Tools needed:
- [just](https://github.com/casey/just)
- [uv](https://github.com/astral-sh/uv)
- [fnm](https://github.com/Schniz/fnm)
Once you have all the required tooling all you need to do is
```bash
just init # uses uv and fnm/pnpm to download and setup all python and node depencencies
just dev # this will spin up the nextjs frontend and fastapi backend in hot reload mode
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

+11
View File
@@ -0,0 +1,11 @@
version: '3.8'
services:
pi-mta-sign:
image: ghcr.io/lucasoskorep/pi-mta-sign:latest
container_name: pi-mta-sign
ports:
- "8000:8000"
environment:
# OPTIONAL: Enable or disable the web frontend (default: true)
FRONTEND_ENABLE: "true"
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+74
View File
@@ -0,0 +1,74 @@
# Show available commands
default:
@just --list
# Setup Python project
init:
uv sync
fnm use
cd mta-sign-ui && pnpm install
# Build frontend and run FastAPI serving static files
run: build-ui
uv run python main.py
# Development mode: Next.js dev server + FastAPI backend (hot reload for both)
dev:
#!/usr/bin/env bash
set -e
echo "Starting FastAPI backend on :8000..."
uv run python main.py &
BACKEND_PID=$!
echo "Starting Next.js dev server on :3000..."
cd mta-sign-ui && pnpm dev &
FRONTEND_PID=$!
trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT
echo ""
echo "Development servers running:"
echo " Frontend: http://localhost:3000 (with hot reload)"
echo " Backend: http://localhost:8000 (API only)"
echo ""
wait
# Run only the backend (for when you want to run frontend separately)
dev-backend:
FRONTEND_ENABLE=false uv run python main.py
# Run only the frontend dev server
dev-frontend:
cd mta-sign-ui && pnpm dev
# Lint Python project with ruff
lint:
uv run ruff check .
# Auto fix Python lint with ruff
lint-fix:
uv run ruff check . --fix
# Run backend tests
test-backend:
uv run pytest tests/ -v
# Run frontend tests
test-frontend:
cd mta-sign-ui && pnpm test
# Run all tests
test: test-backend test-frontend
# Build frontend for production
build-ui:
cd mta-sign-ui && pnpm build
rm -rf static
cp -r mta-sign-ui/out static
# Build multi-arch container image
containers:
podman build --platform linux/arm64,linux/amd64 -f Dockerfile --manifest chaos2theory/pi-mta-sign:test .
podman manifest push --all chaos2theory/pi-mta-sign:test
podman manifest rm chaos2theory/pi-mta-sign:testpod
# Build container image (local arch only)
build-container:
podman build -f docker/Dockerfile -t pi-mta-sign:local .
+71
View File
@@ -0,0 +1,71 @@
import logging
import os
from pathlib import Path
import uvicorn
from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
from starlette.middleware.cors import CORSMiddleware
from mta_sign_server.router import router as default_router
from mta_sign_server.mta.router import router as mta_router
from mta_sign_server.config.router import router as config_router
load_dotenv()
# Setup Swagger documentation
show_swagger = os.getenv("SHOW_SWAGGER", "false").lower() in ("true", "1", "yes")
swagger_config = {
"docs_url": "/swagger" if show_swagger else None,
"redoc_url": None,
"openapi_url": "/openapi.json" if show_swagger else None,
}
app = FastAPI(**swagger_config)
app.add_middleware(
CORSMiddleware,
allow_origins=['*']
)
app.include_router(default_router)
app.include_router(mta_router)
app.include_router(config_router)
logger = logging.getLogger("main")
# Serve static files from the Next.js build output
# In production, the 'static' directory contains the built frontend
# Set FRONTEND_ENABLE=false to disable serving static files
frontend_enabled = os.getenv("FRONTEND_ENABLE", "true").lower() not in ("false", "0", "no")
static_dir = Path(__file__).parent / "static"
if frontend_enabled and static_dir.exists():
# Serve Next.js static assets (_next directory)
next_static = static_dir / "_next"
if next_static.exists():
app.mount("/_next", StaticFiles(directory=str(next_static)), name="next-static")
# Serve other static files (images, etc.)
app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")
@app.get("/")
async def serve_index():
"""Serve the main index.html for the SPA"""
return FileResponse(static_dir / "index.html")
@app.get("/{path:path}")
async def serve_spa(path: str):
"""Serve static files or fall back to index.html for SPA routing"""
# Exclude API and documentation routes from SPA fallback
if path.startswith(("api/", "swagger", "openapi", "redoc", "docs")):
return {"error": "Not found"}
file_path = static_dir / path
if file_path.exists() and file_path.is_file():
return FileResponse(file_path)
# Fall back to index.html for client-side routing
return FileResponse(static_dir / "index.html")
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, log_level="info", reload=True)
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
+37
View File
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
.yarn
+21
View File
@@ -0,0 +1,21 @@
## Getting Started
First, run the development server:
```bash
```bash
pnpm dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+12
View File
@@ -0,0 +1,12 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
background-color: #1f2937;
color: #fff;
}
body {
@apply bg-gray-900 text-white;
}
+19
View File
@@ -0,0 +1,19 @@
import './globals.css'
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: 'Pi MTA Sign!',
description: 'Using a raspberry pi to display subway information!',
}
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
+175
View File
@@ -0,0 +1,175 @@
'use client'
import { useState, useEffect, useCallback } from 'react'
import { PlusIcon } from '@heroicons/react/24/outline'
import Header from '@/components/Header'
import StationCard from '@/components/trains/StationCard'
import { AppConfig, StationConfig, CONFIG_VERSION } from '@/types/config'
import axios from 'axios'
const generateId = () => Math.random().toString(36).substring(2, 11)
const DEFAULT_CONFIGS: StationConfig[] = [
{ id: generateId(), stationId: '127', stationName: 'Times Sq-42 St', showNorth: true, showSouth: true, selectedLines: [] },
{ id: generateId(), stationId: 'A27', stationName: 'Times Sq-42 St', showNorth: true, showSouth: true, selectedLines: [] },
]
const STORAGE_KEY = 'mta-sign-config'
export default function Home() {
const [stationConfigs, setStationConfigs] = useState<StationConfig[]>(DEFAULT_CONFIGS)
const [availableLines, setAvailableLines] = useState<string[]>([])
const [startTime, setStartTime] = useState<string | null>(null)
const [lastUpdated, setLastUpdated] = useState<string | null>(null)
const [isLoaded, setIsLoaded] = useState(false)
// Load config from localStorage on mount
useEffect(() => {
if (typeof window === 'undefined') return
try {
const saved = localStorage.getItem(STORAGE_KEY)
if (saved) {
const config = JSON.parse(saved)
if (config.stations && Array.isArray(config.stations)) {
// Ensure all stations have IDs
const stationsWithIds = config.stations.map((s: any) => ({
...s,
id: s.id || generateId(),
}))
setStationConfigs(stationsWithIds)
}
}
} catch (err) {
console.error('Error loading config from localStorage:', err)
}
setIsLoaded(true)
}, [])
useEffect(() => {
axios.get('/api/lines')
.then(response => {
const lines = response.data.lines || []
setAvailableLines(lines)
// Update default configs to include all lines
setStationConfigs(prev => prev.map(config => ({
...config,
selectedLines: config.selectedLines.length === 0 ? lines : config.selectedLines
})))
})
.catch(err => console.error('Error fetching lines:', err))
}, [])
useEffect(() => {
axios.post('/api/start_time')
.then(response => {
if (response.data) {
setStartTime(new Date(response.data).toLocaleString('en-US'))
}
})
.catch(err => console.error('Error fetching start time:', err))
}, [])
useEffect(() => {
const interval = setInterval(() => {
setLastUpdated(new Date().toLocaleString('en-US'))
}, 5000)
return () => clearInterval(interval)
}, [])
// Save config to localStorage whenever it changes
useEffect(() => {
if (typeof window === 'undefined') return
try {
const configToSave = {
version: CONFIG_VERSION,
stations: stationConfigs,
}
localStorage.setItem(STORAGE_KEY, JSON.stringify(configToSave))
} catch (err) {
console.error('Error saving config to localStorage:', err)
}
}, [stationConfigs])
const handleConfigChange = useCallback((configId: string, newConfig: StationConfig) => {
setStationConfigs(prevConfigs => {
const updated = prevConfigs.map(config => config.id === configId ? newConfig : config)
return updated
})
}, [])
const addStation = () => {
const newConfig: StationConfig = {
id: generateId(),
stationId: '',
stationName: '',
showNorth: true,
showSouth: true,
selectedLines: availableLines,
}
setStationConfigs([...stationConfigs, newConfig])
}
const removeStation = (configId: string) => {
setStationConfigs(stationConfigs.filter(config => config.id !== configId))
}
const exportConfig = useCallback((): AppConfig => {
return {
version: CONFIG_VERSION,
stations: stationConfigs,
}
}, [stationConfigs])
const importConfig = useCallback((config: AppConfig) => {
if (config.version !== CONFIG_VERSION) {
alert(`Config version mismatch. Expected ${CONFIG_VERSION}, got ${config.version}`)
return
}
// Ensure all stations have IDs
const stationsWithIds = config.stations.map(station => ({
...station,
id: station.id || generateId(),
}))
setStationConfigs(stationsWithIds)
}, [])
if (availableLines.length === 0) {
return (
<main className="min-h-screen bg-gray-900 flex items-center justify-center">
<div className="text-white text-xl">Loading...</div>
</main>
)
}
return (
<main className="min-h-screen bg-gray-900 flex flex-col">
<Header
startTime={startTime}
lastUpdated={lastUpdated}
onExportConfig={exportConfig}
onImportConfig={importConfig}
/>
<div className="flex-1 p-2 md:p-4 space-y-4 md:space-y-6">
{stationConfigs.map((config) => (
<StationCard
key={config.id}
configId={config.id}
initialConfig={config.stationId ? config : undefined}
availableLines={availableLines}
onConfigChange={handleConfigChange}
onRemove={() => removeStation(config.id)}
/>
))}
<button
onClick={addStation}
className="w-full p-4 border-2 border-dashed border-gray-600 rounded-lg text-gray-400 hover:border-gray-500 hover:text-gray-300 transition-colors flex items-center justify-center gap-2"
>
<PlusIcon className="w-5 h-5" />
Add Station
</button>
</div>
</main>
)
}
+106
View File
@@ -0,0 +1,106 @@
'use client'
import { useRef } from 'react'
import Image from 'next/image'
import { ArrowDownTrayIcon, ArrowUpTrayIcon } from '@heroicons/react/24/outline'
import { AppConfig } from '@/types/config'
interface HeaderProps {
startTime: string | null
lastUpdated: string | null
onExportConfig: () => AppConfig
onImportConfig: (config: AppConfig) => void
}
export default function Header({ startTime, lastUpdated, onExportConfig, onImportConfig }: HeaderProps) {
const fileInputRef = useRef<HTMLInputElement>(null)
const handleExport = () => {
const config = onExportConfig()
const blob = new Blob([JSON.stringify(config, null, 2)], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = 'mta-sign-config.json'
a.click()
URL.revokeObjectURL(url)
}
const handleImport = (event: React.ChangeEvent<HTMLInputElement>) => {
const file = event.target.files?.[0]
if (!file) return
const reader = new FileReader()
reader.onload = (e) => {
try {
const config = JSON.parse(e.target?.result as string) as AppConfig
onImportConfig(config)
} catch (err) {
console.error('Failed to parse config file:', err)
alert('Invalid config file')
}
}
reader.readAsText(file)
// Reset input so same file can be imported again
if (fileInputRef.current) {
fileInputRef.current.value = ''
}
}
return (
<nav className="bg-gray-900 w-full px-4 py-3 md:px-6 md:py-4">
<div className="flex flex-col lg:flex-row items-center justify-between gap-2 lg:gap-4">
<div className="flex items-center gap-2 md:gap-4">
<Image
src="/images/RPI-LOGO.png"
alt="Raspberry Pi Logo"
width={50}
height={50}
className="w-8 h-8 md:w-10 md:h-10 lg:w-12 lg:h-12"
/>
<h1 className="text-2xl md:text-4xl lg:text-5xl xl:text-6xl font-bold text-white">
Pi MTA Display!
</h1>
</div>
<div className="flex items-center gap-4">
<div className="flex gap-2">
<button
onClick={handleExport}
className="p-2 rounded-lg bg-gray-700 hover:bg-gray-600 transition-colors"
title="Export config"
>
<ArrowDownTrayIcon className="w-5 h-5 text-white" />
</button>
<button
onClick={() => fileInputRef.current?.click()}
className="p-2 rounded-lg bg-gray-700 hover:bg-gray-600 transition-colors"
title="Import config"
>
<ArrowUpTrayIcon className="w-5 h-5 text-white" />
</button>
<input
ref={fileInputRef}
type="file"
accept=".json"
onChange={handleImport}
className="hidden"
/>
</div>
<div className="flex flex-col items-center lg:items-end text-sm md:text-base lg:text-lg xl:text-xl">
<div className="text-white">
<span className="font-semibold">Last Updated:</span>{' '}
<span>{lastUpdated || 'Loading...'}</span>
</div>
<div className="text-white">
<span className="font-semibold">Started:</span>{' '}
<span>{startTime || 'Loading...'}</span>
</div>
</div>
</div>
</div>
</nav>
)
}
+108
View File
@@ -0,0 +1,108 @@
'use client'
import { useState, useEffect, useRef } from 'react'
import { ChevronDownIcon } from '@heroicons/react/24/outline'
import axios from 'axios'
export interface Station {
id: string
name: string
}
interface StationSelectorProps {
selectedStation: Station | null
onSelect: (station: Station) => void
}
export default function StationSelector({ selectedStation, onSelect }: StationSelectorProps) {
const [search, setSearch] = useState('')
const [stations, setStations] = useState<Station[]>([])
const [isOpen, setIsOpen] = useState(false)
const [loading, setLoading] = useState(false)
const dropdownRef = useRef<HTMLDivElement>(null)
useEffect(() => {
const fetchStations = async () => {
setLoading(true)
try {
const params = search ? { search } : {}
const response = await axios.get('/api/stations', { params })
setStations(response.data.stations || [])
} catch (err) {
console.error('Error fetching stations:', err)
} finally {
setLoading(false)
}
}
const debounce = setTimeout(fetchStations, 300)
return () => clearTimeout(debounce)
}, [search])
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
setIsOpen(false)
}
}
document.addEventListener('mousedown', handleClickOutside)
return () => document.removeEventListener('mousedown', handleClickOutside)
}, [])
const handleSelect = (station: Station) => {
onSelect(station)
setSearch('')
setIsOpen(false)
}
return (
<div ref={dropdownRef} className="relative w-full">
<div
className="flex items-center gap-2 bg-transparent cursor-pointer"
onClick={() => setIsOpen(!isOpen)}
>
<input
type="text"
placeholder="Search stations..."
value={search}
onChange={(e) => {
setSearch(e.target.value)
setIsOpen(true)
}}
onClick={(e) => {
e.stopPropagation()
setIsOpen(true)
}}
className="flex-1 bg-transparent text-white placeholder-gray-400 outline-none text-sm md:text-base"
/>
<ChevronDownIcon
className={`w-4 h-4 text-gray-400 transition-transform ${isOpen ? 'rotate-180' : ''}`}
/>
</div>
{isOpen && (
<div className="absolute z-50 w-full mt-1 bg-gray-800 border border-gray-600 rounded-lg shadow-lg max-h-60 overflow-y-auto">
{loading ? (
<div className="p-3 text-gray-400 text-center">Loading...</div>
) : stations.length === 0 ? (
<div className="p-3 text-gray-400 text-center">No stations found</div>
) : (
stations.map((station) => (
<div
key={station.id}
onClick={() => handleSelect(station)}
className={`px-3 py-2 cursor-pointer hover:bg-gray-700 transition-colors ${
selectedStation?.id === station.id ? 'bg-gray-700' : ''
}`}
>
<span className="text-white text-sm md:text-base">{station.name}</span>
<span className="text-gray-500 text-xs ml-2">({station.id})</span>
</div>
))
)}
</div>
)}
</div>
)
}
@@ -0,0 +1,45 @@
'use client'
import TrainLine from './TrainLine'
interface Route {
routeId: string
arrival_times: number[]
}
interface DirectionCardProps {
direction: 'North' | 'South'
routes: Route[]
isEndOfLine?: boolean
}
const DirectionCard = ({ direction, routes, isEndOfLine = false }: DirectionCardProps) => {
return (
<div className="bg-gray-800 overflow-hidden flex-1">
{!isEndOfLine && (
<div className="bg-gray-700 px-3 py-2 md:px-4 md:py-3 lg:px-6 lg:py-4">
<h2 className="text-xl md:text-2xl lg:text-3xl xl:text-4xl font-bold text-white">
{direction}
</h2>
</div>
)}
<div className="divide-y divide-gray-700">
{routes && routes.length > 0 ? (
routes.map((route, index) => (
<TrainLine
key={`${route.routeId}-${index}`}
routeId={route.routeId}
arrivalTimes={route.arrival_times}
/>
))
) : (
<div className="p-4 text-gray-400 text-center">
No trains available
</div>
)}
</div>
</div>
)
}
export default DirectionCard
@@ -0,0 +1,320 @@
'use client'
import { useState, useEffect, useCallback, useMemo } from 'react'
import { XMarkIcon } from '@heroicons/react/24/outline'
import axios from 'axios'
import StationSelector, { Station } from '../StationSelector'
import DirectionCard from './DirectionCard'
import { StationConfig } from '@/types/config'
interface Route {
routeId: string
arrival_times: number[]
}
interface StationData {
stationId: string
routes: Route[]
}
interface StationCardProps {
configId: string
initialConfig?: StationConfig
availableLines: string[]
onConfigChange?: (configId: string, config: StationConfig) => void
onRemove?: () => void
}
export default function StationCard({ configId, initialConfig, availableLines, onConfigChange, onRemove }: StationCardProps) {
const [selectedStation, setSelectedStation] = useState<Station | null>(
initialConfig ? { id: initialConfig.stationId, name: initialConfig.stationName } : null
)
const [showNorth, setShowNorth] = useState(initialConfig?.showNorth ?? true)
const [showSouth, setShowSouth] = useState(initialConfig?.showSouth ?? true)
const [selectedLines, setSelectedLines] = useState<Set<string>>(
new Set(initialConfig?.selectedLines ?? availableLines)
)
const [northData, setNorthData] = useState<StationData | null>(null)
const [southData, setSouthData] = useState<StationData | null>(null)
const notifyConfigChange = useCallback(() => {
if (onConfigChange && selectedStation) {
onConfigChange(configId, {
id: configId,
stationId: selectedStation.id,
stationName: selectedStation.name,
showNorth,
showSouth,
selectedLines: Array.from(selectedLines),
})
}
}, [configId, onConfigChange, selectedStation, showNorth, showSouth, selectedLines])
useEffect(() => {
notifyConfigChange()
}, [notifyConfigChange])
const fetchStationData = useCallback(async () => {
if (!selectedStation) return
if (showNorth) {
try {
const response = await axios.post(`/api/mta/${selectedStation.id}N`)
setNorthData(response.data)
} catch (err) {
console.error('Error fetching north station data:', err)
setNorthData(null)
}
}
if (showSouth) {
try {
const response = await axios.post(`/api/mta/${selectedStation.id}S`)
setSouthData(response.data)
} catch (err) {
console.error('Error fetching south station data:', err)
setSouthData(null)
}
}
}, [selectedStation, showNorth, showSouth])
// Clear old data when station changes to prevent showing stale data from previous station
useEffect(() => {
if (selectedStation) {
setNorthData(null)
setSouthData(null)
}
}, [selectedStation?.id])
useEffect(() => {
if (selectedStation) {
fetchStationData()
const interval = setInterval(fetchStationData, 5000)
return () => clearInterval(interval)
}
}, [selectedStation, fetchStationData])
const availableDirections = useMemo(() => {
const directions = new Set<string>()
if (northData && northData.routes.length > 0) directions.add('North')
if (southData && southData.routes.length > 0) directions.add('South')
return directions
}, [northData, southData])
const stationAvailableLines = useMemo(() => {
const lines = new Set<string>()
if (northData) {
northData.routes.forEach(route => {
const lineId = route.routeId.replace('Route.', '')
lines.add(lineId)
})
}
if (southData) {
southData.routes.forEach(route => {
const lineId = route.routeId.replace('Route.', '')
lines.add(lineId)
})
}
return Array.from(lines).sort()
}, [northData, southData])
const toggleLine = (line: string) => {
const newSelected = new Set(selectedLines)
if (newSelected.has(line)) {
newSelected.delete(line)
} else {
newSelected.add(line)
}
setSelectedLines(newSelected)
}
const toggleDirection = (direction: 'North' | 'South') => {
if (direction === 'North') {
setShowNorth(!showNorth)
} else {
setShowSouth(!showSouth)
}
}
const filterRoutes = (routes: Route[]): Route[] => {
return routes.filter(route => {
const lineId = route.routeId.replace('Route.', '')
return selectedLines.has(lineId)
})
}
return (
<div className="bg-gray-800 overflow-hidden">
<Header
selectedStation={selectedStation}
onSelectStation={setSelectedStation}
showNorth={showNorth}
showSouth={showSouth}
selectedLines={selectedLines}
availableDirections={availableDirections}
availableLines={stationAvailableLines}
onToggleDirection={toggleDirection}
onToggleLine={toggleLine}
onRemove={onRemove}
/>
<Content
selectedStation={selectedStation}
showNorth={showNorth}
showSouth={showSouth}
northRoutes={northData ? filterRoutes(northData.routes || []) : []}
southRoutes={southData ? filterRoutes(southData.routes || []) : []}
availableDirections={availableDirections}
/>
</div>
)
}
interface HeaderProps {
selectedStation: Station | null
onSelectStation: (station: Station) => void
showNorth: boolean
showSouth: boolean
selectedLines: Set<string>
availableDirections: Set<string>
availableLines: string[]
onToggleDirection: (direction: 'North' | 'South') => void
onToggleLine: (line: string) => void
onRemove?: () => void
}
function Header({
selectedStation,
onSelectStation,
showNorth,
showSouth,
selectedLines,
availableDirections,
availableLines,
onToggleDirection,
onToggleLine,
onRemove,
}: HeaderProps) {
const [showSearch, setShowSearch] = useState(false)
return (
<div className="bg-gray-700">
{/* Station Name Title and Search Row */}
<div className="px-3 py-2 md:px-4 md:py-3 lg:px-6 lg:py-4 flex items-center gap-2 md:gap-4">
{selectedStation && (
<h1 className="text-xl md:text-2xl lg:text-3xl xl:text-4xl font-bold text-white flex-1">
{selectedStation.name}
</h1>
)}
{/* Search Button */}
{showSearch ? (
<div className="w-48">
<StationSelector selectedStation={selectedStation} onSelect={(station) => {
onSelectStation(station)
setShowSearch(false)
}} />
</div>
) : (
<button
onClick={() => setShowSearch(true)}
className="px-3 py-1 md:px-4 md:py-2 bg-gray-600 hover:bg-gray-500 text-white rounded transition-colors text-sm md:text-base shrink-0"
>
Search
</button>
)}
<div className="flex items-center gap-2 md:gap-3 shrink-0">
{availableDirections.has('North') && (
<label className="flex items-center gap-1 cursor-pointer">
<input
type="checkbox"
checked={showNorth}
onChange={() => onToggleDirection('North')}
className="w-4 h-4 rounded"
/>
<span className="text-white text-xs md:text-sm">N</span>
</label>
)}
{availableDirections.has('South') && (
<label className="flex items-center gap-1 cursor-pointer">
<input
type="checkbox"
checked={showSouth}
onChange={() => onToggleDirection('South')}
className="w-4 h-4 rounded"
/>
<span className="text-white text-xs md:text-sm">S</span>
</label>
)}
<div className="flex gap-1 md:gap-2">
{availableLines.map(line => (
<button
key={line}
onClick={() => onToggleLine(line)}
className={`w-6 h-6 md:w-7 md:h-7 rounded-full text-xs font-bold transition-all ${
selectedLines.has(line) ? 'bg-blue-600 text-white' : 'bg-gray-600 text-gray-400'
}`}
>
{line}
</button>
))}
</div>
{onRemove && (
<button
onClick={onRemove}
className="group p-2 rounded-lg bg-gray-700 hover:bg-red-600 transition-colors shrink-0"
title="Remove station"
>
<XMarkIcon className="w-4 h-4 md:w-5 md:h-5 text-gray-400 group-hover:text-white transition-colors" />
</button>
)}
</div>
</div>
</div>
)
}
interface ContentProps {
selectedStation: Station | null
showNorth: boolean
showSouth: boolean
northRoutes: Route[]
southRoutes: Route[]
availableDirections: Set<string>
}
function Content({ selectedStation, showNorth, showSouth, northRoutes, southRoutes, availableDirections }: ContentProps) {
if (!selectedStation) {
return (
<div className="p-8 text-center text-gray-400">
Select a station to view train arrivals
</div>
)
}
// Determine if this is an end-of-line station (only one direction available)
const isEndOfLine = availableDirections.size === 1
// Only render directions that are both available AND selected
const renderNorth = showNorth && availableDirections.has('North')
const renderSouth = showSouth && availableDirections.has('South')
return (
<div className="flex flex-col md:flex-row">
{renderNorth && (
<div className={`flex-1 ${renderSouth ? 'border-b md:border-b-0 md:border-r border-gray-700' : ''}`}>
<DirectionCard direction="North" routes={northRoutes} isEndOfLine={isEndOfLine} />
</div>
)}
{renderSouth && (
<div className="flex-1">
<DirectionCard direction="South" routes={southRoutes} isEndOfLine={isEndOfLine} />
</div>
)}
</div>
)
}
@@ -0,0 +1,43 @@
'use client'
import Image from 'next/image'
interface TrainLineProps {
routeId: string
arrivalTimes: number[]
}
const TrainLine = ({ routeId, arrivalTimes }: TrainLineProps) => {
const formatTimes = (times: number[]): string => {
if (!times || times.length === 0) {
return 'No trains'
}
return times
.sort((a, b) => a - b)
.join(', ')
}
const getLineImage = (route: string): string => {
const cleanRoute = route.replace('Route.', '')
return `/images/lines/${cleanRoute}.svg`
}
return (
<div className="flex items-center justify-between p-2 md:p-3 lg:p-4 border-b border-gray-700 last:border-b-0 h-16 md:h-20 lg:h-24">
<div className="flex items-center gap-2 md:gap-3 lg:gap-4 shrink-0">
<Image
src={getLineImage(routeId)}
alt={`${routeId} line`}
width={60}
height={60}
className="w-8 h-8 md:w-12 md:h-12 lg:w-14 lg:h-14 xl:w-16 xl:h-16"
/>
</div>
<h2 className="text-xl md:text-2xl lg:text-[2.5rem] font-bold text-white text-right flex-1 ml-4 whitespace-nowrap overflow-hidden text-ellipsis">
{formatTimes(arrivalTimes)}
</h2>
</div>
)
}
export default TrainLine
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
@@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
@@ -0,0 +1,8 @@
.gitignore
.npmignore
api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
@@ -0,0 +1 @@
6.6.0
+559
View File
@@ -0,0 +1,559 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
/**
*
* @export
* @interface AllStationResponse
*/
export interface AllStationResponse {
/**
*
* @type {any}
* @memberof AllStationResponse
*/
'stations': any;
}
/**
*
* @export
* @interface HTTPValidationError
*/
export interface HTTPValidationError {
/**
*
* @type {any}
* @memberof HTTPValidationError
*/
'detail'?: any;
}
/**
* An enumeration.
* @export
* @interface Route
*/
export interface Route {
}
/**
*
* @export
* @interface RouteResponse
*/
export interface RouteResponse {
/**
*
* @type {Route}
* @memberof RouteResponse
*/
'routeId': Route;
/**
*
* @type {any}
* @memberof RouteResponse
*/
'arrival_times': any;
}
/**
*
* @export
* @interface StationResponse
*/
export interface StationResponse {
/**
*
* @type {any}
* @memberof StationResponse
*/
'stationId': any;
/**
*
* @type {any}
* @memberof StationResponse
*/
'routes': any;
}
/**
*
* @export
* @interface ValidationError
*/
export interface ValidationError {
/**
*
* @type {any}
* @memberof ValidationError
*/
'loc': any;
/**
*
* @type {any}
* @memberof ValidationError
*/
'msg': any;
/**
*
* @type {any}
* @memberof ValidationError
*/
'type': any;
}
/**
* ConfigApi - axios parameter creator
* @export
*/
export const ConfigApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllApiConfigGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/config`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ConfigApi - functional programming interface
* @export
*/
export const ConfigApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ConfigApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllApiConfigGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllApiConfigGet(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* ConfigApi - factory interface
* @export
*/
export const ConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ConfigApiFp(configuration)
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllApiConfigGet(options?: any): AxiosPromise<any> {
return localVarFp.getAllApiConfigGet(options).then((request) => request(axios, basePath));
},
};
};
/**
* ConfigApi - object-oriented interface
* @export
* @class ConfigApi
* @extends {BaseAPI}
*/
export class ConfigApi extends BaseAPI {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigApi
*/
public getAllApiConfigGet(options?: AxiosRequestConfig) {
return ConfigApiFp(this.configuration).getAllApiConfigGet(options).then((request) => request(this.axios, this.basePath));
}
}
/**
* MtaDataApi - axios parameter creator
* @export
*/
export const MtaDataApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllApiMtaPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/mta`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get Route
* @param {any} stopId
* @param {Route} route
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRouteApiMtaStopIdRoutePost: async (stopId: any, route: Route, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'stopId' is not null or undefined
assertParamExists('getRouteApiMtaStopIdRoutePost', 'stopId', stopId)
// verify required parameter 'route' is not null or undefined
assertParamExists('getRouteApiMtaStopIdRoutePost', 'route', route)
const localVarPath = `/api/mta/{stop_id}/{route}`
.replace(`{${"stop_id"}}`, encodeURIComponent(String(stopId)))
.replace(`{${"route"}}`, encodeURIComponent(String(route)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get Station
* @param {any} stopId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getStationApiMtaStopIdPost: async (stopId: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'stopId' is not null or undefined
assertParamExists('getStationApiMtaStopIdPost', 'stopId', stopId)
const localVarPath = `/api/mta/{stop_id}`
.replace(`{${"stop_id"}}`, encodeURIComponent(String(stopId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* MtaDataApi - functional programming interface
* @export
*/
export const MtaDataApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = MtaDataApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllApiMtaPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AllStationResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllApiMtaPost(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Get Route
* @param {any} stopId
* @param {Route} route
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RouteResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRouteApiMtaStopIdRoutePost(stopId, route, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Get Station
* @param {any} stopId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getStationApiMtaStopIdPost(stopId: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StationResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getStationApiMtaStopIdPost(stopId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* MtaDataApi - factory interface
* @export
*/
export const MtaDataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = MtaDataApiFp(configuration)
return {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllApiMtaPost(options?: any): AxiosPromise<AllStationResponse> {
return localVarFp.getAllApiMtaPost(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get Route
* @param {any} stopId
* @param {Route} route
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: any): AxiosPromise<RouteResponse> {
return localVarFp.getRouteApiMtaStopIdRoutePost(stopId, route, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Get Station
* @param {any} stopId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getStationApiMtaStopIdPost(stopId: any, options?: any): AxiosPromise<StationResponse> {
return localVarFp.getStationApiMtaStopIdPost(stopId, options).then((request) => request(axios, basePath));
},
};
};
/**
* MtaDataApi - object-oriented interface
* @export
* @class MtaDataApi
* @extends {BaseAPI}
*/
export class MtaDataApi extends BaseAPI {
/**
*
* @summary Get All
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MtaDataApi
*/
public getAllApiMtaPost(options?: AxiosRequestConfig) {
return MtaDataApiFp(this.configuration).getAllApiMtaPost(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get Route
* @param {any} stopId
* @param {Route} route
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MtaDataApi
*/
public getRouteApiMtaStopIdRoutePost(stopId: any, route: Route, options?: AxiosRequestConfig) {
return MtaDataApiFp(this.configuration).getRouteApiMtaStopIdRoutePost(stopId, route, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get Station
* @param {any} stopId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof MtaDataApi
*/
public getStationApiMtaStopIdPost(stopId: any, options?: AxiosRequestConfig) {
return MtaDataApiFp(this.configuration).getStationApiMtaStopIdPost(stopId, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* StartApi - axios parameter creator
* @export
*/
export const StartApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Get Start Time
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getStartTimeApiStartTimePost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/start_time`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* StartApi - functional programming interface
* @export
*/
export const StartApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = StartApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Get Start Time
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getStartTimeApiStartTimePost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getStartTimeApiStartTimePost(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* StartApi - factory interface
* @export
*/
export const StartApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = StartApiFp(configuration)
return {
/**
*
* @summary Get Start Time
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getStartTimeApiStartTimePost(options?: any): AxiosPromise<any> {
return localVarFp.getStartTimeApiStartTimePost(options).then((request) => request(axios, basePath));
},
};
};
/**
* StartApi - object-oriented interface
* @export
* @class StartApi
* @extends {BaseAPI}
*/
export class StartApi extends BaseAPI {
/**
*
* @summary Get Start Time
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof StartApi
*/
public getStartTimeApiStartTimePost(options?: AxiosRequestConfig) {
return StartApiFp(this.configuration).getStartTimeApiStartTimePost(options).then((request) => request(this.axios, this.basePath));
}
}
@@ -0,0 +1,72 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from './configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
/**
*
* @export
*/
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @interface RequestArgs
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
}
/**
*
* @export
* @class BaseAPI
*/
export class BaseAPI {
protected configuration: Configuration | undefined;
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
};
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
export class RequiredError extends Error {
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}
@@ -0,0 +1,150 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";
/**
*
* @export
*/
export const DUMMY_BASE_URL = 'https://example.com'
/**
*
* @throws {RequiredError}
* @export
*/
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
if (paramValue === null || paramValue === undefined) {
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
}
}
/**
*
* @export
*/
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? await configuration.apiKey(keyParamName)
: await configuration.apiKey;
object[keyParamName] = localVarApiKeyValue;
}
}
/**
*
* @export
*/
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
if (configuration && (configuration.username || configuration.password)) {
object["auth"] = { username: configuration.username, password: configuration.password };
}
}
/**
*
* @export
*/
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
object["Authorization"] = "Bearer " + accessToken;
}
}
/**
*
* @export
*/
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? await configuration.accessToken(name, scopes)
: await configuration.accessToken;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
}
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {
if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
}
else {
Object.keys(parameter).forEach(currentKey =>
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
);
}
}
else {
if (urlSearchParams.has(key)) {
urlSearchParams.append(key, parameter);
}
else {
urlSearchParams.set(key, parameter);
}
}
}
/**
*
* @export
*/
export const setSearchParams = function (url: URL, ...objects: any[]) {
const searchParams = new URLSearchParams(url.search);
setFlattenedQueryParams(searchParams, objects);
url.search = searchParams.toString();
}
/**
*
* @export
*/
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
const nonString = typeof value !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
: nonString;
return needsSerialization
? JSON.stringify(value !== undefined ? value : {})
: (value || "");
}
/**
*
* @export
*/
export const toPathString = function (url: URL) {
return url.pathname + url.search + url.hash
}
/**
*
* @export
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
};
}
@@ -0,0 +1,101 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
username?: string;
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
baseOptions?: any;
formDataCtor?: new () => any;
}
export class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
/**
* The FormData constructor that will be used to create multipart form data
* requests. You can inject this here so that execution environments that
* do not support the FormData class can still run the generated client.
*
* @type {new () => FormData}
*/
formDataCtor?: new () => any;
constructor(param: ConfigurationParameters = {}) {
this.apiKey = param.apiKey;
this.username = param.username;
this.password = param.password;
this.accessToken = param.accessToken;
this.basePath = param.basePath;
this.baseOptions = param.baseOptions;
this.formDataCtor = param.formDataCtor;
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}
}
@@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
@@ -0,0 +1,18 @@
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export * from "./api";
export * from "./configuration";
@@ -0,0 +1 @@
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/start_time":{"post":{"tags":["start"],"summary":"Get Start Time","operationId":"get_start_time_api_start_time_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/mta/{stop_id}/{route}":{"post":{"tags":["mta-data"],"summary":"Get Route","operationId":"get_route_api_mta__stop_id___route__post","parameters":[{"required":true,"schema":{"type":"string","title":"Stop Id"},"name":"stop_id","in":"path"},{"required":true,"schema":{"$ref":"#/components/schemas/Route"},"name":"route","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mta/{stop_id}":{"post":{"tags":["mta-data"],"summary":"Get Station","operationId":"get_station_api_mta__stop_id__post","parameters":[{"required":true,"schema":{"type":"string","title":"Stop Id"},"name":"stop_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/mta":{"post":{"tags":["mta-data"],"summary":"Get All","operationId":"get_all_api_mta_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllStationResponse"}}}}}}},"/api/config":{"get":{"tags":["config"],"summary":"Get All","operationId":"get_all_api_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AllStationResponse":{"properties":{"stations":{"items":{"$ref":"#/components/schemas/StationResponse"},"type":"array","title":"Stations"}},"type":"object","required":["stations"],"title":"AllStationResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Route":{"enum":["A","C","E","B","D","F","M","G","J","Z","N","Q","R","W","1","2","3","4","5","6","7","L","SIR"],"title":"Route","description":"An enumeration."},"RouteResponse":{"properties":{"routeId":{"$ref":"#/components/schemas/Route"},"arrival_times":{"items":{"type":"integer"},"type":"array","title":"Arrival Times"}},"type":"object","required":["routeId","arrival_times"],"title":"RouteResponse"},"StationResponse":{"properties":{"stationId":{"type":"string","title":"Stationid"},"routes":{"items":{"$ref":"#/components/schemas/RouteResponse"},"type":"array","title":"Routes"}},"type":"object","required":["stationId","routes"],"title":"StationResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
+6
View File
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
+19
View File
@@ -0,0 +1,19 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
images: {
unoptimized: true,
},
// Rewrites only work during development (next dev)
// They are ignored during static export build
rewrites: async () => {
return [
{
source: '/api/:path*',
destination: 'http://localhost:8000/api/:path*',
},
]
},
}
module.exports = nextConfig
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.6.0",
"generators": {
"mta-sign-api": {
"generatorName": "typescript-axios",
"output": "#{cwd}/gen-sources/mta-sign-api/",
"glob": "gen-sources/mta-sign-api/openapi.{json,yaml}",
"additionalProperties": "supportsES6=true,typescriptThreePlus=true"
}
}
}
}
+41
View File
@@ -0,0 +1,41 @@
{
"name": "mta-sign",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"build:watch": "chokidar 'app/**/*' 'components/**/*' 'public/**/*' -c 'next build'",
"start": "next start",
"lint": "next lint",
"test": "vitest run",
"test:watch": "vitest",
"gen-apis": "npx openapi-typescript http://localhost:8000/openapi.json --output gen-sources/mtaserver.ts"
},
"dependencies": {
"@heroicons/react": "^2.2.0",
"autoprefixer": "^10.4.20",
"axios": "^1.7.9",
"bootstrap": "^5.3.8",
"next": "^16.1.2",
"openapi-typescript-fetch": "^2.0.0",
"postcss": "^8.5.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"tailwindcss": "^3.4.17"
},
"devDependencies": {
"@testing-library/react": "^16.1.0",
"@types/node": "^25.0.0",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^5.0.0",
"chokidar-cli": "^3.0.0",
"eslint": "^9.18.0",
"eslint-config-next": "^16.1.2",
"jsdom": "^27.0.0",
"typescript": "^5.7.3",
"vitest": "^4.0.0"
},
"packageManager": "pnpm@10.28.2"
}
+5752
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before

Width:  |  Height:  |  Size: 856 B

After

Width:  |  Height:  |  Size: 856 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 936 B

After

Width:  |  Height:  |  Size: 936 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 765 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 761 B

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 733 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 671 B

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 967 B

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 734 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before

Width:  |  Height:  |  Size: 1011 B

After

Width:  |  Height:  |  Size: 997 B

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 734 B

+18
View File
@@ -0,0 +1,18 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./mta_sign_server/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},
plugins: [],
}
+74
View File
@@ -0,0 +1,74 @@
import { describe, it, expect } from 'vitest'
import { AppConfig, StationConfig, CONFIG_VERSION } from '@/types/config'
describe('Config Types', () => {
it('CONFIG_VERSION is defined', () => {
expect(CONFIG_VERSION).toBeDefined()
expect(typeof CONFIG_VERSION).toBe('number')
})
it('StationConfig has correct shape', () => {
const config: StationConfig = {
stationId: '127',
stationName: 'Times Sq-42 St',
showNorth: true,
showSouth: false,
selectedLines: ['A', 'C', 'E'],
}
expect(config.stationId).toBe('127')
expect(config.stationName).toBe('Times Sq-42 St')
expect(config.showNorth).toBe(true)
expect(config.showSouth).toBe(false)
expect(config.selectedLines).toEqual(['A', 'C', 'E'])
})
it('AppConfig has correct shape', () => {
const appConfig: AppConfig = {
version: CONFIG_VERSION,
stations: [
{
stationId: '127',
stationName: 'Times Sq-42 St',
showNorth: true,
showSouth: true,
selectedLines: ['A', 'C', 'E'],
},
],
}
expect(appConfig.version).toBe(CONFIG_VERSION)
expect(appConfig.stations).toHaveLength(1)
expect(appConfig.stations[0].stationId).toBe('127')
})
it('AppConfig can serialize to JSON and back', () => {
const appConfig: AppConfig = {
version: CONFIG_VERSION,
stations: [
{
stationId: '127',
stationName: 'Times Sq-42 St',
showNorth: true,
showSouth: false,
selectedLines: ['1', '2', '3'],
},
{
stationId: 'A27',
stationName: '42 St-Port Authority',
showNorth: false,
showSouth: true,
selectedLines: ['A', 'C', 'E'],
},
],
}
const json = JSON.stringify(appConfig)
const parsed = JSON.parse(json) as AppConfig
expect(parsed.version).toBe(appConfig.version)
expect(parsed.stations).toHaveLength(2)
expect(parsed.stations[0]).toEqual(appConfig.stations[0])
expect(parsed.stations[1]).toEqual(appConfig.stations[1])
})
})
+1
View File
@@ -0,0 +1 @@
import '@testing-library/react'
+42
View File
@@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
+15
View File
@@ -0,0 +1,15 @@
export interface StationConfig {
id: string
stationId: string
stationName: string
showNorth: boolean
showSouth: boolean
selectedLines: string[]
}
export interface AppConfig {
version: number
stations: StationConfig[]
}
export const CONFIG_VERSION = 1
+17
View File
@@ -0,0 +1,17 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./tests/setup.ts'],
},
resolve: {
alias: {
'@': path.resolve(__dirname, './'),
},
},
})
@@ -1,5 +1,6 @@
from enum import Enum
class Feed(Enum):
ACE = "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-ace"
BDFM = "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-bdfm"
@@ -10,12 +11,7 @@ class Feed(Enum):
N1234567 = "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs"
SIR = "https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-si"
ALL_FEEDS = [
Feed.ACE,
Feed.BDFM,
Feed.G,
Feed.NQRW,
Feed.L,
Feed.N1234567,
Feed.SIR
member for member in Feed
]
@@ -1,5 +1,6 @@
from enum import Enum
class Route(Enum):
A = "A"
C = "C"
@@ -31,6 +32,9 @@ class Route(Enum):
L = "L"
SIR = "SIR"
_routes = set(item.value for item in Route)
def is_valid_route(route: str) -> bool:
return route in _routes
+7
View File
@@ -0,0 +1,7 @@
from datetime import datetime
from google.transit import gtfs_realtime_pb2
from math import trunc
def trip_arrival_in_minutes(stop_time_update: gtfs_realtime_pb2.TripUpdate):
return trunc(((datetime.fromtimestamp(stop_time_update.arrival.time) - datetime.now()).total_seconds()) / 60)
@@ -19,9 +19,9 @@ class Train(object):
return trip_arrival_in_minutes(stop_time_update)
return None
def _get_route(self) -> str:
return self.train_proto.trip_update.trip.route_id
def get_route(self) -> Route:
return Route(self.train_proto.trip_update.trip.route_id)
@@ -31,4 +31,3 @@ class Train(object):
def __str__(self):
return f"{self.train_proto}"
-28
View File
@@ -1,28 +0,0 @@
from datetime import datetime
from google.transit import gtfs_realtime_pb2
from math import trunc
def trip_arrival_in_minutes(stop_time_update: gtfs_realtime_pb2.TripUpdate):
return trunc(((datetime.fromtimestamp(stop_time_update.arrival.time) - datetime.now()).total_seconds()) / 60)
# class Stop(object):
# def __init__(self, id, arrival_time, departure_time, ):
# self.id = id
# self.arrival_time = arrival_time
# self.departure_time = departure_time
#
# def arrival_minutes(self):
# return trunc(((datetime.fromtimestamp(self.arrival_time) - datetime.now()).total_seconds()) / 60)
#
# def __str__(self):
# now = datetime.now()
# time = datetime.fromtimestamp(self.arrival_time)
# time_minutes = trunc(((time - now).total_seconds()) / 60)
# return f"stop_id:{self.id}| arr:{time_minutes}| dep:{self.departure_time}"
#
# @staticmethod
# def get_stop_from_dict(obj):
# if "arrival" in obj and "departure" in obj and "stop_id" in obj:
# return Stop(obj["stop_id"], obj["arrival"]["time"], obj["departure"]["time"])
# return None
View File
View File
+56
View File
@@ -0,0 +1,56 @@
import csv
import logging
from pathlib import Path
from fastapi import APIRouter
from mta_api_client import Route
from mta_sign_server.config.schemas import Station, StationsResponse, LinesResponse
router = APIRouter(
tags=["config"],
)
logger = logging.getLogger("config_router")
STOPS_FILE = Path(__file__).parent.parent.parent / "stops.txt"
@router.get("/api/config")
def get_all():
return {"config": "goes here"}
@router.get("/api/stations", response_model=StationsResponse)
def get_stations(search: str | None = None):
"""Get list of all stations, optionally filtered by search term. Deduplicates by station name."""
stations_dict = {}
if STOPS_FILE.exists():
with open(STOPS_FILE, "r") as f:
reader = csv.DictReader(f)
for row in reader:
# Only include parent stations (location_type == 1)
if row.get("location_type") == "1":
station_name = row["stop_name"]
station_id = row["stop_id"]
# Only add first occurrence of each station name to deduplicate
if station_name not in stations_dict:
station = Station(id=station_id, name=station_name)
# Filter by search term if provided
if search:
if search.lower() in station.name.lower() or search in station.id:
stations_dict[station_name] = station
else:
stations_dict[station_name] = station
return StationsResponse(stations=list(stations_dict.values()))
@router.get("/api/lines", response_model=LinesResponse)
def get_lines():
"""Get list of all available train lines."""
lines = [route.value for route in Route]
return LinesResponse(lines=sorted(lines))
+14
View File
@@ -0,0 +1,14 @@
from pydantic import BaseModel
class Station(BaseModel):
id: str
name: str
class StationsResponse(BaseModel):
stations: list[Station]
class LinesResponse(BaseModel):
lines: list[str]
View File
+134
View File
@@ -0,0 +1,134 @@
import csv
import logging
import os
from pathlib import Path
from collections import defaultdict
from fastapi import APIRouter, HTTPException
from fastapi_utils.tasks import repeat_every
from starlette import status
from mta_api_client import Route, MTA
from mta_api_client.feed import ALL_FEEDS
from mta_sign_server.mta.schemas import StationResponse, RouteResponse, AllStationResponse
router = APIRouter(
tags=["mta-data"],
)
logger = logging.getLogger("mta")
api_key = os.getenv('MTA_API_KEY', '')
mtaController = MTA(
api_key,
feeds=ALL_FEEDS
)
ROUTES = [member for member in Route]
STATION_STOP_IDs = ["127S", "127N", "A27N", "A27S"]
STOPS_FILE = Path(__file__).parent.parent.parent / "stops.txt"
# Build mappings for station resolution
_station_name_to_ids = None
_station_id_to_name = None
def _load_station_mapping():
global _station_name_to_ids, _station_id_to_name
if _station_name_to_ids is not None:
return
_station_name_to_ids = defaultdict(set)
_station_id_to_name = {}
if STOPS_FILE.exists():
with open(STOPS_FILE, "r") as f:
reader = csv.DictReader(f)
for row in reader:
if row.get("location_type") == "1": # Parent stations only
station_name = row["stop_name"]
station_id = row["stop_id"]
_station_name_to_ids[station_name].add(station_id)
_station_id_to_name[station_id] = station_name
def _resolve_base_station_ids(stop_id: str) -> list[str]:
"""Resolve a stop_id to a list of all base parent station IDs (without direction) that share the same station name."""
_load_station_mapping()
# Remove direction suffix to get base ID
base_id = stop_id.rstrip("NS")
# Look up the station name for this ID
if base_id in _station_id_to_name:
station_name = _station_id_to_name[base_id]
# Return all base station IDs with this name
return sorted(list(_station_name_to_ids[station_name]))
# If not found, just return the base ID
return [base_id]
@router.post("/api/mta/{stop_id}/{route}", response_model=RouteResponse, status_code=status.HTTP_200_OK)
def get_route(stop_id: str, route: Route):
arrival_times = mtaController.get_arrival_times(route, stop_id)
if len(arrival_times) > 0:
return RouteResponse(routeId=route, arrival_times=arrival_times)
raise HTTPException(status_code=404, detail="no stops found for route and stop id")
@router.post("/api/mta/{stop_id}", response_model=StationResponse, status_code=status.HTTP_200_OK)
def get_station(stop_id: str):
routes_dict = {} # Use dict to avoid duplicates
base_station_ids = _resolve_base_station_ids(stop_id)
# Extract the requested direction
requested_direction = ""
if stop_id.endswith("N"):
requested_direction = "N"
elif stop_id.endswith("S"):
requested_direction = "S"
# Only query the requested direction for each base station ID
for base_id in base_station_ids:
station_id_with_direction = f"{base_id}{requested_direction}"
for route in ROUTES:
arrival_times = mtaController.get_arrival_times(route, station_id_with_direction)
if len(arrival_times) > 0:
route_key = route.value
if route_key not in routes_dict:
routes_dict[route_key] = (route, arrival_times)
else:
# Combine arrival times from different station IDs
routes_dict[route_key] = (route, sorted(list(set(routes_dict[route_key][1] + arrival_times))))
routes = [RouteResponse(routeId=route, arrival_times=times) for route, times in routes_dict.values()]
if routes:
return StationResponse(stationId=stop_id, routes=routes)
raise HTTPException(status_code=404, detail="no trains or routes found for stop id")
@router.post("/api/mta", response_model=AllStationResponse, status_code=status.HTTP_200_OK)
def get_all():
print("HELLO WORLD")
all_stations = []
for stop_id in STATION_STOP_IDs:
routes = []
for route in ROUTES:
arrival_times = mtaController.get_arrival_times(route, stop_id)
if len(arrival_times) > 0:
routes.append(RouteResponse(routeId=route, arrival_times=arrival_times))
all_stations.append(StationResponse(stationId=stop_id, routes=routes))
print(all_stations)
if all_stations:
return AllStationResponse(stations=all_stations)
raise HTTPException(status_code=404, detail="no arriving trains found for all configured routes")
@router.on_event("startup")
@repeat_every(seconds=10)
def update_trains():
logger.info("UPDATING TRAINS")
mtaController.update_trains()
+18
View File
@@ -0,0 +1,18 @@
from pydantic import BaseModel
from typing import List
from mta_api_client import Route
class RouteResponse(BaseModel):
routeId: Route
arrival_times: List[int]
class StationResponse(BaseModel):
stationId: str
routes: List[RouteResponse]
class AllStationResponse(BaseModel):
stations: List[StationResponse]
+12
View File
@@ -0,0 +1,12 @@
from datetime import datetime
from fastapi import APIRouter, status
router = APIRouter(
tags=["start"],
)
start_time = datetime.now()
@router.post("/api/start_time", status_code=status.HTTP_200_OK)
def get_start_time():
return start_time.isoformat()
+8
View File
@@ -0,0 +1,8 @@
{
"name": "pi-mta-sign",
"version": "1.0.0",
"description": "MTA Sign API for Raspberry Pi",
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
"license": "GPL-3.0-only",
"packageManager": "yarn@4.12.0"
}
Generated
-601
View File
@@ -1,601 +0,0 @@
# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
[[package]]
name = "apscheduler"
version = "3.10.1"
description = "In-process task scheduler with Cron-like capabilities"
optional = false
python-versions = ">=3.6"
files = [
{file = "APScheduler-3.10.1-py3-none-any.whl", hash = "sha256:e813ad5ada7aff36fb08cdda746b520531eaac7757832abc204868ba78e0c8f6"},
{file = "APScheduler-3.10.1.tar.gz", hash = "sha256:0293937d8f6051a0f493359440c1a1b93e882c57daf0197afeff0e727777b96e"},
]
[package.dependencies]
pytz = "*"
setuptools = ">=0.7"
six = ">=1.4.0"
tzlocal = ">=2.0,<3.dev0 || >=4.dev0"
[package.extras]
doc = ["sphinx", "sphinx-rtd-theme"]
gevent = ["gevent"]
mongodb = ["pymongo (>=3.0)"]
redis = ["redis (>=3.0)"]
rethinkdb = ["rethinkdb (>=2.4.0)"]
sqlalchemy = ["sqlalchemy (>=1.4)"]
testing = ["pytest", "pytest-asyncio", "pytest-cov", "pytest-tornado5"]
tornado = ["tornado (>=4.3)"]
twisted = ["twisted"]
zookeeper = ["kazoo"]
[[package]]
name = "asgiref"
version = "3.7.2"
description = "ASGI specs, helper code, and adapters"
optional = false
python-versions = ">=3.7"
files = [
{file = "asgiref-3.7.2-py3-none-any.whl", hash = "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e"},
{file = "asgiref-3.7.2.tar.gz", hash = "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"},
]
[package.extras]
tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"]
[[package]]
name = "blinker"
version = "1.6.2"
description = "Fast, simple object-to-object and broadcast signaling"
optional = false
python-versions = ">=3.7"
files = [
{file = "blinker-1.6.2-py3-none-any.whl", hash = "sha256:c3d739772abb7bc2860abf5f2ec284223d9ad5c76da018234f6f50d6f31ab1f0"},
{file = "blinker-1.6.2.tar.gz", hash = "sha256:4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213"},
]
[[package]]
name = "certifi"
version = "2023.5.7"
description = "Python package for providing Mozilla's CA Bundle."
optional = false
python-versions = ">=3.6"
files = [
{file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"},
{file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"},
]
[[package]]
name = "charset-normalizer"
version = "3.2.0"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
optional = false
python-versions = ">=3.7.0"
files = [
{file = "charset-normalizer-3.2.0.tar.gz", hash = "sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace"},
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710"},
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed"},
{file = "charset_normalizer-3.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9"},
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623"},
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a"},
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8"},
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad"},
{file = "charset_normalizer-3.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c"},
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3"},
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029"},
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f"},
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a"},
{file = "charset_normalizer-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd"},
{file = "charset_normalizer-3.2.0-cp310-cp310-win32.whl", hash = "sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96"},
{file = "charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea"},
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09"},
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2"},
{file = "charset_normalizer-3.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac"},
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918"},
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a"},
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a"},
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6"},
{file = "charset_normalizer-3.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3"},
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d"},
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2"},
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6"},
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23"},
{file = "charset_normalizer-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa"},
{file = "charset_normalizer-3.2.0-cp311-cp311-win32.whl", hash = "sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1"},
{file = "charset_normalizer-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-win32.whl", hash = "sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1"},
{file = "charset_normalizer-3.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959"},
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669"},
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329"},
{file = "charset_normalizer-3.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149"},
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94"},
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f"},
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa"},
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a"},
{file = "charset_normalizer-3.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037"},
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46"},
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2"},
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d"},
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c"},
{file = "charset_normalizer-3.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10"},
{file = "charset_normalizer-3.2.0-cp38-cp38-win32.whl", hash = "sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706"},
{file = "charset_normalizer-3.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e"},
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c"},
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f"},
{file = "charset_normalizer-3.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858"},
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5"},
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952"},
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4"},
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200"},
{file = "charset_normalizer-3.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252"},
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22"},
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c"},
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e"},
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299"},
{file = "charset_normalizer-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020"},
{file = "charset_normalizer-3.2.0-cp39-cp39-win32.whl", hash = "sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9"},
{file = "charset_normalizer-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80"},
{file = "charset_normalizer-3.2.0-py3-none-any.whl", hash = "sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6"},
]
[[package]]
name = "click"
version = "8.1.4"
description = "Composable command line interface toolkit"
optional = false
python-versions = ">=3.7"
files = [
{file = "click-8.1.4-py3-none-any.whl", hash = "sha256:2739815aaa5d2c986a88f1e9230c55e17f0caad3d958a5e13ad0797c166db9e3"},
{file = "click-8.1.4.tar.gz", hash = "sha256:b97d0c74955da062a7d4ef92fadb583806a585b2ea81958a81bd72726cbb8e37"},
]
[package.dependencies]
colorama = {version = "*", markers = "platform_system == \"Windows\""}
[[package]]
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "flask"
version = "2.3.2"
description = "A simple framework for building complex web applications."
optional = false
python-versions = ">=3.8"
files = [
{file = "Flask-2.3.2-py3-none-any.whl", hash = "sha256:77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0"},
{file = "Flask-2.3.2.tar.gz", hash = "sha256:8c2f9abd47a9e8df7f0c3f091ce9497d011dc3b31effcf4c85a6e2b50f4114ef"},
]
[package.dependencies]
asgiref = {version = ">=3.2", optional = true, markers = "extra == \"async\""}
blinker = ">=1.6.2"
click = ">=8.1.3"
itsdangerous = ">=2.1.2"
Jinja2 = ">=3.1.2"
Werkzeug = ">=2.3.3"
[package.extras]
async = ["asgiref (>=3.2)"]
dotenv = ["python-dotenv"]
[[package]]
name = "flask-apscheduler"
version = "1.12.4"
description = "Adds APScheduler support to Flask"
optional = false
python-versions = "*"
files = [
{file = "Flask-APScheduler-1.12.4.tar.gz", hash = "sha256:681dae34dc6cc9403ce674795e53abd0bff540472129cfd3d3c93e0e1d502da8"},
]
[package.dependencies]
apscheduler = ">=3.2.0,<4.0.0"
flask = ">=0.10.1"
python-dateutil = ">=2.4.2"
[[package]]
name = "gtfs-realtime-bindings"
version = "1.0.0"
description = "Python classes generated from the GTFS-realtime protocol buffer specification."
optional = false
python-versions = "*"
files = [
{file = "gtfs-realtime-bindings-1.0.0.tar.gz", hash = "sha256:2e8ced8904400cc93ab7e8520adb6934cfa601edacc6f593fc2cb4448662bb47"},
]
[package.dependencies]
protobuf = "*"
setuptools = "*"
[[package]]
name = "idna"
version = "3.4"
description = "Internationalized Domain Names in Applications (IDNA)"
optional = false
python-versions = ">=3.5"
files = [
{file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"},
{file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"},
]
[[package]]
name = "itsdangerous"
version = "2.1.2"
description = "Safely pass data to untrusted environments and back."
optional = false
python-versions = ">=3.7"
files = [
{file = "itsdangerous-2.1.2-py3-none-any.whl", hash = "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44"},
{file = "itsdangerous-2.1.2.tar.gz", hash = "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a"},
]
[[package]]
name = "jinja2"
version = "3.1.2"
description = "A very fast and expressive template engine."
optional = false
python-versions = ">=3.7"
files = [
{file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
{file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
]
[package.dependencies]
MarkupSafe = ">=2.0"
[package.extras]
i18n = ["Babel (>=2.7)"]
[[package]]
name = "markupsafe"
version = "2.1.3"
description = "Safely add untrusted strings to HTML/XML markup."
optional = false
python-versions = ">=3.7"
files = [
{file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"},
{file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"},
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"},
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"},
{file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"},
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"},
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"},
{file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"},
{file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"},
{file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"},
{file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"},
{file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"},
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"},
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"},
{file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"},
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"},
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"},
{file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"},
{file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"},
{file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"},
{file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"},
{file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"},
{file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"},
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"},
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"},
{file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"},
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"},
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"},
{file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"},
{file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"},
{file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"},
{file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"},
{file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"},
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"},
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"},
{file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"},
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"},
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"},
{file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"},
{file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"},
{file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"},
{file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"},
]
[[package]]
name = "numpy"
version = "1.25.1"
description = "Fundamental package for array computing in Python"
optional = false
python-versions = ">=3.9"
files = [
{file = "numpy-1.25.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:77d339465dff3eb33c701430bcb9c325b60354698340229e1dff97745e6b3efa"},
{file = "numpy-1.25.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d736b75c3f2cb96843a5c7f8d8ccc414768d34b0a75f466c05f3a739b406f10b"},
{file = "numpy-1.25.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a90725800caeaa160732d6b31f3f843ebd45d6b5f3eec9e8cc287e30f2805bf"},
{file = "numpy-1.25.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c6c9261d21e617c6dc5eacba35cb68ec36bb72adcff0dee63f8fbc899362588"},
{file = "numpy-1.25.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0def91f8af6ec4bb94c370e38c575855bf1d0be8a8fbfba42ef9c073faf2cf19"},
{file = "numpy-1.25.1-cp310-cp310-win32.whl", hash = "sha256:fd67b306320dcadea700a8f79b9e671e607f8696e98ec255915c0c6d6b818503"},
{file = "numpy-1.25.1-cp310-cp310-win_amd64.whl", hash = "sha256:c1516db588987450b85595586605742879e50dcce923e8973f79529651545b57"},
{file = "numpy-1.25.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6b82655dd8efeea69dbf85d00fca40013d7f503212bc5259056244961268b66e"},
{file = "numpy-1.25.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e8f6049c4878cb16960fbbfb22105e49d13d752d4d8371b55110941fb3b17800"},
{file = "numpy-1.25.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41a56b70e8139884eccb2f733c2f7378af06c82304959e174f8e7370af112e09"},
{file = "numpy-1.25.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5154b1a25ec796b1aee12ac1b22f414f94752c5f94832f14d8d6c9ac40bcca6"},
{file = "numpy-1.25.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:38eb6548bb91c421261b4805dc44def9ca1a6eef6444ce35ad1669c0f1a3fc5d"},
{file = "numpy-1.25.1-cp311-cp311-win32.whl", hash = "sha256:791f409064d0a69dd20579345d852c59822c6aa087f23b07b1b4e28ff5880fcb"},
{file = "numpy-1.25.1-cp311-cp311-win_amd64.whl", hash = "sha256:c40571fe966393b212689aa17e32ed905924120737194b5d5c1b20b9ed0fb171"},
{file = "numpy-1.25.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3d7abcdd85aea3e6cdddb59af2350c7ab1ed764397f8eec97a038ad244d2d105"},
{file = "numpy-1.25.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1a180429394f81c7933634ae49b37b472d343cccb5bb0c4a575ac8bbc433722f"},
{file = "numpy-1.25.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d412c1697c3853c6fc3cb9751b4915859c7afe6a277c2bf00acf287d56c4e625"},
{file = "numpy-1.25.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20e1266411120a4f16fad8efa8e0454d21d00b8c7cee5b5ccad7565d95eb42dd"},
{file = "numpy-1.25.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f76aebc3358ade9eacf9bc2bb8ae589863a4f911611694103af05346637df1b7"},
{file = "numpy-1.25.1-cp39-cp39-win32.whl", hash = "sha256:247d3ffdd7775bdf191f848be8d49100495114c82c2bd134e8d5d075fb386a1c"},
{file = "numpy-1.25.1-cp39-cp39-win_amd64.whl", hash = "sha256:1d5d3c68e443c90b38fdf8ef40e60e2538a27548b39b12b73132456847f4b631"},
{file = "numpy-1.25.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:35a9527c977b924042170a0887de727cd84ff179e478481404c5dc66b4170009"},
{file = "numpy-1.25.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d3fe3dd0506a28493d82dc3cf254be8cd0d26f4008a417385cbf1ae95b54004"},
{file = "numpy-1.25.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:012097b5b0d00a11070e8f2e261128c44157a8689f7dedcf35576e525893f4fe"},
{file = "numpy-1.25.1.tar.gz", hash = "sha256:9a3a9f3a61480cc086117b426a8bd86869c213fc4072e606f01c4e4b66eb92bf"},
]
[[package]]
name = "pandas"
version = "2.0.3"
description = "Powerful data structures for data analysis, time series, and statistics"
optional = false
python-versions = ">=3.8"
files = [
{file = "pandas-2.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4c7c9f27a4185304c7caf96dc7d91bc60bc162221152de697c98eb0b2648dd8"},
{file = "pandas-2.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f167beed68918d62bffb6ec64f2e1d8a7d297a038f86d4aed056b9493fca407f"},
{file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce0c6f76a0f1ba361551f3e6dceaff06bde7514a374aa43e33b588ec10420183"},
{file = "pandas-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba619e410a21d8c387a1ea6e8a0e49bb42216474436245718d7f2e88a2f8d7c0"},
{file = "pandas-2.0.3-cp310-cp310-win32.whl", hash = "sha256:3ef285093b4fe5058eefd756100a367f27029913760773c8bf1d2d8bebe5d210"},
{file = "pandas-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:9ee1a69328d5c36c98d8e74db06f4ad518a1840e8ccb94a4ba86920986bb617e"},
{file = "pandas-2.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b084b91d8d66ab19f5bb3256cbd5ea661848338301940e17f4492b2ce0801fe8"},
{file = "pandas-2.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:37673e3bdf1551b95bf5d4ce372b37770f9529743d2498032439371fc7b7eb26"},
{file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9cb1e14fdb546396b7e1b923ffaeeac24e4cedd14266c3497216dd4448e4f2d"},
{file = "pandas-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9cd88488cceb7635aebb84809d087468eb33551097d600c6dad13602029c2df"},
{file = "pandas-2.0.3-cp311-cp311-win32.whl", hash = "sha256:694888a81198786f0e164ee3a581df7d505024fbb1f15202fc7db88a71d84ebd"},
{file = "pandas-2.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:6a21ab5c89dcbd57f78d0ae16630b090eec626360085a4148693def5452d8a6b"},
{file = "pandas-2.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4da0d45e7f34c069fe4d522359df7d23badf83abc1d1cef398895822d11061"},
{file = "pandas-2.0.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:32fca2ee1b0d93dd71d979726b12b61faa06aeb93cf77468776287f41ff8fdc5"},
{file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:258d3624b3ae734490e4d63c430256e716f488c4fcb7c8e9bde2d3aa46c29089"},
{file = "pandas-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9eae3dc34fa1aa7772dd3fc60270d13ced7346fcbcfee017d3132ec625e23bb0"},
{file = "pandas-2.0.3-cp38-cp38-win32.whl", hash = "sha256:f3421a7afb1a43f7e38e82e844e2bca9a6d793d66c1a7f9f0ff39a795bbc5e02"},
{file = "pandas-2.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:69d7f3884c95da3a31ef82b7618af5710dba95bb885ffab339aad925c3e8ce78"},
{file = "pandas-2.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5247fb1ba347c1261cbbf0fcfba4a3121fbb4029d95d9ef4dc45406620b25c8b"},
{file = "pandas-2.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:81af086f4543c9d8bb128328b5d32e9986e0c84d3ee673a2ac6fb57fd14f755e"},
{file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1994c789bf12a7c5098277fb43836ce090f1073858c10f9220998ac74f37c69b"},
{file = "pandas-2.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ec591c48e29226bcbb316e0c1e9423622bc7a4eaf1ef7c3c9fa1a3981f89641"},
{file = "pandas-2.0.3-cp39-cp39-win32.whl", hash = "sha256:04dbdbaf2e4d46ca8da896e1805bc04eb85caa9a82e259e8eed00254d5e0c682"},
{file = "pandas-2.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:1168574b036cd8b93abc746171c9b4f1b83467438a5e45909fed645cf8692dbc"},
{file = "pandas-2.0.3.tar.gz", hash = "sha256:c02f372a88e0d17f36d3093a644c73cfc1788e876a7c4bcb4020a77512e2043c"},
]
[package.dependencies]
numpy = [
{version = ">=1.21.0", markers = "python_version >= \"3.10\""},
{version = ">=1.23.2", markers = "python_version >= \"3.11\""},
]
python-dateutil = ">=2.8.2"
pytz = ">=2020.1"
tzdata = ">=2022.1"
[package.extras]
all = ["PyQt5 (>=5.15.1)", "SQLAlchemy (>=1.4.16)", "beautifulsoup4 (>=4.9.3)", "bottleneck (>=1.3.2)", "brotlipy (>=0.7.0)", "fastparquet (>=0.6.3)", "fsspec (>=2021.07.0)", "gcsfs (>=2021.07.0)", "html5lib (>=1.1)", "hypothesis (>=6.34.2)", "jinja2 (>=3.0.0)", "lxml (>=4.6.3)", "matplotlib (>=3.6.1)", "numba (>=0.53.1)", "numexpr (>=2.7.3)", "odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pandas-gbq (>=0.15.0)", "psycopg2 (>=2.8.6)", "pyarrow (>=7.0.0)", "pymysql (>=1.0.2)", "pyreadstat (>=1.1.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)", "python-snappy (>=0.6.0)", "pyxlsb (>=1.0.8)", "qtpy (>=2.2.0)", "s3fs (>=2021.08.0)", "scipy (>=1.7.1)", "tables (>=3.6.1)", "tabulate (>=0.8.9)", "xarray (>=0.21.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)", "zstandard (>=0.15.2)"]
aws = ["s3fs (>=2021.08.0)"]
clipboard = ["PyQt5 (>=5.15.1)", "qtpy (>=2.2.0)"]
compression = ["brotlipy (>=0.7.0)", "python-snappy (>=0.6.0)", "zstandard (>=0.15.2)"]
computation = ["scipy (>=1.7.1)", "xarray (>=0.21.0)"]
excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.0.7)", "pyxlsb (>=1.0.8)", "xlrd (>=2.0.1)", "xlsxwriter (>=1.4.3)"]
feather = ["pyarrow (>=7.0.0)"]
fss = ["fsspec (>=2021.07.0)"]
gcp = ["gcsfs (>=2021.07.0)", "pandas-gbq (>=0.15.0)"]
hdf5 = ["tables (>=3.6.1)"]
html = ["beautifulsoup4 (>=4.9.3)", "html5lib (>=1.1)", "lxml (>=4.6.3)"]
mysql = ["SQLAlchemy (>=1.4.16)", "pymysql (>=1.0.2)"]
output-formatting = ["jinja2 (>=3.0.0)", "tabulate (>=0.8.9)"]
parquet = ["pyarrow (>=7.0.0)"]
performance = ["bottleneck (>=1.3.2)", "numba (>=0.53.1)", "numexpr (>=2.7.1)"]
plot = ["matplotlib (>=3.6.1)"]
postgresql = ["SQLAlchemy (>=1.4.16)", "psycopg2 (>=2.8.6)"]
spss = ["pyreadstat (>=1.1.2)"]
sql-other = ["SQLAlchemy (>=1.4.16)"]
test = ["hypothesis (>=6.34.2)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)"]
xml = ["lxml (>=4.6.3)"]
[[package]]
name = "protobuf"
version = "4.23.4"
description = ""
optional = false
python-versions = ">=3.7"
files = [
{file = "protobuf-4.23.4-cp310-abi3-win32.whl", hash = "sha256:5fea3c64d41ea5ecf5697b83e41d09b9589e6f20b677ab3c48e5f242d9b7897b"},
{file = "protobuf-4.23.4-cp310-abi3-win_amd64.whl", hash = "sha256:7b19b6266d92ca6a2a87effa88ecc4af73ebc5cfde194dc737cf8ef23a9a3b12"},
{file = "protobuf-4.23.4-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8547bf44fe8cec3c69e3042f5c4fb3e36eb2a7a013bb0a44c018fc1e427aafbd"},
{file = "protobuf-4.23.4-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:fee88269a090ada09ca63551bf2f573eb2424035bcf2cb1b121895b01a46594a"},
{file = "protobuf-4.23.4-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:effeac51ab79332d44fba74660d40ae79985901ac21bca408f8dc335a81aa597"},
{file = "protobuf-4.23.4-cp37-cp37m-win32.whl", hash = "sha256:c3e0939433c40796ca4cfc0fac08af50b00eb66a40bbbc5dee711998fb0bbc1e"},
{file = "protobuf-4.23.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9053df6df8e5a76c84339ee4a9f5a2661ceee4a0dab019e8663c50ba324208b0"},
{file = "protobuf-4.23.4-cp38-cp38-win32.whl", hash = "sha256:e1c915778d8ced71e26fcf43c0866d7499891bca14c4368448a82edc61fdbc70"},
{file = "protobuf-4.23.4-cp38-cp38-win_amd64.whl", hash = "sha256:351cc90f7d10839c480aeb9b870a211e322bf05f6ab3f55fcb2f51331f80a7d2"},
{file = "protobuf-4.23.4-cp39-cp39-win32.whl", hash = "sha256:6dd9b9940e3f17077e820b75851126615ee38643c2c5332aa7a359988820c720"},
{file = "protobuf-4.23.4-cp39-cp39-win_amd64.whl", hash = "sha256:0a5759f5696895de8cc913f084e27fd4125e8fb0914bb729a17816a33819f474"},
{file = "protobuf-4.23.4-py3-none-any.whl", hash = "sha256:e9d0be5bf34b275b9f87ba7407796556abeeba635455d036c7351f7c183ef8ff"},
{file = "protobuf-4.23.4.tar.gz", hash = "sha256:ccd9430c0719dce806b93f89c91de7977304729e55377f872a92465d548329a9"},
]
[[package]]
name = "python-dateutil"
version = "2.8.2"
description = "Extensions to the standard Python datetime module"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
files = [
{file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"},
{file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
]
[package.dependencies]
six = ">=1.5"
[[package]]
name = "python-dotenv"
version = "1.0.0"
description = "Read key-value pairs from a .env file and set them as environment variables"
optional = false
python-versions = ">=3.8"
files = [
{file = "python-dotenv-1.0.0.tar.gz", hash = "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba"},
{file = "python_dotenv-1.0.0-py3-none-any.whl", hash = "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"},
]
[package.extras]
cli = ["click (>=5.0)"]
[[package]]
name = "pytz"
version = "2023.3"
description = "World timezone definitions, modern and historical"
optional = false
python-versions = "*"
files = [
{file = "pytz-2023.3-py2.py3-none-any.whl", hash = "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb"},
{file = "pytz-2023.3.tar.gz", hash = "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588"},
]
[[package]]
name = "requests"
version = "2.31.0"
description = "Python HTTP for Humans."
optional = false
python-versions = ">=3.7"
files = [
{file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"},
{file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"},
]
[package.dependencies]
certifi = ">=2017.4.17"
charset-normalizer = ">=2,<4"
idna = ">=2.5,<4"
urllib3 = ">=1.21.1,<3"
[package.extras]
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
[[package]]
name = "setuptools"
version = "68.0.0"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
optional = false
python-versions = ">=3.7"
files = [
{file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"},
{file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"},
]
[package.extras]
docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"]
testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"]
testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"]
[[package]]
name = "six"
version = "1.16.0"
description = "Python 2 and 3 compatibility utilities"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
files = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
]
[[package]]
name = "tzdata"
version = "2023.3"
description = "Provider of IANA time zone data"
optional = false
python-versions = ">=2"
files = [
{file = "tzdata-2023.3-py2.py3-none-any.whl", hash = "sha256:7e65763eef3120314099b6939b5546db7adce1e7d6f2e179e3df563c70511eda"},
{file = "tzdata-2023.3.tar.gz", hash = "sha256:11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a"},
]
[[package]]
name = "tzlocal"
version = "5.0.1"
description = "tzinfo object for the local timezone"
optional = false
python-versions = ">=3.7"
files = [
{file = "tzlocal-5.0.1-py3-none-any.whl", hash = "sha256:f3596e180296aaf2dbd97d124fe76ae3a0e3d32b258447de7b939b3fd4be992f"},
{file = "tzlocal-5.0.1.tar.gz", hash = "sha256:46eb99ad4bdb71f3f72b7d24f4267753e240944ecfc16f25d2719ba89827a803"},
]
[package.dependencies]
tzdata = {version = "*", markers = "platform_system == \"Windows\""}
[package.extras]
devenv = ["black", "check-manifest", "flake8", "pyroma", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"]
[[package]]
name = "urllib3"
version = "2.0.3"
description = "HTTP library with thread-safe connection pooling, file post, and more."
optional = false
python-versions = ">=3.7"
files = [
{file = "urllib3-2.0.3-py3-none-any.whl", hash = "sha256:48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1"},
{file = "urllib3-2.0.3.tar.gz", hash = "sha256:bee28b5e56addb8226c96f7f13ac28cb4c301dd5ea8a6ca179c0b9835e032825"},
]
[package.extras]
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"]
socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "werkzeug"
version = "2.3.6"
description = "The comprehensive WSGI web application library."
optional = false
python-versions = ">=3.8"
files = [
{file = "Werkzeug-2.3.6-py3-none-any.whl", hash = "sha256:935539fa1413afbb9195b24880778422ed620c0fc09670945185cce4d91a8890"},
{file = "Werkzeug-2.3.6.tar.gz", hash = "sha256:98c774df2f91b05550078891dee5f0eb0cb797a522c757a2452b9cee5b202330"},
]
[package.dependencies]
MarkupSafe = ">=2.1.1"
[package.extras]
watchdog = ["watchdog (>=2.3)"]
[metadata]
lock-version = "2.0"
python-versions = "^3.11"
content-hash = "b83544c2e96f0f4a8d437d6b7723918d1309cbf6063f2b2e1cf7a53ea13e6936"
+71 -15
View File
@@ -1,21 +1,77 @@
[tool.poetry]
[project]
name = "pi-mta-sign"
version = "1.0.0"
version = "0.1.0"
description = ""
authors = ["lucas.oskorep <lucas.oskorep@gmail.com>"]
authors = [{ name = "Lucas Oskorep", email = "lucas.oskorep@gmail.com" }]
license = "MIT"
readme = "README.md"
packages = [{include = "pi_mta_sign"}]
[tool.poetry.dependencies]
python = "^3.11"
requests = "^2.31.0"
gtfs-realtime-bindings = "^1.0.0"
flask-apscheduler = "^1.12.4"
python-dotenv = "^1.0.0"
pandas = "^2.0.3"
flask = {extras = ["async"], version = "^2.3.2"}
requires-python = ">=3.14"
dependencies = [
"requests>=2.31.0",
"fastapi>=0.100.0",
"uvicorn>=0.22.0",
"python-dotenv>=1.0.0",
"fastapi-utils>=0.2.1",
"gtfs-realtime-bindings>=1.0.0",
"typing_inspect>=0.9.0",
]
[dependency-groups]
dev = [
"ruff>=0.0.277",
"pytest>=8.0.0",
"httpx>=0.27.0",
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["mta_api_client", "mta_sign_server"]
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 120
# Target Python 3.14.
target-version = "py314"
[tool.ruff.lint]
# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
select = ["E", "F"]
ignore = []
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
+9
View File
@@ -0,0 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"matchPackageNames": ["tailwindcss"],
"allowedVersions": "<4.0.0"
}
]
}

Some files were not shown because too many files have changed in this diff Show More