pyopensky 2.9__tar.gz → 2.11__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 (37) hide show
  1. {pyopensky-2.9 → pyopensky-2.11}/.github/workflows/build-docs.yml +4 -0
  2. {pyopensky-2.9 → pyopensky-2.11}/.github/workflows/run_tests.yml +1 -0
  3. {pyopensky-2.9 → pyopensky-2.11}/PKG-INFO +5 -3
  4. {pyopensky-2.9 → pyopensky-2.11}/docs/source/credentials.rst +4 -4
  5. {pyopensky-2.9 → pyopensky-2.11}/docs/source/installation.rst +4 -4
  6. {pyopensky-2.9 → pyopensky-2.11}/pyproject.toml +13 -11
  7. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/trino.py +16 -5
  8. pyopensky-2.11/uv.lock +3231 -0
  9. pyopensky-2.9/uv.lock +0 -3207
  10. {pyopensky-2.9 → pyopensky-2.11}/.github/dependabot.yml +0 -0
  11. {pyopensky-2.9 → pyopensky-2.11}/.github/renovate.json5 +0 -0
  12. {pyopensky-2.9 → pyopensky-2.11}/.github/workflows/pypi_publish.yml +0 -0
  13. {pyopensky-2.9 → pyopensky-2.11}/.gitignore +0 -0
  14. {pyopensky-2.9 → pyopensky-2.11}/docs/.gitignore +0 -0
  15. {pyopensky-2.9 → pyopensky-2.11}/docs/Makefile +0 -0
  16. {pyopensky-2.9 → pyopensky-2.11}/docs/make.bat +0 -0
  17. {pyopensky-2.9 → pyopensky-2.11}/docs/source/_static/main_stylesheet.css +0 -0
  18. {pyopensky-2.9 → pyopensky-2.11}/docs/source/api_reference.rst +0 -0
  19. {pyopensky-2.9 → pyopensky-2.11}/docs/source/conf.py +0 -0
  20. {pyopensky-2.9 → pyopensky-2.11}/docs/source/index.rst +0 -0
  21. {pyopensky-2.9 → pyopensky-2.11}/docs/source/rest.rst +0 -0
  22. {pyopensky-2.9 → pyopensky-2.11}/docs/source/trino.rst +0 -0
  23. {pyopensky-2.9 → pyopensky-2.11}/license.txt +0 -0
  24. {pyopensky-2.9 → pyopensky-2.11}/readme.md +0 -0
  25. {pyopensky-2.9 → pyopensky-2.11}/scripts/decode_pymodes.py +0 -0
  26. {pyopensky-2.9 → pyopensky-2.11}/scripts/decode_rs1090.py +0 -0
  27. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/__init__.py +0 -0
  28. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/api.py +0 -0
  29. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/config.py +0 -0
  30. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/py.typed +0 -0
  31. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/rest.py +0 -0
  32. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/s3.py +0 -0
  33. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/schema.py +0 -0
  34. {pyopensky-2.9 → pyopensky-2.11}/src/pyopensky/time.py +0 -0
  35. {pyopensky-2.9 → pyopensky-2.11}/tests/test_rest.py +0 -0
  36. {pyopensky-2.9 → pyopensky-2.11}/tests/test_s3.py +0 -0
  37. {pyopensky-2.9 → pyopensky-2.11}/tests/test_trino.py +0 -0
@@ -11,6 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
 
13
13
  env:
14
+ PYTHON_VERSION: "3.12"
14
15
  UV_CACHE_DIR: /tmp/.uv-cache
15
16
 
16
17
  steps:
@@ -23,6 +24,9 @@ jobs:
23
24
 
24
25
  - name: Set up Python
25
26
  uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ env.PYTHON_VERSION }}
29
+
26
30
 
27
31
  - name: Cache folder for uv
28
32
  uses: actions/cache@v4
@@ -22,6 +22,7 @@ jobs:
22
22
  - "3.10"
23
23
  - "3.11"
24
24
  - "3.12"
25
+ - "3.13"
25
26
 
26
27
  fail-fast: false
27
28
 
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyopensky
3
- Version: 2.9
3
+ Version: 2.11
4
4
  Summary: A Python interface for OpenSky database
5
+ Project-URL: Repository, https://github.com/open-aviation/pyopensky/
5
6
  Author-email: Xavier Olive <git@xoolive.org>, Junzi Sun <j.sun-1@tudelft.nl>
6
7
  License-Expression: MIT
7
8
  Requires-Python: >=3.9
@@ -14,11 +15,12 @@ Requires-Dist: pyjwt>=2.9.0
14
15
  Requires-Dist: tqdm>=4.66.5
15
16
  Requires-Dist: trino[sqlalchemy]>=0.329.0
16
17
  Requires-Dist: typing-extensions>=4.12.2
18
+ Requires-Dist: tzdata>=2024.2
17
19
  Provides-Extra: cartes
18
- Requires-Dist: cartes>=0.8.0; extra == 'cartes'
20
+ Requires-Dist: cartes>=0.8.1; extra == 'cartes'
19
21
  Provides-Extra: decoding
20
22
  Requires-Dist: pymodes>=2.18; extra == 'decoding'
21
- Requires-Dist: rs1090>=0.3.0; extra == 'decoding'
23
+ Requires-Dist: rs1090>=0.3.8; extra == 'decoding'
22
24
  Description-Content-Type: text/markdown
23
25
 
24
26
  # pyopensky
@@ -4,10 +4,10 @@ Credentials
4
4
  Apply for access
5
5
  ----------------
6
6
 
7
- Access to the Trino database will be granted provided you meet the conditions
8
- defined by The OpenSky Network. Please create an account on
9
- https://trino.opensky-network.org, and then send an email to
10
- contact@opensky-network.org with your Trino username to request for activation.
7
+ Access to the Trino database will be granted provided you meet the `conditions
8
+ defined by The OpenSky Network <https://opensky-network.org/about/faq#q5>`_. Please create an account on
9
+ https://trino.opensky-network.org, and then apply at https://opensky-network.org/data/apply
10
+ with your Trino username to request for activation.
11
11
 
12
12
  Configuration
13
13
  -------------
@@ -13,13 +13,13 @@ The library is also available on conda-forge:
13
13
 
14
14
  conda install -c conda-forge pyopensky
15
15
 
16
- Development mode (with poetry):
16
+ Development mode (with uv):
17
17
 
18
18
  .. code::
19
19
 
20
- git clone https://github.com/open-aviation/pyopensky
21
- cd pyopensky
22
- poetry install
20
+ curl -LsSf https://astral.sh/uv/install.sh | sh # Linux and MacOS
21
+ irm https://astral.sh/uv/install.ps1 | iex # Windows
22
+ uv sync --dev
23
23
 
24
24
  .. hint::
25
25
 
@@ -1,15 +1,13 @@
1
1
  [project]
2
2
  name = "pyopensky"
3
- version = "2.9"
3
+ version = "2.11"
4
4
  description = "A Python interface for OpenSky database"
5
- repository = "https://github.com/open-aviation/pyopensky/"
6
5
  authors = [
7
6
  { name = "Xavier Olive", email = "git@xoolive.org" },
8
7
  { name = "Junzi Sun", email = "j.sun-1@tudelft.nl" },
9
8
  ]
10
9
  license = "MIT"
11
10
  readme = "readme.md"
12
- include = ["license.txt", "py.typed"]
13
11
  requires-python = ">=3.9"
14
12
  dependencies = [
15
13
  "appdirs >= 1.4.4",
@@ -21,11 +19,15 @@ dependencies = [
21
19
  "tqdm >= 4.66.5",
22
20
  "trino[sqlalchemy] >= 0.329.0",
23
21
  "typing-extensions >= 4.12.2",
22
+ "tzdata>=2024.2",
24
23
  ]
25
24
 
25
+ [project.urls]
26
+ Repository = "https://github.com/open-aviation/pyopensky/"
27
+
26
28
  [project.optional-dependencies]
27
- cartes = ["cartes>=0.8.0"]
28
- decoding = ["pymodes>=2.18", "rs1090>=0.3.0"]
29
+ cartes = ["cartes>=0.8.1"]
30
+ decoding = ["pymodes>=2.18", "rs1090>=0.3.8"]
29
31
 
30
32
  [build-system]
31
33
  requires = ["hatchling"]
@@ -38,10 +40,10 @@ dev-dependencies = [
38
40
  "ruff >= 0.6.3",
39
41
  "pytest >= 8.3.2",
40
42
  "ipykernel >= 6.29.5",
41
- "sphinx >= 7.4.7",
42
- "sphinx-design >= 0.6.1",
43
- "sphinx-rtd-theme >= 2.0.0",
44
- "sphinx-autodoc-typehints >= 2.3.0",
43
+ "sphinx >= 7.4.7; python_version>'3.11'",
44
+ "sphinx-design >= 0.6.1; python_version>'3.11'",
45
+ "sphinx-rtd-theme >= 2.0.0; python_version>'3.11'",
46
+ "sphinx-autodoc-typehints >= 2.3.0; python_version>'3.11'",
45
47
  ]
46
48
 
47
49
  [tool.ruff]
@@ -56,13 +58,13 @@ lint.select = [
56
58
  "RUF",
57
59
  ]
58
60
  line-length = 80
59
- target-version = "py38"
61
+ target-version = "py39"
60
62
 
61
63
  [tool.ruff.lint.isort]
62
64
  known-first-party = ["numpy", "pandas"]
63
65
 
64
66
  [tool.mypy]
65
- python_version = 3.8
67
+ python_version = "3.9"
66
68
  platform = "posix"
67
69
  color_output = true
68
70
  pretty = true
@@ -166,7 +166,15 @@ class Trino(OpenSkyDBAPI):
166
166
  if (cache_file := (cache_path / digest).with_suffix(suffix)).exists():
167
167
  if cached:
168
168
  _log.info(f"Reading results from {cache_file}")
169
- return pd.read_parquet(cache_file)
169
+ df = pd.read_parquet(cache_file)
170
+ df = df.convert_dtypes(dtype_backend="pyarrow")
171
+
172
+ for column in df.select_dtypes(include=["datetime"]):
173
+ if df[column].dtype.pyarrow_dtype.tz is None:
174
+ df = df.assign(
175
+ **{column: df[column].dt.tz_localize("UTC")}
176
+ )
177
+ return df
170
178
  else:
171
179
  cache_file.unlink(missing_ok=True)
172
180
 
@@ -194,6 +202,11 @@ class Trino(OpenSkyDBAPI):
194
202
 
195
203
  df = pd.concat(self.process_result(res))
196
204
 
205
+ df = df.convert_dtypes(dtype_backend="pyarrow")
206
+ for column in df.select_dtypes(include=["datetime"]):
207
+ if df[column].dtype.pyarrow_dtype.tz is None:
208
+ df = df.assign(**{column: df[column].dt.tz_localize("UTC")})
209
+
197
210
  if cached:
198
211
  _log.info(f"Saving results to {cache_file}")
199
212
  df.to_parquet(cache_file)
@@ -231,16 +244,14 @@ class Trino(OpenSkyDBAPI):
231
244
  ) as download_bar:
232
245
  sequence_rows = async_result.get()
233
246
  download_bar.update(len(sequence_rows))
234
- yield pd.DataFrame.from_records(
235
- sequence_rows, columns=res.keys()
236
- ).convert_dtypes(dtype_backend="pyarrow")
247
+ yield pd.DataFrame.from_records(sequence_rows, columns=res.keys())
237
248
 
238
249
  while len(sequence_rows) == batch_size:
239
250
  sequence_rows = res.fetchmany(batch_size)
240
251
  download_bar.update(len(sequence_rows))
241
252
  yield pd.DataFrame.from_records(
242
253
  sequence_rows, columns=res.keys()
243
- ).convert_dtypes(dtype_backend="pyarrow")
254
+ )
244
255
 
245
256
  ## Specific queries
246
257