Metadata-Version: 2.4
Name: yamtam
Version: 0.3.1
Summary: CLI utility for parsing data from yamtam.nyc
Home-page: http://github.com/tolidano/yamtam
Author: Shawn Tolidano
Author-email: Shawn Tolidano <shawn@yamtam.nyc>
License: Copyright 2024 yamtam
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/tolidano/yamtam
Project-URL: Issues, https://github.com/tolidano/yamtam
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.32.2
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# yamtam cli

CLI to access real-time NYC metro-area transit data from yamtam.nyc.

Reads the cadence-separated data files yamtam.nyc publishes (realtime trips and
static stops per system, plus the shared route-color map) and prints arrivals
for the stations you care about.

```
usage: yamtam.py [-h] [--rt RT] [--stop STOP] [--system SYSTEM]

options:
  -h, --help       show this help message and exit
  --rt RT          Repeated optional routes (e.g. E, F, 7, LIRR1, MNR1)
  --stop STOP      Repeated optional stops (station name or GTFS id)
  --system SYSTEM  Repeated optional systems (subway, lirr, mnr, ferry, bus)
```

## Examples

Show next arrivals at Court Sq-23 St on the subway:

```
yamtam --stop "Court Sq" --system subway
```

Show only the E and F at a station:

```
yamtam --stop "Court Sq-23 St" --rt E --rt F
```

## Behavior

- **Systems**: `subway`, `lirr`, `mnr`, `ferry`, `bus`. Defaults to all.
- **Express merge**: express trains (FX, 7X, 6X) are folded into their local
  route (F, 7, 6) so one destination shows one combined row.
- **Direction ordering**: southbound groups are listed first, then northbound.
- **Headings**: subway arrivals are grouped by destination borough (e.g.
  `Southbound (Brooklyn-bound)`); LIRR westbound notes whether the train
  terminates at Penn Station or Grand Central.
- **Route badges**: subway symbols are centered in a 5-char color bar
  (e.g. `  E  `), while LIRR/MNR/bus codes start at the 2nd character
  (e.g. ` L1  `, ` L10 `, ` M20 `). Commuter-rail codes are shortened
  (LIRR1 -> L1, MNR1 -> M1).
- **Colors**: routes are tinted with their official hex color when the terminal
  supports 24-bit ANSI color.
- **Caching**: feeds are cached under `/tmp/yamtam/` and refreshed only when
  stale (realtime every ~2 min, static stops/colors daily).

## Development

```
python3 -m pytest cli/yamtam/tests/
ruff format cli/yamtam/
ruff check cli/yamtam/
```
