semvec/pypi-packages huggingface dataset:
nysdotapi 1.0.1
NYS DOT Traffic Camera Python API
License: MIT
Keywords: ny,traffic,live,stream,feed,camera,road,street

# New York State Department of Transportation API

[![PyPI download month](https://img.shields.io/pypi/dm/nysdotapi.svg)](https://pypi.python.org/pypi/nysdotapi/)
[![PyPI - Status](https://img.shields.io/pypi/status/nysdotapi)](https://pypi.python.org/pypi/nysdotapi/)
[![PyPI](https://img.shields.io/pypi/v/nysdotapi)](https://pypi.python.org/pypi/nysdotapi/)
![GitHub](https://img.shields.io/github/license/ryanrudes/traffic)

## Installation
```bash
pip install nysdotapi
```

## Authentication
1. Visit the 511 NY [website](https://511ny.org/my511/register) and create a new account
2. Login to your account and request an API key [here](https://511ny.org/developers/help)

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

```python
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
```
container-scheduler 1.0.0
A scheduler for docker containers, made easy
License: MIT
Requires Python: >=3.7
Keywords: docker,container,schedule,container scheduler,schedule container,docker container scheduler,periodic,scheduling,clockwork,cron,scheduler,job scheduling,cronjob,cronjob scheduling

container-scheduler
===================

A scheduler for docker containers, made easy. Configure the desired schedule per each container and the library ensures
the container will be running at the correct timing.

Usage
-----

To start the scheduler, run the command below

.. code-block:: python

    import container_scheduler

    schedules = [
        {"container": "container_name_1", "crontab": "*/1 * * * *"},
        {"container": "container_name_2", "crontab": "0 4 * * *"}
    ]

    container_scheduler.start(schedules)

The function ``start`` is synchronous and will not return until the scheduler is running. To stop it gracefully,
you can send a ``SIGTERM`` or a ``SIGKILL`` signal.

The library was originally developed to work in a docker container, acting as a scheduler container for other
containers (take a look at `docker-container-scheduler <https://github.com/yusefmaali/docker-container-scheduler>`_)

Meta
----

Yusef Maali - contact@yusefmaali.net

The scheduling is executed by the `schedule-cronjob <https://github.com/yusefmaali/schedule-cronjob>`_ library, a fork of the
excellent `schedule <https://github.com/dbader/schedule>`_ from Daniel Bader.

Distributed under the MIT license. See `LICENSE.txt <https://github.com/yusefmaali/container-scheduler/blob/master/LICENSE.txt>`_ for more information.

https://github.com/yusefmaali/container-scheduler