pyopensky 2.7__tar.gz → 2.8__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.
- {pyopensky-2.7 → pyopensky-2.8}/PKG-INFO +2 -2
- {pyopensky-2.7 → pyopensky-2.8}/pyproject.toml +6 -5
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/config.py +5 -31
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/rest.py +11 -11
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/trino.py +2 -2
- pyopensky-2.7/src/pyopensky/impala.py +0 -1469
- {pyopensky-2.7 → pyopensky-2.8}/license.txt +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/readme.md +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/__init__.py +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/api.py +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/py.typed +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/s3.py +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/schema.py +0 -0
- {pyopensky-2.7 → pyopensky-2.8}/src/pyopensky/time.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyopensky
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8
|
|
4
4
|
Summary: A Python interface for OpenSky database
|
|
5
5
|
Home-page: https://github.com/open-aviation/pyopensky/
|
|
6
6
|
License: MIT
|
|
@@ -14,9 +14,9 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Requires-Dist: appdirs (>=1.4.4)
|
|
17
|
+
Requires-Dist: httpx (>=0.27.0,<0.28.0)
|
|
17
18
|
Requires-Dist: minio (>=7.1)
|
|
18
19
|
Requires-Dist: pandas (>=1.5)
|
|
19
|
-
Requires-Dist: paramiko (>=2.7)
|
|
20
20
|
Requires-Dist: pyarrow (>=11.0.0)
|
|
21
21
|
Requires-Dist: pyjwt (>=2.7.0)
|
|
22
22
|
Requires-Dist: tqdm (>=4.65.0)
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyopensky"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.8"
|
|
4
4
|
description = "A Python interface for OpenSky database"
|
|
5
5
|
repository = "https://github.com/open-aviation/pyopensky/"
|
|
6
|
-
authors = [
|
|
6
|
+
authors = [
|
|
7
|
+
"Xavier Olive <git@xoolive.org>",
|
|
8
|
+
"Junzi Sun <j.sun-1@tudelft.nl>"
|
|
9
|
+
]
|
|
7
10
|
license = "MIT"
|
|
8
11
|
readme = "readme.md"
|
|
9
12
|
include = [
|
|
@@ -21,7 +24,7 @@ tqdm = ">=4.65.0"
|
|
|
21
24
|
pyarrow = ">=11.0.0"
|
|
22
25
|
typing-extensions = ">=4.5.0"
|
|
23
26
|
pyjwt = ">=2.7.0"
|
|
24
|
-
|
|
27
|
+
httpx = "^0.27.0"
|
|
25
28
|
|
|
26
29
|
[tool.poetry.group.dev.dependencies]
|
|
27
30
|
pre-commit = ">=3.1.1"
|
|
@@ -29,8 +32,6 @@ mypy = ">=1.0.1"
|
|
|
29
32
|
ruff = ">=0.0.253"
|
|
30
33
|
pytest = ">=7.2.1"
|
|
31
34
|
ipykernel = ">=6.21.2"
|
|
32
|
-
types-requests = ">=2.28.11.15"
|
|
33
|
-
types-paramiko = ">=3.3.0.0"
|
|
34
35
|
Sphinx = ">=5.1"
|
|
35
36
|
sphinx-design = ">=0.4.1"
|
|
36
37
|
sphinx-rtd-theme = ">=0.5.2"
|
|
@@ -18,11 +18,11 @@ DEFAULT_CONFIG = """
|
|
|
18
18
|
username =
|
|
19
19
|
password =
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
#
|
|
21
|
+
# Uncomment the following if you have access to the s3 server
|
|
22
|
+
# secret_key =
|
|
23
|
+
# access_key =
|
|
24
|
+
|
|
25
|
+
# If you need a different account on Trino, uncomment the following
|
|
26
26
|
# [trino]
|
|
27
27
|
# username =
|
|
28
28
|
# password =
|
|
@@ -112,12 +112,6 @@ NAME_RESOLUTION: dict[str, Resolution] = {
|
|
|
112
112
|
traffic_category="network",
|
|
113
113
|
traffic_name="http_proxy",
|
|
114
114
|
),
|
|
115
|
-
"ssh_proxycommand": dict(
|
|
116
|
-
opensky_category="impala",
|
|
117
|
-
opensky_name="ssh.proxycommand",
|
|
118
|
-
traffic_category="opensky",
|
|
119
|
-
traffic_name="ssh.proxycommand",
|
|
120
|
-
),
|
|
121
115
|
# Credentials configuration
|
|
122
116
|
"access_key": dict(
|
|
123
117
|
opensky_category="s3",
|
|
@@ -155,16 +149,6 @@ NAME_RESOLUTION: dict[str, Resolution] = {
|
|
|
155
149
|
opensky_category="trino",
|
|
156
150
|
opensky_name="password",
|
|
157
151
|
),
|
|
158
|
-
"impala_username": dict(
|
|
159
|
-
environment_variable="OPENSKY_IMPALA_USERNAME",
|
|
160
|
-
opensky_category="impala",
|
|
161
|
-
opensky_name="username",
|
|
162
|
-
),
|
|
163
|
-
"impala_password": dict(
|
|
164
|
-
environment_variable="OPENSKY_IMPALA_PASSWORD",
|
|
165
|
-
opensky_category="impala",
|
|
166
|
-
opensky_name="password",
|
|
167
|
-
),
|
|
168
152
|
}
|
|
169
153
|
|
|
170
154
|
__all__ = list(NAME_RESOLUTION.keys())
|
|
@@ -220,16 +204,6 @@ def __getattr__(name: str) -> None | str:
|
|
|
220
204
|
return value
|
|
221
205
|
return get_config(**NAME_RESOLUTION["password"])
|
|
222
206
|
|
|
223
|
-
if name == "impala_username":
|
|
224
|
-
if value := get_config(**NAME_RESOLUTION[name]):
|
|
225
|
-
return value
|
|
226
|
-
return get_config(**NAME_RESOLUTION["username"])
|
|
227
|
-
|
|
228
|
-
if name == "impala_password":
|
|
229
|
-
if value := get_config(**NAME_RESOLUTION[name]):
|
|
230
|
-
return value
|
|
231
|
-
return get_config(**NAME_RESOLUTION["password"])
|
|
232
|
-
|
|
233
207
|
if name in __all__:
|
|
234
208
|
return get_config(**NAME_RESOLUTION[name])
|
|
235
209
|
|
|
@@ -6,7 +6,7 @@ from datetime import timedelta
|
|
|
6
6
|
from json import JSONDecodeError
|
|
7
7
|
from typing import Any, cast
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import httpx
|
|
10
10
|
|
|
11
11
|
import pandas as pd
|
|
12
12
|
|
|
@@ -55,7 +55,7 @@ class REST:
|
|
|
55
55
|
self.password = password
|
|
56
56
|
self.auth = cast(tuple[str, str], (username, password))
|
|
57
57
|
|
|
58
|
-
self.
|
|
58
|
+
self.client = httpx.Client()
|
|
59
59
|
|
|
60
60
|
def states(
|
|
61
61
|
self,
|
|
@@ -120,7 +120,7 @@ class REST:
|
|
|
120
120
|
|
|
121
121
|
what += f"?lamin={south}&lamax={north}&lomin={west}&lomax={east}"
|
|
122
122
|
|
|
123
|
-
c = self.
|
|
123
|
+
c = self.client.get(
|
|
124
124
|
f"https://opensky-network.org/api/states/{what}", auth=self.auth
|
|
125
125
|
)
|
|
126
126
|
try:
|
|
@@ -185,7 +185,7 @@ class REST:
|
|
|
185
185
|
|
|
186
186
|
"""
|
|
187
187
|
time = int(to_datetime(time).timestamp()) if time is not None else 0
|
|
188
|
-
c = self.
|
|
188
|
+
c = self.client.get(
|
|
189
189
|
f"https://opensky-network.org/api/tracks/"
|
|
190
190
|
f"?icao24={icao24}&time={time}"
|
|
191
191
|
)
|
|
@@ -208,7 +208,7 @@ class REST:
|
|
|
208
208
|
|
|
209
209
|
def routes(self, callsign: str) -> tuple[str, str]:
|
|
210
210
|
"""Returns the route associated to a callsign."""
|
|
211
|
-
c = self.
|
|
211
|
+
c = self.client.get(
|
|
212
212
|
f"https://opensky-network.org/api/routes?callsign={callsign}"
|
|
213
213
|
)
|
|
214
214
|
c.raise_for_status()
|
|
@@ -243,7 +243,7 @@ class REST:
|
|
|
243
243
|
else:
|
|
244
244
|
end_ts = to_datetime(end)
|
|
245
245
|
|
|
246
|
-
c = self.
|
|
246
|
+
c = self.client.get(
|
|
247
247
|
f"https://opensky-network.org/api/flights/aircraft"
|
|
248
248
|
f"?icao24={icao24}&begin={begin_ts.timestamp():.0f}&"
|
|
249
249
|
f"end={end_ts.timestamp():.0f}"
|
|
@@ -276,7 +276,7 @@ class REST:
|
|
|
276
276
|
today = pd.Timestamp("now", tz="utc").floor("1d")
|
|
277
277
|
if day is not None:
|
|
278
278
|
today = to_datetime(day)
|
|
279
|
-
c = self.
|
|
279
|
+
c = self.client.get(
|
|
280
280
|
f"https://opensky-network.org/api/sensor/myStats"
|
|
281
281
|
f"?days={today.timestamp():.0f}",
|
|
282
282
|
auth=self.auth,
|
|
@@ -298,7 +298,7 @@ class REST:
|
|
|
298
298
|
day = pd.Timestamp("now", tz="utc").floor("1d")
|
|
299
299
|
day_ts = to_datetime(day)
|
|
300
300
|
|
|
301
|
-
c = self.
|
|
301
|
+
c = self.client.get(
|
|
302
302
|
f"https://opensky-network.org/api/range/days?"
|
|
303
303
|
f"days={day_ts.timestamp():.0f}&serials={serial}"
|
|
304
304
|
)
|
|
@@ -314,7 +314,7 @@ class REST:
|
|
|
314
314
|
day = pd.Timestamp("now", tz="utc").floor("1d")
|
|
315
315
|
day_ts = to_datetime(day)
|
|
316
316
|
|
|
317
|
-
c = self.
|
|
317
|
+
c = self.client.get(
|
|
318
318
|
f"https://opensky-network.org/api/range/coverage?"
|
|
319
319
|
f"day={day_ts.timestamp():.0f}"
|
|
320
320
|
)
|
|
@@ -353,7 +353,7 @@ class REST:
|
|
|
353
353
|
else:
|
|
354
354
|
end_ts = to_datetime(end)
|
|
355
355
|
|
|
356
|
-
c = self.
|
|
356
|
+
c = self.client.get(
|
|
357
357
|
f"https://opensky-network.org/api/flights/arrival"
|
|
358
358
|
f"?begin={begin_ts.timestamp():.0f}&airport={airport}&"
|
|
359
359
|
f"end={end_ts.timestamp():.0f}"
|
|
@@ -413,7 +413,7 @@ class REST:
|
|
|
413
413
|
else:
|
|
414
414
|
end_ts = to_datetime(end)
|
|
415
415
|
|
|
416
|
-
c = self.
|
|
416
|
+
c = self.client.get(
|
|
417
417
|
f"https://opensky-network.org/api/flights/departure"
|
|
418
418
|
f"?begin={begin_ts.timestamp():.0f}&airport={airport}&"
|
|
419
419
|
f"end={end_ts.timestamp():.0f}"
|
|
@@ -8,8 +8,8 @@ from multiprocessing.pool import ThreadPool
|
|
|
8
8
|
from operator import or_
|
|
9
9
|
from typing import Any, Iterable, Type, TypedDict, cast
|
|
10
10
|
|
|
11
|
+
import httpx
|
|
11
12
|
import jwt
|
|
12
|
-
import requests
|
|
13
13
|
from sqlalchemy import (
|
|
14
14
|
Connection,
|
|
15
15
|
CursorResult,
|
|
@@ -77,7 +77,7 @@ class Trino(OpenSkyDBAPI):
|
|
|
77
77
|
return self._token["access_token"]
|
|
78
78
|
|
|
79
79
|
_log.info("Requesting authentication token")
|
|
80
|
-
result =
|
|
80
|
+
result = httpx.post(
|
|
81
81
|
"https://auth.opensky-network.org/auth/realms/"
|
|
82
82
|
"opensky-network/protocol/openid-connect/token",
|
|
83
83
|
data={
|