Metadata-Version: 2.4
Name: realtime-trains-py
Version: 2025.2.0
Summary: Python API Wrapper Package for the RealTime Trains API.
Project-URL: Repository, https://github.com/anonymous44401/realtime-trains-py
Project-URL: Issues, https://github.com/anonymous44401/realtime-trains-py/issues
Project-URL: Discord, https://discord.gg/8xcXSGhBAR
Author-email: anonymous44401 <anonymous4401.ad@gmail.com>
License: MIT License
        
        
        
        Copyright (c) [2025] [realtime-trains-lang]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.md
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# RealTime Trains API Python Module

Maintained and managed by members of [realtime-trains-lang](https://github.com/realtime-trains-lang)

![PyPI](https://img.shields.io/pypi/v/realtime-trains-py) ![License](https://img.shields.io/github/license/realtime-trains-lang/realtime-trains-py) ![Issues](https://img.shields.io/github/issues/realtime-trains-lang/realtime-trains-py)


### View our [release notes](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Release-Notes)

[Documentation](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Home)

## About this package

**realtime-trains-py** is an open-source python API Wrapper designed to allow you to access data directly from the Realtime Trains API, in a simple and user-friendly way. This package includes five different complexity modes that allow you to decide how you want to see the data provided by the API.

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. 

This package is not affiliated with [Realtime Trains](https://www.realtimetrains.co.uk/).

## What can I do with this package?
This package allows you to access data directly from the Realtime Trains API using one of [five complexities](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Complexity). 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.

For the most flexibility, you can use **simple** mode. Simple mode allows you to access lots the data available from the Realtime Trains API, but it comes with a time constraint 

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! If you're confused, we have plenty of [documentation](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Home) 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](https://github.com/realtime-trains-lang/realtime-trains-py) 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.
```python
from realtime_trains_py import RealtimeTrainsPy

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

Check out our full [setup guide](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Setup) for more help setting up.

You need an account for the Realtime Trains API to use this package. You can sign up for free at the [API home page](https://api.rtt.io). 


## Examples of this package

The example below will return up to 15 rows on the departure board for London King's Cross at the time you run the program. 
```python
rtt.get_departures(tiploc="KNGX", rows=15)
```

The example below will return up to 15 rows on the arrivals board for London King's Cross at the time you run the program. 
```python
rtt.get_arrivals(tiploc="KNGX", rows=15)
```

The example below will return the service information of G28171 (2H18 0958 London Liverpool Street to Cambridge North) at the time you run the program. 
```python
rtt.get_service(service_uid="G28171")
```

The example below will return up to 15 rows of departures and arrivals for London King's Cross at the time you run the program. 
```python
rtt.get_station(tiploc="KNGX", rows=15)
```

More in-depth examples can be found on our [examples page](https://github.com/realtime-trains-lang/realtime-trains-py/wiki/Examples). 


## License

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