Skip to main content

Do requests to the hvv abfahrtsmonitor and get parsed data

Project description

HVV Abfahrtsmonitor

To be used with links generated at https://abfahrten.hvv.de/

Generated urls need to be changed to include api/monitors (See Sample file contents)

Usage

from hvvabfahrtsmonitor.hvvabfahrtsmonitor import HvvAbfahrtsmonitor
monitor = Monitor(file, schema_file)
monitor.get_times() #Get a dict of lists of times, in minutes, for when the buses/metros/trains are due next.

Sample file contents (JSON)

{
	"data": [{
			"name": "S",
			"url": "https://abfahrten.hvv.de/api/monitors/a038583f-f72b-4e4e-ba22-9d9903ced316"
		},
		{
			"name": "B",
			"url": "https://abfahrten.hvv.de/api/monitors/f76a6c23-a682-4297-aa99-f815157e2bca"
		}
	]
}

Sample schema_file (JSON schema)

{
  "$schema":"http://json-schema.org/draft-07/schema#",
  "title":"Hvv Schema",
  "definitions":{
    "departure":{
      "type": "object",
      "properties":{
        "delay":{
          "type":"string"
        },
        "direction":{
          "type":"string"
        },
        "hasDelay":{
          "type":"boolean"
        },
        "icon":{
          "type":"object"
        },
        "line":{
          "type":"string"
        },
        "station":{
          "type":"string"
        },
        "time":{
          "type":"string"
        }
      },
      "required": ["hasDelay", "line", "time"]
    }
  },
  "type":"object",
  "properties":{
    "data":{
      "type":"object",
      "properties":{
        "attributes":{
          "type":"object",
          "properties":{
            "departures":{
              "type":"array",
              "items":{"$ref":"#/definitions/departure"}
            }
          }
        }
      }
    }
  }
}

Project details


Download files

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

Source Distribution

hvvabfahrtsmonitor-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

hvvabfahrtsmonitor-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file hvvabfahrtsmonitor-0.1.0.tar.gz.

File metadata

  • Download URL: hvvabfahrtsmonitor-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for hvvabfahrtsmonitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0bbae604316d22d6c45c43e68be86d056b3e56a85239443585c3e77ece4aa8da
MD5 963da01c77fbab417829546628f376c6
BLAKE2b-256 d7f4d4dac754205d48f78377cbffa5eabaeb09374ea1979456d481e3e22e7037

See more details on using hashes here.

File details

Details for the file hvvabfahrtsmonitor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hvvabfahrtsmonitor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for hvvabfahrtsmonitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b711cdec594319c50073eb7b5e6a19508c33bff41e7fd4d66786bfaf488f9323
MD5 05f7f1e2e32f02295b485d408f610e8f
BLAKE2b-256 b0193e494b2f33b831dd2f6b6488d12536ff778638dfe2c9da617e180f4e8257

See more details on using hashes here.

Supported by

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