FlightRadarAPI 1.3.12__tar.gz → 1.3.14__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.
Files changed (22) hide show
  1. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/.gitignore +2 -1
  2. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/__init__.py +2 -2
  3. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/api.py +15 -16
  4. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/entities/flight.py +2 -2
  5. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/PKG-INFO +5 -4
  6. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/README.md +3 -2
  7. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/pyproject.toml +4 -1
  8. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/tests/package.py +1 -1
  9. flightradarapi-1.3.12/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  10. flightradarapi-1.3.12/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
  11. flightradarapi-1.3.12/.github/ISSUE_TEMPLATE/questioning.md +0 -35
  12. flightradarapi-1.3.12/.github/workflows/python-package.yml +0 -38
  13. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/core.py +0 -0
  14. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/entities/__init__.py +0 -0
  15. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/entities/airport.py +0 -0
  16. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/entities/entity.py +0 -0
  17. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/errors.py +0 -0
  18. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/FlightRadar24/request.py +0 -0
  19. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/LICENSE +0 -0
  20. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/requirements.txt +0 -0
  21. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/tests/test_api.py +0 -0
  22. {flightradarapi-1.3.12 → flightradarapi-1.3.14}/tests/util.py +0 -0
@@ -3,4 +3,5 @@ dist
3
3
  *.pytest_cache
4
4
  *.egg-info
5
5
  .idea/
6
- venv/
6
+ venv/
7
+ node_modules/
@@ -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.12"
16
+ __version__ = "1.3.14"
17
17
 
18
18
  from .api import FlightRadar24API, FlightTrackerConfig
19
- from .entities import Airport, Flight
19
+ from .entities import Airport, Entity, Flight
@@ -61,6 +61,8 @@ class FlightRadar24API(object):
61
61
  """
62
62
  Download the logo of an airline from FlightRadar24 and return it as bytes.
63
63
  """
64
+ iata, icao = iata.upper(), icao.upper()
65
+
64
66
  first_logo_url = Core.airline_logo_url.format(iata, icao)
65
67
 
66
68
  # Try to get the image by the first URL option.
@@ -94,7 +96,7 @@ class FlightRadar24API(object):
94
96
 
95
97
  :param code: ICAO or IATA of the airport
96
98
  :param flight_limit: Limit of flights related to the airport
97
- :param page: page of result to display
99
+ :param page: Page of result to display
98
100
  """
99
101
  request_params = {"format": "json"}
100
102
 
@@ -209,16 +211,13 @@ class FlightRadar24API(object):
209
211
  if not str(status_code).startswith("4"):
210
212
  return response.get_content(), flag_url.split(".")[-1]
211
213
 
212
- def get_flight_details(self, flight: Union[Flight, str]) -> Dict[Any, Any]:
214
+ def get_flight_details(self, flight: Flight) -> Dict[Any, Any]:
213
215
  """
214
216
  Return the flight details from Data Live FlightRadar24.
215
217
 
216
- :param flight: A Flight instance or the Flight ID (no longer recommended)
218
+ :param flight: A Flight instance
217
219
  """
218
- # TODO: Only accept Flight instance at a next version.
219
- flight_id: str = flight if isinstance(flight, str) else flight.id
220
-
221
- response = APIRequest(Core.flight_data_url.format(flight_id), headers = Core.json_headers)
220
+ response = APIRequest(Core.flight_data_url.format(flight.id), headers = Core.json_headers)
222
221
  return response.get_content()
223
222
 
224
223
  def get_flights(
@@ -267,7 +266,7 @@ class FlightRadar24API(object):
267
266
 
268
267
  # Set flight details.
269
268
  if details:
270
- flight_details = self.get_flight_details(flight_id)
269
+ flight_details = self.get_flight_details(flight)
271
270
  flight.set_flight_details(flight_details)
272
271
 
273
272
  return flights
@@ -287,6 +286,13 @@ class FlightRadar24API(object):
287
286
 
288
287
  return self.__login_data["userData"].copy()
289
288
 
289
+ def get_most_tracked(self) -> Dict:
290
+ """
291
+ Return the most tracked data.
292
+ """
293
+ response = APIRequest(Core.most_tracked_url, headers = Core.json_headers)
294
+ return response.get_content()
295
+
290
296
  def get_zones(self) -> Dict[str, Dict]:
291
297
  """
292
298
  Return all major zones on the globe.
@@ -301,7 +307,7 @@ class FlightRadar24API(object):
301
307
 
302
308
  def search(self, query: str) -> Dict:
303
309
  """
304
- Return the search result
310
+ Return the search result.
305
311
  """
306
312
  response = APIRequest(Core.search_data_url.format(query), headers = Core.json_headers)
307
313
  results = response.get_content().get("results", [])
@@ -318,13 +324,6 @@ class FlightRadar24API(object):
318
324
  counted_total += count
319
325
  return data
320
326
 
321
- def get_most_tracked(self) -> Dict:
322
- """
323
- Return the most tracked data
324
- """
325
- response = APIRequest(Core.most_tracked_url, headers = Core.json_headers)
326
- return response.get_content()
327
-
328
327
  def is_logged_in(self) -> bool:
329
328
  """
330
329
  Check if the user is logged into the FlightRadar24 account.
@@ -81,7 +81,7 @@ class Flight(Entity):
81
81
 
82
82
  def get_altitude(self) -> str:
83
83
  """
84
- Return the formatted altitude, with the unit of measure
84
+ Return the formatted altitude, with the unit of measure.
85
85
  """
86
86
  return "{} ft".format(self.altitude)
87
87
 
@@ -89,7 +89,7 @@ class Flight(Entity):
89
89
  """
90
90
  Return the formatted flight level, with the unit of measure.
91
91
  """
92
- return str(self.altitude)[:3] + " FL" if self.altitude > 10000 else self.get_altitude()
92
+ return str(self.altitude)[:3] + " FL" if self.altitude >= 10000 else self.get_altitude()
93
93
 
94
94
  def get_ground_speed(self) -> str:
95
95
  """
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FlightRadarAPI
3
- Version: 1.3.12
4
- Summary: API for FlightRadar24
3
+ Version: 1.3.14
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>
7
7
  License-Expression: MIT
@@ -28,9 +28,10 @@ If you want to use the data collected using this SDK commercially, you need to s
28
28
  See more information at: https://www.flightradar24.com/terms-and-conditions
29
29
 
30
30
  [![Python Package](https://github.com/JeanExtreme002/FlightRadarAPI/workflows/Python%20Package/badge.svg)](https://github.com/JeanExtreme002/FlightRadarAPI/actions)
31
- [![Pypi](https://img.shields.io/pypi/v/FlightRadarAPI)](https://pypi.org/project/FlightRadarAPI/)
31
+ [![Pypi](https://img.shields.io/pypi/v/FlightRadarAPI?logo=pypi)](https://pypi.org/project/FlightRadarAPI/)
32
32
  [![License](https://img.shields.io/pypi/l/FlightRadarAPI)](https://pypi.org/project/FlightRadarAPI/)
33
- [![Python Version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)](https://pypi.org/project/FlightRadarAPI/)
33
+ [![Python Version](https://img.shields.io/badge/python-3.7+-8A2BE2)](https://pypi.org/project/FlightRadarAPI/)
34
+ [![Npm](https://img.shields.io/npm/v/flightradarapi?logo=npm&color=red)](https://www.npmjs.com/package/flightradarapi)
34
35
  [![Downloads](https://static.pepy.tech/personalized-badge/flightradarapi?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pypi.org/project/FlightRadarAPI/)
35
36
 
36
37
  ## Installing FlightRadarAPI:
@@ -5,9 +5,10 @@ If you want to use the data collected using this SDK commercially, you need to s
5
5
  See more information at: https://www.flightradar24.com/terms-and-conditions
6
6
 
7
7
  [![Python Package](https://github.com/JeanExtreme002/FlightRadarAPI/workflows/Python%20Package/badge.svg)](https://github.com/JeanExtreme002/FlightRadarAPI/actions)
8
- [![Pypi](https://img.shields.io/pypi/v/FlightRadarAPI)](https://pypi.org/project/FlightRadarAPI/)
8
+ [![Pypi](https://img.shields.io/pypi/v/FlightRadarAPI?logo=pypi)](https://pypi.org/project/FlightRadarAPI/)
9
9
  [![License](https://img.shields.io/pypi/l/FlightRadarAPI)](https://pypi.org/project/FlightRadarAPI/)
10
- [![Python Version](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)](https://pypi.org/project/FlightRadarAPI/)
10
+ [![Python Version](https://img.shields.io/badge/python-3.7+-8A2BE2)](https://pypi.org/project/FlightRadarAPI/)
11
+ [![Npm](https://img.shields.io/npm/v/flightradarapi?logo=npm&color=red)](https://www.npmjs.com/package/flightradarapi)
11
12
  [![Downloads](https://static.pepy.tech/personalized-badge/flightradarapi?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pypi.org/project/FlightRadarAPI/)
12
13
 
13
14
  ## Installing FlightRadarAPI:
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "FlightRadarAPI"
3
3
  dynamic = ["version"]
4
- description = "API for FlightRadar24"
4
+ description = "SDK for FlightRadar24"
5
5
  authors = [
6
6
  { name = "Jean Loui Bernard Silva de Jesus", email = "jeanextreme002@gmail.com" },
7
7
  ]
@@ -24,6 +24,9 @@ dependencies = [
24
24
  "requests",
25
25
  ]
26
26
 
27
+ [tool.hatch.build.targets.wheel]
28
+ packages = ["FlightRadar24"]
29
+
27
30
  [project.optional-dependencies]
28
31
  tests = [
29
32
  "pytest",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import os, sys
4
4
 
5
- current_dir = os.getcwd()
5
+ current_dir = os.path.join(os.getcwd(), "python")
6
6
  sys.path.append(current_dir)
7
7
 
8
8
  from FlightRadar24 import __version__ as version
@@ -1,32 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Describe the bug**
11
- A clear and concise description of what the bug is.
12
-
13
- **To Reproduce**
14
- Steps to reproduce the behavior:
15
- 1. Go to '...'
16
- 2. Set this input '....'
17
- 3. Run the '....'
18
- 4. Scroll down to '....'
19
- 5. See error
20
-
21
- **Expected behavior**
22
- A clear and concise description of what you expected to happen.
23
-
24
- **Screenshots**
25
- If applicable, add screenshots to help explain your problem.
26
-
27
- **System (please complete the following information):**
28
- - OS: [e.g. Windows]
29
- - Python Version [e.g. 1.10]
30
-
31
- **Additional context**
32
- Add any other context about the problem here.
@@ -1,19 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Is your feature request related to a problem? Please describe.**
11
- - A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
- - A clear and concise description of what you want to happen.
13
- - A clear and concise description of any alternative solutions or features you've considered.
14
-
15
- **Is not your feature request related to a problem? Please describe**
16
- A clear and concise description of how your feature can positively impact the project.
17
-
18
- **Additional context**
19
- Add any other context or screenshots about the feature request here.
@@ -1,35 +0,0 @@
1
- ---
2
- name: Questioning
3
- about: Ask a question about the project
4
- title: ''
5
- labels: question
6
- assignees: ''
7
-
8
- ---
9
-
10
- **Is your problem described in the documentation? If so, please describe**
11
- A clear and concise description of what is confusing in the documentation.
12
-
13
- **Describe your question**
14
- A clear and concise description of what the bug is.
15
-
16
- **Is your question reproducible? Please describe**
17
- Steps to reproduce the behavior:
18
-
19
- 1. Go to '...'
20
- 2. Set this input '....'
21
- 3. Run the '....'
22
- 4. Scroll down to '....'
23
- 5. See behavior
24
-
25
- **Screenshots**
26
- If applicable, add screenshots to help explain your problem.
27
-
28
- **System**
29
- If applicable, please complete the following information:
30
-
31
- 1. OS: [e.g. Windows]
32
- 2. Python Version [e.g. 1.10]
33
-
34
- **Additional context**
35
- Add any other context about the problem here.
@@ -1,38 +0,0 @@
1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
-
4
- name: Python Package
5
-
6
- on:
7
- push:
8
- branches: [ main ]
9
- pull_request:
10
- branches: [ main ]
11
- schedule:
12
- - cron: '0 0 */7 * *'
13
- workflow_dispatch:
14
-
15
- jobs:
16
- build:
17
-
18
- runs-on: ubuntu-latest
19
- strategy:
20
- matrix:
21
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
22
-
23
- steps:
24
- - uses: actions/checkout@v2
25
- - name: Set up Python ${{ matrix.python-version }}
26
- uses: actions/setup-python@v2
27
- with:
28
- python-version: ${{ matrix.python-version }}
29
- - name: Install dependencies
30
- run: |
31
- python -m pip install --upgrade pip
32
- pip install -r requirements.txt
33
- - name: Test with pytest
34
- run: |
35
- pytest tests -v -s
36
- - name: Install package
37
- run: |
38
- pip install FlightRadar24
File without changes