Skip to main content

Python Package for the RealTime Trains API.

Project description

RealTime Trains API Python Module

Maintained by @anonymous44401

PyPI License Issues

View our latest release

Documentation

About this package

realtime-trains-py is a python package designed to allow you to access data directly from the Realtime Trains API, in a simple and user-friendly way. The package includes 5 different complexity modes that allow you to customise the data you want to see.

This package can be used for anything railway related, whether you're a rail enthusiast or commuter, this package can be used for all your purposes. The package can be used in personal applications or for personal rail data access.

What can I do with this package?

This package allows you to access data directly from the Realtime Trains API using one of 5 complexities. Each complexity mode gives you access to different data the API offers.

For the most freedom with the API, you can use complex mode. Complex mode lets you access all the data available from the Realtime Trains API. This mode does not format any data for you - it creates new .json files with the data you requested. This mode is recommended for those who have a good understanding of python and managing json files.

For a mix of freedom and flexibility, you can use advanced mode. Advanced mode allows you to access most the data available from the Realtime Trains API, but it comes with a time constraint. You can't request data more than 7 days prior to the current date nor 80 days after the current date.

Using advanced and simple mode, you can optionally select between prettier or normal mode. Prettier mode gives you your data in a nicely formatted table, while normal mode gives you your data as a list of objects, so you'll need to get the data out of the objects yourself. Don't worry though, we have plenty of documentation to help you out!

Installation Instructions

To install the package, simply run the following command in your terminal:

$ pip install realtime-trains-py

Alternatively, you can clone, fork or download the repository onto your device.

Once installed, you can import the package. Place the lines below in your file, or you can run them directly in your terminal.

from realtime_trains_py import RealtimeTrainsPy

rtt = RealtimeTrainsPy(username = "your_username", password = "your_password", complexity = "c")

Check out the documentation for more help setting up.

[!IMPORTANT] You need an RTT API account to access this package. You can sign up for free at the API home page.

Examples of this package

The example below will return you up to 15 rows on the departure board for London King's Cross at the time you run the program.

rtt.get_departures_board(tiploc = "KNGX", rows = 15)

The example below will return you up to 15 rows on the arrivals board for London King's Cross at the time you run the program.

rtt.get_arrivals_board(tiploc = "KNGX", rows = 15)

More in-depth examples can be found on our GitHub wiki.

License

The realtime-trains-py API Wrapper uses an MIT License.

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

realtime_trains_py-1.1.2b1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

realtime_trains_py-1.1.2b1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file realtime_trains_py-1.1.2b1.tar.gz.

File metadata

  • Download URL: realtime_trains_py-1.1.2b1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for realtime_trains_py-1.1.2b1.tar.gz
Algorithm Hash digest
SHA256 80f003c7c098ffbd70397902fbcf90a21590377a3e7af188abaacbf2423145cb
MD5 31abfb382c740f9617cf17859955b4c0
BLAKE2b-256 ec9e467fd8c3652ca7ff38b543a2ba13497da0b7055d7c1f8549b7050a7960ef

See more details on using hashes here.

File details

Details for the file realtime_trains_py-1.1.2b1-py3-none-any.whl.

File metadata

File hashes

Hashes for realtime_trains_py-1.1.2b1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd6088d8c52bbce9f9c90b528f155be61adcb12e6e9e32759a73124248860cd2
MD5 c0e0c3636a8d665976d48e181b168f00
BLAKE2b-256 e808da5f15bc43c10cc633076f7075b7c81837c2aff9363b9949e46a2ff51d02

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