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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nysdotapi-1.0.1.post1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nysdotapi-1.0.1.post1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file nysdotapi-1.0.1.post1.tar.gz.

File metadata

  • Download URL: nysdotapi-1.0.1.post1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for nysdotapi-1.0.1.post1.tar.gz
Algorithm Hash digest
SHA256 653df474463237d31200a12bf05d4304c72c4be0c853178d40e0f4f1d7a49c9b
MD5 d87c564f6b09f36ec399c63c97cca5e2
BLAKE2b-256 df74e8f64b4de904c8e459b8f846041e900323d6350cdd4ded4a4e3787171e18

See more details on using hashes here.

File details

Details for the file nysdotapi-1.0.1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for nysdotapi-1.0.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6425e36aa11d545d0649d3f1556d897df8f9946c125e3455f30412bbcbb72582
MD5 4a6109d47c34568a158eecd7c386d4e4
BLAKE2b-256 092cb639fe2ccb25cc53e15277b7549846cbc8d70c2c70e43669d5fcc16a2372

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1.post1 This release

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page