Skip to content

Commit

Permalink
Version 20221017
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Oct 17, 2022
1 parent 24bc956 commit 587c9b5
Show file tree
Hide file tree
Showing 10 changed files with 1,950 additions and 1,934 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.9', '3.8', '3.7']
# for valid python-version see https://github.com/actions/python-versions/blob/main/versions-manifest.json
python-version: ['3.11.0-rc.2', '3.10', '3.9', '3.8', '3.7']
# for valid python-version see https://github.com/actions/python-versions/releases

env:
commitmsg: ${{ github.event.head_commit.message }} # only available at check-out; becomes env.commitmsg
Expand Down
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ repos:
types: [python]
require_serial: true
args: [--max-line-length, '120']
# additional_dependencies: [flake8-import-order] # conflicts with PyCharm's Optimize imports
- id: mypy # https://github.com/python/mypy
name: Static typing for Python (mypy)
entry: mypy
additional_dependencies: [mypy, pytest, types-backports]
language: python
types: [python]
args: [--show-error-codes]

# - repo: https://github.com/pycqa/doc8
# rev: 0.9.0a1
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ on the UTC date of the release.

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

Version 20221017
================
* Added SBJE/JJD, Comandante Ariston Pessoa Airport, Jijoca de Jericoacoara (Cruz), Ceará, Bazil. (Partially contributed
upstream by `Nicolas Bridoux <https://github.com/Bridouille>`__ in issue `#74
<https://github.com/mwgg/Airports/issues/74>`__).
* Added IATA identifier to YCWA/CJF, Coondewanna Airport, Western Australia, Australia and fixed elevation and
coordinates. (Partially contributed upstream by `Nicolas Bridoux <https://github.com/Bridouille>`__ in issue `#74
<https://github.com/mwgg/Airports/issues/74>`__).
* Fixed punctuation and accents of all Brazilian subdivisions (federative units).
* Support for Python 3.11
* Added Python static type testing using `mypy`


Version 20220921
================
* Updated ICAO identifiers, name and altitude of Kyrgyzstan airports present in their `AIP
Expand All @@ -25,7 +38,6 @@ Version 20220921
non-existend IATA identifier).



Version 20220917
================
* Added SLAL/SRE, Alcantarí International Airport, Sucre, Chuquisaca, Bolivia (partially contributed upstream by `687er
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,883
.. |ICAO| replace:: 28,884

.. |IATA| replace:: 6,577
.. |IATA| replace:: 6,579

.. |version| image:: https://img.shields.io/pypi/v/airportsdata.svg
:target: https://pypi.org/project/airportsdata/
Expand Down
23 changes: 9 additions & 14 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
* Updated ICAO identifiers, name and altitude of Kyrgyzstan airports present in their `AIP
<http://kan.kg/ais/eaip/2022-10-06-AIRAC/html/index_commands.html>`__ (UCFL, UCFM, UCFO, UCFP) and added IATA
identifier to UCFL/IKU. (Partially contributed upstream by `Vladimir Simakhin <https://github.com/vsimakhin>`__ in PR
`#69 <https://github.com/mwgg/Airports/pull/69>`__).
* Replaced UAJT Turkestan Airport, Turkistan, Ongtuestik-Qazaqstan, Kazakhstan (decommissioned) with UAIT/HSA
Turkistan International Airport, Turkistan, Ongtuestik-Qazaqstan, Kazakhstan (replacement aerodrome).
Source: `AIP <https://www.ans.kz/AIP/eAIP/2022-10-06-AIRAC/html/index-en-GB.html>`__
(note: here we use the AIP/IATA official name even though the new airport also carries the name of Hazret
Sultan International Airport). (Partially contributed upstream by `vort3 <https://github.com/vort3>`__ in PR `#71
<https://github.com/mwgg/Airports/pull/71>`__).
* Updated names and elevation of all Kazakhstani aerodromes present in their `AIP
<https://www.ans.kz/AIP/eAIP/2022-10-06-AIRAC/html/index-en-GB.html>`__, adding UASU and UASZ airports.
* Fixed the IATA identifier for UASS/PLX, Semey International Airport, Semey, East Kazakhstan, Kazakhstan (found DLX, a
non-existend IATA identifier).
* Added SBJE/JJD, Comandante Ariston Pessoa Airport, Jijoca de Jericoacoara (Cruz), Ceará, Bazil. (Partially contributed
upstream by `Nicolas Bridoux <https://github.com/Bridouille>`__ in issue `#74
<https://github.com/mwgg/Airports/issues/74>`__).
* Added IATA identifier to YCWA/CJF, Coondewanna Airport, Western Australia, Australia and fixed elevation and
coordinates. (Partially contributed upstream by `Nicolas Bridoux <https://github.com/Bridouille>`__ in issue `#74
<https://github.com/mwgg/Airports/issues/74>`__).
* Fixed punctuation and accents of all Brazilian subdivisions (federative units).
* Support for Python 3.11
* Added Python static type testing using `mypy`
29 changes: 15 additions & 14 deletions airportsdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
Extensive database of location and timezone data for nearly every airport and landing strip in the world.
"""
from __future__ import annotations

import csv
import sys
Expand All @@ -20,7 +21,7 @@

__project_name__ = __package__
# Release numbering follows the release date
__version__ = '20220921'
__version__ = '20221017'
__min_python_version__ = (3, 7)
__author__ = 'Mike Borsetti <mike@borsetti.com>'
__copyright__ = 'Copyright 2020- Mike Borsetti'
Expand All @@ -47,7 +48,7 @@
if 'Literal' in globals():
CodeType = Literal['ICAO', 'IATA']
else:
CodeType = True
CodeType = True # type: ignore[misc]


def load(code_type: CodeType = 'ICAO') -> Dict[str, 'Airports']: # Version 3.8 and greater this should be a Literal
Expand All @@ -56,17 +57,17 @@ def load(code_type: CodeType = 'ICAO') -> Dict[str, 'Airports']: # Version 3.8
:param code_type: optional argument defining the key in the dictionary: 'ICAO' (default if omitted) or 'IATA'
:type code_type: str
:return: a dict of dicts, each entry having the following keys:
'icao': ICAO 4-character code or FAA 3-character code
'iata': IATA 3-letter code or an empty string
'name': official name (latin script)
'city': city
'subd': subdivision (e.g. state, province, region, etc.)
'country': ISO 3166-1 alpha 2-code + 'XK' for Kosovo
'icao': ICAO 4-letter Location Indicator or 4-alphanumeric FAA/TC LID
'iata': IATA 3-letter Location Code or an empty string
'name': Official name (latin script)
'city': City
'subd': Subdivision (e.g. state, province, region, etc.)
'country': ISO 3166-1 alpha 2-code (plus 'XK' for Kosovo)
'elevation': MSL elevation (the highest point of the landing area) in feet
'lat': latitude (decimal)
'lon': longitude (decimal)
'tz': timezone expressed as a string representing its tz database name (IANA-compliant) or empty string
for country 'AQ' (Antarctica). Originally sourced from [TimeZoneDB] (https://timezonedb.com)
'lat': Latitude (decimal)
'lon': Longitude (decimal)
'tz': Timezone expressed as a tz database name (IANA-compliant) or empty string for country 'AQ' (Antarctica).
Originally sourced from [TimeZoneDB](https://timezonedb.com)
:rtype: dict
"""
# with open(os.path.join(dir, 'airports.json'), encoding='utf8') as f:
Expand All @@ -79,11 +80,11 @@ def load(code_type: CodeType = 'ICAO') -> Dict[str, 'Airports']: # Version 3.8
#
this_dir = Path(__file__).parent
key = 'icao' if code_type.lower() == 'icao' else 'iata'
airports = {}
airports: Dict[str, Airports] = {}
with this_dir.joinpath('airports.csv').open(encoding='utf8') as f:
reader = csv.DictReader(f, quoting=csv.QUOTE_NONNUMERIC)
for row in reader:
airports[row[key]] = row
airports[row[key]] = row # type: ignore[assignment]
airports.pop('', None)
return airports

Expand Down
Loading

0 comments on commit 587c9b5

Please sign in to comment.