Skip to main content

dvbpy

An unofficial Python module for querying Dresden's public transport system (VVO/DVB).

Want something like this for another language? Look here.

pip install dvb
from dvb import Client

client = Client(user_agent="my-app/1.0 (me@example.com)")

All API access goes through a Client instance, which requires a user_agent string identifying your project and providing contact details.

Find stops

client.find("Helmholtzstraße")
[
    Stop(id='33000742', name='Helmholtzstraße', city='', coords=Coords(lat=51.03, lng=13.73)),
    Stop(id='36030083', name='Helmholtzstr', city='Chemnitz', coords=Coords(lat=50.83, lng=12.93)),
    ...
]

Monitor a stop

client.monitor("Helmholtzstraße", limit=2)
[
    Departure(
        id='voe:11003: :H:j26',
        line='3',
        direction='Wilder Mann',
        scheduled=datetime(2025, 2, 22, 14, 41),
        real_time=datetime(2025, 2, 22, 14, 43, 50),
        state='Delayed',
        platform=Platform(name='1', type='Platform'),
        mode='Tram',
        occupancy='ManySeats',
    ),
    ...
]

Stop names are automatically resolved to IDs. You can also pass a numeric stop ID directly.

Plan a route

client.route("Helmholtzstraße", "Postplatz")
[
    Route(
        duration=11,
        interchanges=0,
        price='2,30',
        fare_zones='TZ 10 (Dresden)',
        cancelled=False,
        legs=[
            PartialRoute(
                duration=11,
                line='3',
                mode='Tram',
                direction='Btf Trachenberge',
                stops=[...],
            )
        ],
        session_id='367417461:efa4',
    ),
    ...
]

Use the session_id to paginate with client.earlier_later().

Map pins

Search for stops, POIs, and other points of interest within a bounding box.

client.pins(51.04, 13.70, 51.05, 13.72, pin_types=("Stop", "Platform"))
[
    Pin(id='33000028', name='Hauptbahnhof', city='Dresden', coords=Coords(...), type='Stop'),
    Pin(id='pf:1234', name='Hauptbahnhof Gleis 3', city='Dresden', coords=Coords(...), type='Platform'),
    ...
]

Lines at a stop

client.lines("33000742")
[
    Line(name='3', mode='Tram', directions=['Dresden Wilder Mann', 'Dresden Coschütz']),
    Line(name='66', mode='CityBus', directions=['Dresden Lockwitz']),
    ...
]

Route changes

client.route_changes()
[
    RouteChange(
        id='511595',
        title='Dresden - Mengsstraße, Vollsperrung',
        description='<p>...</p>',
        type='Scheduled',
        validity_periods=[ValidityPeriod(begin=..., end=...)],
        lines=['428296'],
    ),
    ...
]

Trip details

Get all stops for a specific departure (using the ID and time from a monitor response).

departure = client.monitor("Helmholtzstraße")[0]
client.trip_details(trip_id=departure.id, time=departure.scheduled, stop_id="33000742")

Reverse geocoding

client.address(51.04373, 13.70320)
Stop(id='33000144', name='Tharandter Straße', city='Dresden', coords=Coords(...))

Raw responses

All methods accept raw=True to get the unprocessed API response as a dict:

client.monitor("Helmholtzstraße", raw=True)
# Returns the raw JSON dict from the WebAPI

Error handling

from dvb import Client, APIError, ConnectionError

client = Client(user_agent="my-app/1.0 (me@example.com)")

try:
    client.monitor("Helmholtzstraße")
except ConnectionError:
    print("Network error or timeout")
except APIError:
    print("API returned an error")

Migrating from 2.x

dvb 3.0 introduces a Client class that requires a user_agent string. This helps the DVB/VVO identify API consumers and provides them with a way to reach out if needed.

  • All functions have moved from dvb.function() to client.function() on a Client instance
  • import dvb + dvb.monitor(...) → from dvb import Client + Client(user_agent="...").monitor(...)
  • All method signatures remain the same

Migrating from 1.x

dvb 2.0 was a complete rewrite with breaking changes:

  • All functions return frozen dataclasses instead of dicts/lists
  • Functions raise APIError/ConnectionError instead of printing errors and returning None
  • Migrated from legacy widget/EFA endpoints to the VVO WebAPI
  • Removed poi_coords() (use find()), interchange_prediction(), city/eduroam/deparr parameters
  • route() uses arrival=True/False instead of deparr="arr"/"dep", pins() uses pin_types=("Stop",) instead of pintypes="stop"
  • Dropped numpy
  • Requires Python >= 3.10

Development

uv sync --group dev
uv run ruff check .
uv run ruff format --check .
uv run mypy dvb/
uv run pytest

Metadata

Release files for dvb 3.0.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 dvb 3.0.0
File Size Uploaded Provenance Actions
dvb-3.0.0.tar.gz 62.5 kB With provenance Details for dvb-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dvb 3.0.0
File Interpreter ABI Platform Actions
dvb-3.0.0-py3-none-any.whl Python 3 none any Details for dvb-3.0.0-py3-none-any.whl

Total release size: 73.8 kB

Release files / dvb-3.0.0.tar.gz

Download URL dvb-3.0.0.tar.gz
Size 62.5 kB
Tags Source
SHA-256 checksum
How to use checksums
79216300aa92c1a65ffd8c6265abf30a53de02b503e8363a6b8707f4d92b9abb
BLAKE2b-256 checksum
How to use checksums
f41308c72ae9e731dfe620cc0131ad5928dfc5ea37f639cd60cb09da06f40250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / dvb-3.0.0-py3-none-any.whl

Download URL dvb-3.0.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f85070e7be20d920ca65a70679f0b5ab54b95f0c1f30c0720a3f3f54c4d29aca
BLAKE2b-256 checksum
How to use checksums
8e7980070705e8b9aa6fd24420e0aab6503d4cd4ce5a787358c974110f54d75c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Security for dvb 3.0.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dvb-3.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

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.

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