Skip to content

Commit

Permalink
Version 20210814.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Aug 14, 2021
1 parent 7f50c1f commit 8a4bd1d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on the UTC date of the release.

`Contributions <https://github.com/mborsetti/airportdata/blob/master/CHANGELOG.rst>`__ always welcomed!

Version 20210814
Version 20210814.1
==================
* Updated EDDB (formerly IATA SXF) to be the new Berlin Brandenburg Airport (IATA BER)

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
airportsdata
============

.. |ICAO| replace:: 28,866
.. |ICAO| replace:: 28,865

.. |IATA| replace:: 6,561
.. |IATA| replace:: 6,560

.. |version| image:: https://img.shields.io/pypi/v/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
Expand Down
2 changes: 0 additions & 2 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Version 20210814
==================
* Updated EDDB (formerly IATA SXF) to be the new Berlin Brandenburg Airport (IATA BER)
44 changes: 22 additions & 22 deletions airportsdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@

__project_name__ = __package__
# Release numbering follows the release data
__version__ = "20210608.3"
__version__ = '20210814.1'
__min_python_version__ = (3, 6)
__author__ = "Mike Borsetti <mike@borsetti.com>"
__copyright__ = "Copyright 2020- Mike Borsetti"
__license__ = "MIT"
__url__ = f"https://github.com/mborsetti/{__project_name__}"
__author__ = 'Mike Borsetti <mike@borsetti.com>'
__copyright__ = 'Copyright 2020- Mike Borsetti'
__license__ = 'MIT'
__url__ = f'https://github.com/mborsetti/{__project_name__}'

if "TypedDict" in globals():
if 'TypedDict' in globals():
Airports = TypedDict(
"Airports",
'Airports',
{
"icao": str,
"iata": str,
"name": str,
"city": str,
"subd": str,
"country": str,
"elevation": float,
"lat": float,
"lon": float,
"tz": str,
'icao': str,
'iata': str,
'name': str,
'city': str,
'subd': str,
'country': str,
'elevation': float,
'lat': float,
'lon': float,
'tz': str,
},
)


def load(code_type: str = "ICAO") -> Dict[str, "Airports"]:
def load(code_type: str = 'ICAO') -> Dict[str, 'Airports']:
"""Loads airport data into a dict
:param code_type: optional argument defining the key in the dictionary: 'ICAO' (default if omitted) or 'IATA'
Expand Down Expand Up @@ -74,14 +74,14 @@ def load(code_type: str = "ICAO") -> Dict[str, "Airports"]:
#
#
this_dir = Path(__file__).parent
key = "icao" if code_type.lower() == "icao" else "iata"
key = 'icao' if code_type.lower() == 'icao' else 'iata'
airports = {}
with this_dir.joinpath("airports.csv").open(encoding="utf8") as f:
fieldnames = f.readline().replace('"', "").rstrip().split(",")
with this_dir.joinpath('airports.csv').open(encoding='utf8') as f:
fieldnames = f.readline().replace('"', '').rstrip().split(',')
reader = csv.DictReader(f, fieldnames=fieldnames, quoting=csv.QUOTE_NONNUMERIC)
for row in reader:
airports[row[key]] = row
airports.pop("", None)
airports.pop('', None)
return airports


Expand Down
3 changes: 1 addition & 2 deletions airportsdata/airports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7676,8 +7676,7 @@
"EDCW","","Wismar Airport","Wismar","Mecklenburg-Vorpommern","DE",43,53.9144439697,11.4994440079,"Europe/Berlin"
"EDCX","","Purkshof Airport","Rostock","Mecklenburg-Vorpommern","DE",66,54.1616668701,12.2486114502,"Europe/Berlin"
"EDCY","","Spremberg-Welzow Airport","Welzow","Brandenburg","DE",374,51.5755577087,14.1369438171,"Europe/Berlin"
"EDDB","BER","Berlin Brandenburg Airport","Berlin","Brandenburg","DE",157,52.362167,13.500667,
"Europe/Berlin"
"EDDB","BER","Berlin Brandenburg Airport","Berlin","Brandenburg","DE",157,52.362167,13.500667,"Europe/Berlin"
"EDDC","DRS","Dresden Airport","Dresden","Saxony","DE",755,51.1328010559,13.76720047,"Europe/Berlin"
"EDDE","ERF","Erfurt Airport","Erfurt","Thuringia","DE",1036,50.979801178,10.9581003189,"Europe/Berlin"
"EDDF","FRA","Frankfurt am Main International Airport","Frankfurt-am-Main","Hesse","DE",364,50.0264015198,8.543129921,"Europe/Berlin"
Expand Down

0 comments on commit 8a4bd1d

Please sign in to comment.