Skip to content

Commit

Permalink
Prepare release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leona-ya committed Jul 31, 2020
1 parent 69923c0 commit 59311f3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
10 changes: 10 additions & 0 deletions docs/changelog.rst
@@ -0,0 +1,10 @@
Changelog
=========

.. contents::

v0.2.0
------
* [BREAKING] Changed return format of :func:`pyhafas.client.HafasClient.arrivals` and :func:`pyhafas.client.HafasClient.departures` methods
* [BREAKING] Removed deprecated parameter `max_journeys` in :func:`pyhafas.client.HafasClient.arrivals` and :func:`pyhafas.client.HafasClient.departures` methods
* [BUG] Fixed :func:`pyhafas.client.HafasClient.journey` request in VSN-Profile
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -25,7 +25,7 @@
author = 'n0emis, em0lar'

# The full version, including alpha/beta/rc tags
release = '0.1.0'
release = '0.2.0'


# -- General configuration ---------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions docs/glossary.rst
Expand Up @@ -11,6 +11,9 @@ Glossary
Abbreviation for `Friendly Public Transport Format <https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md>`_
- Used as the basis for returned data

Station Board
Generalization for :func:`arrivals <pyhafas.client.HafasClient.arrivals>` and :func:`departures <pyhafas.client.HafasClient.departures>` requests

product
A product is the generalization of all means of transport. When this term is used, all types of transport are meant (e.g. busses, regional trains, ferries).

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -44,3 +44,4 @@ Even better than creating an issue is creating a pull request. If you want to do
:caption: General

glossary
changelog
13 changes: 7 additions & 6 deletions docs/usage/get_started.rst
Expand Up @@ -9,12 +9,13 @@ Most other pyHaFAS-specific words are defined in the :doc:`/glossary`.
If one of these words is used in this documentation it's marked as a link with a superscript G as follows: :term:`profile`:superscript:`G`


======= =======
Term Meaning
======= =======
profile Customization for each HaFAS deployment - Contains the endpoint, tokens and possible changes for the deployment
FPTF Abbreviation for `Friendly Public Transport Format <https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md>`_ - Used as the basis for returned data
======= =======
============= =======
Term Meaning
============= =======
profile Customization for each HaFAS deployment - Contains the endpoint, tokens and possible changes for the deployment
FPTF Abbreviation for `Friendly Public Transport Format <https://github.com/public-transport/friendly-public-transport-format/blob/master/spec/readme.md>`_ - Used as the basis for returned data
Station Board Generalization for :func:`arrivals <pyhafas.client.HafasClient.arrivals>` and :func:`departures <pyhafas.client.HafasClient.departures>` requests
============= =======

Installation
------------
Expand Down
10 changes: 0 additions & 10 deletions pyhafas/client.py
Expand Up @@ -28,7 +28,6 @@ def departures(
self,
station: Union[Station, str],
date: datetime.datetime,
max_journeys: Optional[int] = None, # Deprecated, will be removed in 0.2.0
max_trips: int = -1,
duration: int = -1,
products: Dict[str, bool] = {}) -> List[StationBoardLeg]:
Expand All @@ -39,7 +38,6 @@ def departures(
:param station: FPTF `Station` object or ID of station
:param date: Date and Time when to search
:param max_journeys: (optional, deprecated, will be removed in 0.2.0) Use `max_trips` instead - Maximum number of trips to be returned. Default is "whatever HaFAS wants"
:param max_trips: (optional) Maximum number of trips to be returned. Default is "whatever HaFAS wants"
:param duration: (optional) Minutes after `date` in which is search is made. Default is "whatever HaFAS wants"
:param products: (optional) Dict of product name(s) and whether it should be enabled or not. Modifies the default products specified in the profile.
Expand All @@ -48,9 +46,6 @@ def departures(
if not isinstance(station, Station):
station = Station(id=station)

if max_journeys is not None:
max_trips = max_journeys

body = self.profile.format_station_board_request(
station,
StationBoardRequestType.DEPARTURE,
Expand All @@ -67,7 +62,6 @@ def arrivals(
self,
station: Union[Station, str],
date: datetime.datetime,
max_journeys: Optional[int] = None, # Deprecated, will be removed in 0.2.0
max_trips: int = -1,
duration: int = -1,
products: Dict[str, bool] = {}) -> List[StationBoardLeg]:
Expand All @@ -78,7 +72,6 @@ def arrivals(
:param station: FPTF `Station` object or ID of station
:param date: Date and Time when to search
:param max_journeys: (optional, deprecated, will be removed in 0.2.0) Use `max_trips` instead - Maximum number of trips to be returned. Default is "whatever HaFAS wants"
:param max_trips: (optional) Maximum number of trips to be returned. Default is "whatever HaFAS wants"
:param duration: (optional) Minutes after `date` in which is search is made. Default is "whatever HaFAS wants"
:param products: (optional) Dict of product name(s) and whether it should be enabled or not. Modifies the default products specified in the profile.
Expand All @@ -87,9 +80,6 @@ def arrivals(
if not isinstance(station, Station):
station = Station(id=station)

if max_journeys is not None:
max_trips = max_journeys

body = self.profile.format_station_board_request(
station,
StationBoardRequestType.ARRIVAL,
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@

setup(
name='pyhafas',
version='0.1.0',
version='0.2.0',
description='Python client for HAFAS public transport APIs',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

1 comment on commit 59311f3

@derhuerst
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Please sign in to comment.