Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

New York State Department of Transportation API

PyPI download month PyPI - Status PyPI GitHub

Installation

pip install nysdotapi

Authentication

  1. Visit the 511 NY website and create a new account
  2. Login to your account and request an API key here

Example

The following code cycles through live feeds of various traffic cameras at random.

from traffic import API

import random
import cv2

api = API("<insert-api-key>")

cameras = api.get_cameras()
print("Cameras:", len(cameras))

while True:
    camera = random.choice(cameras)
    
    try:
        with camera.get_stream() as stream:
            title = "LIVE: " + camera.roadway if camera.roadway else "LIVE"
                
            for i in range(100):
                frame = next(stream)
                
                cv2.imshow(title, frame)
                cv2.waitKey(1)
                
            cv2.destroyAllWindows()
    except KeyboardInterrupt:
        raise
    except StopIteration:
        pass

Metadata

Release files for nysdotapi 1.0.1.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nysdotapi 1.0.1.post1
File Size Uploaded
nysdotapi-1.0.1.post1.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nysdotapi 1.0.1.post1
File Interpreter ABI Platform
nysdotapi-1.0.1.post1-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / nysdotapi-1.0.1.post1.tar.gz

Download URL nysdotapi-1.0.1.post1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
653df474463237d31200a12bf05d4304c72c4be0c853178d40e0f4f1d7a49c9b
BLAKE2b-256 checksum
How to use checksums
df74e8f64b4de904c8e459b8f846041e900323d6350cdd4ded4a4e3787171e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / nysdotapi-1.0.1.post1-py3-none-any.whl

Download URL nysdotapi-1.0.1.post1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6425e36aa11d545d0649d3f1556d897df8f9946c125e3455f30412bbcbb72582
BLAKE2b-256 checksum
How to use checksums
092cb639fe2ccb25cc53e15277b7549846cbc8d70c2c70e43669d5fcc16a2372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.0.1.post1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page