Skip to main content

Taxi Route Simulator

A generator for simulated NYC taxi data streams.

Installation

pip install .

Usage

Command Line

Run the simulator and output JSON lines to stdout:

taxi-sim

Python API

from taxi_simulator import stream_taxi_data

for event in stream_taxi_data(num_cars=5, speed_kmh=80):
    print(f"Car {event['car_id']} is at {event['latitude']}, {event['longitude']}")
    
    if event['speed_kmh'] > 100:
        print("Warning: Speeding!")

Parameters

Parameter Default Description
num_cars 10 Number of simulated cars
speed_kmh 60.0 Base speed in km/h (actual speed varies ±20%)
update_interval 0.5 Time between updates in seconds
realtime_factor 5.0 Speed multiplier for simulation
custom_routes_file None Path to custom routes JSON file

Output Format

Each event is a dictionary with the following fields:

{
  "car_id": "car_0001",
  "time": "2024-01-15T12:30:45.123456+00:00",
  "longitude": -73.976964,
  "latitude": 40.755987,
  "speed_kmh": 62.4
}

Custom Routes

You can provide your own routes file in JSON format. The simulator supports various GeoJSON-like structures and will automatically extract coordinate arrays. Example:

[
  {
    "geometry": {
      "coordinates": [[-73.976, 40.755], [-73.975, 40.756]]
    }
  }
]

Metadata

Release files for timeplus-taxi-simulator 0.1.0

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

Source distribution (sdist)

Source distribution for timeplus-taxi-simulator 0.1.0
File Size Uploaded Provenance Actions
timeplus_taxi_simulator-0.1.0.tar.gz 2.2 MB Without provenance Details for timeplus_taxi_simulator-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for timeplus-taxi-simulator 0.1.0
File Interpreter ABI Platform Actions
timeplus_taxi_simulator-0.1.0-py3-none-any.whl Python 3 none any Details for timeplus_taxi_simulator-0.1.0-py3-none-any.whl

Total release size: 4.5 MB

Release files / timeplus_taxi_simulator-0.1.0.tar.gz

Download URL timeplus_taxi_simulator-0.1.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
68dbc7b77ae8de8a6d245f4a9e68b7bfdfe5fb6c45d40af056fabd02b49799c7
BLAKE2b-256 checksum
How to use checksums
d316258fa49eb5d28e54774b510b572d80e5902ca55bd420078402a2b300182b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / timeplus_taxi_simulator-0.1.0-py3-none-any.whl

Download URL timeplus_taxi_simulator-0.1.0-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
330f34e4a88bc5c31485a41a9a8a3055fe028687ab86d72c0343d68219fbfa2c
BLAKE2b-256 checksum
How to use checksums
eed36e3e21e32c4792d83b73c219274b4b4d019a4df7ca928f78133defeca25d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Security for timeplus-taxi-simulator 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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