FlightRadarAPI 1.3.18__tar.gz → 1.3.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ https://www.flightradar24.com/terms-and-conditions
13
13
  """
14
14
 
15
15
  __author__ = "Jean Loui Bernard Silva de Jesus"
16
- __version__ = "1.3.18"
16
+ __version__ = "1.3.19"
17
17
 
18
18
  from .api import FlightRadar24API, FlightTrackerConfig
19
19
  from .entities import Airport, Entity, Flight
@@ -88,6 +88,9 @@ class FlightRadar24API(object):
88
88
  :param code: ICAO or IATA of the airport
89
89
  :param details: If True, it returns an Airport instance with detailed information.
90
90
  """
91
+ if 4 < len(code) or len(code) < 3:
92
+ raise ValueError(f"The code '{code}' is invalid. It must be the IATA or ICAO of the airport.")
93
+
91
94
  if details:
92
95
  airport = Airport()
93
96
 
@@ -102,7 +105,7 @@ class FlightRadar24API(object):
102
105
  if not content or not isinstance(content, dict) or not content.get("details"):
103
106
  raise AirportNotFoundError(f"Could not find an airport by the code '{code}'.")
104
107
 
105
- return Airport(info=content["details"])
108
+ return Airport(info = content["details"])
106
109
 
107
110
  def get_airport_details(self, code: str, flight_limit: int = 100, page: int = 1) -> Dict:
108
111
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FlightRadarAPI
3
- Version: 1.3.18
3
+ Version: 1.3.19
4
4
  Summary: SDK for FlightRadar24
5
5
  Project-URL: Homepage, https://github.com/JeanExtreme002/FlightRadarAPI
6
6
  Author-email: Jean Loui Bernard Silva de Jesus <jeanextreme002@gmail.com>
File without changes