Skip to content

Caching #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eccdcfc
Get Route By ID
athuler Aug 19, 2024
e74182b
get Stop by ID implementation
athuler Aug 19, 2024
0c5e2cc
Fixed some missing route and vehicle values.
dmv1167 Sep 28, 2024
9f3d361
Simple caching system with refresh() method for systems and routes.
dmv1167 Sep 29, 2024
40ec984
Update CHANGELOG.md
athuler Sep 29, 2024
08db43d
Run Tests on Pull Requests
athuler Sep 29, 2024
57e31d0
Merge pull request #26 from athuler/athuler-pr-testing
athuler Sep 29, 2024
3bcd830
Removed use of 3rd party API
dmv1167 Sep 29, 2024
9204f02
Rudimentary caching system, needs time based implementation if user d…
dmv1167 Sep 29, 2024
19a7a06
Moved caching to separate branch
dmv1167 Sep 29, 2024
7f6b35d
Fixed get functions not caching their results
dmv1167 Sep 29, 2024
9fcd2f1
Merge branch '0.3.0' into dmv1167-dev
athuler Sep 29, 2024
3c92ece
Documentation, use of secondsSpent, remove Vehicle.getEtas()
dmv1167 Sep 29, 2024
ab48931
Fixed Stop.getNextVehicle() attempting to sort None
dmv1167 Sep 29, 2024
67efde0
Implemented casting so objects are created with correct types.
dmv1167 Sep 29, 2024
ca66a2d
Implemented casting so objects are created with correct types.
dmv1167 Sep 29, 2024
62b488c
Merge branch 'typing' of https://github.com/dmv1167/PassioGo into typing
dmv1167 Sep 29, 2024
db648c7
SystemAlert.id should be int
dmv1167 Sep 29, 2024
1902c17
Route.id actually should be int
dmv1167 Sep 29, 2024
214e1e3
Route.id cast to int
dmv1167 Sep 29, 2024
06a9b4f
returnInUTC argument added to eta methods
dmv1167 Sep 30, 2024
bf4aafd
Updated docs
dmv1167 Oct 1, 2024
e1dd21f
Merge branch '0.3.0' into typing
athuler Oct 1, 2024
31bfc6d
Stop.getNextVehicle() does not need to sort etas
dmv1167 Oct 1, 2024
38b6c59
Removed Route.getStop/VehicleById()
dmv1167 Oct 1, 2024
2831537
Merge pull request #28 from dmv1167/typing
athuler Oct 1, 2024
b1d5e3c
Moved Route.getStop/VehicleById()
dmv1167 Oct 1, 2024
e0004ae
Merge branch '0.3.0' into dmv1167-dev
athuler Oct 1, 2024
1758ed3
Fix indentation inconsistency
athuler Oct 1, 2024
aafeb65
Merge pull request #25 from dmv1167/dmv1167-dev
athuler Oct 1, 2024
3b4ca2e
Implemented dict caching for improved id lookup
dmv1167 Oct 3, 2024
e3e746f
Merged 0.3.0, gave getById() methods access to dict
dmv1167 Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: Testing Package

on: push
on: [push, pull_request]


permissions:
Expand All @@ -30,4 +30,4 @@ jobs:
- name: Test with pytest
run: |
pip install pytest pytest-cov
pytest
pytest
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Changelog


## 0.3.0 (Unreleased)

### Added

- `TransportationSystem.getRouteById()` method to get a Route object by its ID
- `TransportationSystem.getStopById()` method to get a Stop object by its ID

### Changed

- `Route.id` is now handled as a string

### Removed


## 0.2.2 (2024-09-10)

### Added


### Changed

- Fixed key error while fetching systems. (#22)

### Removed


## 0.2.1 (2024-08-18)

### Added
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![PyPI - Version](https://img.shields.io/pypi/v/passiogo?label=Latest%20Version&link=https%3A%2F%2Fpypi.org%2Fproject%2FPassioGo%2F)](https://pypi.org/project/PassioGo/)
[![Pepy Total Downlods](https://img.shields.io/pepy/dt/PassioGo)](https://www.pepy.tech/projects/passiogo)
[![GitHub Testing](https://img.shields.io/github/actions/workflow/status/athuler/passiogo/testing.yml?branch=main&label=tests)](https://github.com/athuler/PassioGo)
[![Documentation Status](https://readthedocs.org/projects/passiogo/badge/?version=latest)](https://passiogo.readthedocs.io/en/latest/?badge=latest)


Expand All @@ -20,7 +21,7 @@ pip install passiogo

## Documentation

Project documentation for the latest stable version is available at [passiogo.readthedocs.io](https://passiogo.readthedocs.io/). Documentation for other versions is available at [passiogo.readthedocs.io/en/X.X.X](https://passiogo.readthedocs.io/en/0.1.2/).
Project documentation for the latest stable version is available at [passiogo.readthedocs.io](https://passiogo.readthedocs.io/). Documentation for other versions is available at [passiogo.readthedocs.io/en/X.X.X](https://passiogo.readthedocs.io/en/0.3.0/).

The documentation is built using `mkdocs` and can be rebuilt using the following:

Expand Down
41 changes: 41 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@ passiogo.getSystemFromID(1068).getRoutes()
<passiogo.Route at 0x1d62db3fca0>]
```

### `TransportationSystem.getRouteById()`

Get the route for the appropriate ID.

**Input**:

- **routeId** (*str*): ID of the desired route
- **appVersion** (*int*): Version of the application (Default: 1)
- **amount** (*int*): Unknown (Default: 1)

**Output**: [`Route`](#route) or *None* if no match

```python
passiogo.getSystemFromID(1068).getRouteById(133007)
```

```
<passiogo.Route at 0x1c26a30a1c0>
```


### `TransportationSystem.getStops()`

Gets all stops for the given transportation system.
Expand Down Expand Up @@ -147,6 +168,26 @@ passiogo.getSystemFromID(1068).getStops()
<passiogo.Stop at 0x1d62da5a700>]
```

### `TransportationSystem.getStopById()`

Get the stop for the appropriate ID.

**Input**:

- **stopId** (*str*): ID of the desired stop
- **appVersion** (*int*): Version of the application (Default: 1)
- **sA** (*int*): Unknown (Default: 1)

**Output**: [`Stop`](#stop) or *None* if no match

```python
passiogo.getSystemFromID(3499).getStopById(140059)
```

```
<passiogo.Stop at 0x1c2690238e0>
```

### `TransportationSystem.getSystemAlerts()`

Gets all alerts for the corresponding transportation system.
Expand Down
Loading