pyopensky 2.8__tar.gz → 2.9__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.9/.github/dependabot.yml +11 -0
- pyopensky-2.9/.github/renovate.json5 +6 -0
- pyopensky-2.9/.github/workflows/build-docs.yml +52 -0
- pyopensky-2.9/.github/workflows/pypi_publish.yml +39 -0
- pyopensky-2.9/.github/workflows/run_tests.yml +81 -0
- pyopensky-2.9/.gitignore +34 -0
- {pyopensky-2.8 → pyopensky-2.9}/PKG-INFO +23 -28
- pyopensky-2.9/docs/.gitignore +1 -0
- pyopensky-2.9/docs/Makefile +20 -0
- pyopensky-2.9/docs/make.bat +35 -0
- pyopensky-2.9/docs/source/_static/main_stylesheet.css +17 -0
- pyopensky-2.9/docs/source/api_reference.rst +8 -0
- pyopensky-2.9/docs/source/conf.py +47 -0
- pyopensky-2.9/docs/source/credentials.rst +65 -0
- pyopensky-2.9/docs/source/index.rst +30 -0
- pyopensky-2.9/docs/source/installation.rst +27 -0
- pyopensky-2.9/docs/source/rest.rst +8 -0
- pyopensky-2.9/docs/source/trino.rst +8 -0
- pyopensky-2.9/pyproject.toml +76 -0
- {pyopensky-2.8 → pyopensky-2.9}/readme.md +4 -4
- pyopensky-2.9/scripts/decode_pymodes.py +89 -0
- pyopensky-2.9/scripts/decode_rs1090.py +31 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/rest.py +122 -68
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/trino.py +46 -5
- pyopensky-2.9/tests/test_rest.py +8 -0
- pyopensky-2.9/tests/test_s3.py +28 -0
- pyopensky-2.9/tests/test_trino.py +326 -0
- pyopensky-2.9/uv.lock +3207 -0
- pyopensky-2.8/pyproject.toml +0 -78
- {pyopensky-2.8 → pyopensky-2.9}/license.txt +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/__init__.py +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/api.py +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/config.py +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/py.typed +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/s3.py +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/schema.py +0 -0
- {pyopensky-2.8 → pyopensky-2.9}/src/pyopensky/time.py +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
documentation:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
UV_CACHE_DIR: /tmp/.uv-cache
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Set up uv
|
|
22
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
|
|
27
|
+
- name: Cache folder for uv
|
|
28
|
+
uses: actions/cache@v4
|
|
29
|
+
with:
|
|
30
|
+
path: /tmp/.uv-cache
|
|
31
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
32
|
+
restore-keys: |
|
|
33
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
34
|
+
uv-${{ runner.os }}
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: |
|
|
38
|
+
uv sync --all-extras --dev
|
|
39
|
+
|
|
40
|
+
- name: Build pages
|
|
41
|
+
working-directory: docs
|
|
42
|
+
run: |
|
|
43
|
+
uv run make html
|
|
44
|
+
|
|
45
|
+
- name: Minimize uv cache
|
|
46
|
+
run: uv cache prune --ci
|
|
47
|
+
|
|
48
|
+
- name: Deploy pages
|
|
49
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
50
|
+
with:
|
|
51
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
52
|
+
publish_dir: docs/build/html
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Set up uv
|
|
15
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
|
|
20
|
+
- name: Cache folder for uv
|
|
21
|
+
uses: actions/cache@v4
|
|
22
|
+
with:
|
|
23
|
+
path: /tmp/.uv-cache
|
|
24
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
25
|
+
restore-keys: |
|
|
26
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
27
|
+
uv-${{ runner.os }}
|
|
28
|
+
|
|
29
|
+
- name: Build packages
|
|
30
|
+
run: uvx hatch build
|
|
31
|
+
|
|
32
|
+
- name: Minimize uv cache
|
|
33
|
+
run: uv cache prune --ci
|
|
34
|
+
|
|
35
|
+
- name: Publish a Python distribution to PyPI
|
|
36
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
37
|
+
with:
|
|
38
|
+
user: __token__
|
|
39
|
+
password: ${{ secrets.PYPI_PASSWORD }}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request_target:
|
|
6
|
+
schedule: # This is useful for keeping the cache fit and ready
|
|
7
|
+
- cron: "42 3 * * 0" # Every Sunday morning when I am fast asleep :)
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
deploy:
|
|
12
|
+
name: python-${{ matrix.python-version }} on ${{ matrix.os }}
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
os:
|
|
17
|
+
- ubuntu-latest
|
|
18
|
+
- windows-latest
|
|
19
|
+
- macos-latest
|
|
20
|
+
python-version:
|
|
21
|
+
- "3.9"
|
|
22
|
+
- "3.10"
|
|
23
|
+
- "3.11"
|
|
24
|
+
- "3.12"
|
|
25
|
+
|
|
26
|
+
fail-fast: false
|
|
27
|
+
|
|
28
|
+
runs-on: ${{ matrix.os }}
|
|
29
|
+
|
|
30
|
+
env:
|
|
31
|
+
UV_CACHE_DIR: /tmp/.uv-cache
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
fetch-depth: 0
|
|
37
|
+
|
|
38
|
+
- name: Set up uv
|
|
39
|
+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
|
|
40
|
+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
41
|
+
|
|
42
|
+
- name: Set up uv
|
|
43
|
+
if: ${{ matrix.os == 'windows-latest' }}
|
|
44
|
+
run: irm https://astral.sh/uv/install.ps1 | iex
|
|
45
|
+
shell: powershell
|
|
46
|
+
|
|
47
|
+
- name: Cache folder for uv
|
|
48
|
+
uses: actions/cache@v4
|
|
49
|
+
with:
|
|
50
|
+
path: /tmp/.uv-cache
|
|
51
|
+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
52
|
+
restore-keys: |
|
|
53
|
+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
54
|
+
uv-${{ runner.os }}
|
|
55
|
+
|
|
56
|
+
- name: Cache folder for data
|
|
57
|
+
uses: actions/cache@v4
|
|
58
|
+
id: cache-folder
|
|
59
|
+
with:
|
|
60
|
+
path: |
|
|
61
|
+
${{ github.workspace }}/cache_opensky
|
|
62
|
+
key: opensky-${{ runner.os }}-${{ hashFiles('uv.lock') }}
|
|
63
|
+
|
|
64
|
+
- name: Install the project
|
|
65
|
+
run: uv sync --all-extras --dev --python ${{ matrix.python-version }}
|
|
66
|
+
|
|
67
|
+
- name: Linting and formatting
|
|
68
|
+
run: |
|
|
69
|
+
uv run ruff check
|
|
70
|
+
uv run ruff format --check
|
|
71
|
+
|
|
72
|
+
- name: Run tests
|
|
73
|
+
if: ${{ matrix.python-version == '3.12' || steps.cache-folder.outputs.cache-hit == 'true' }}
|
|
74
|
+
env:
|
|
75
|
+
OPENSKY_USERNAME: ${{ secrets.OPENSKY_USERNAME }}
|
|
76
|
+
OPENSKY_PASSWORD: ${{ secrets.OPENSKY_PASSWORD }}
|
|
77
|
+
OPENSKY_CACHE: ${{ github.workspace }}/cache_opensky
|
|
78
|
+
run: uv run pytest
|
|
79
|
+
|
|
80
|
+
- name: Minimize uv cache
|
|
81
|
+
run: uv cache prune --ci
|
pyopensky-2.9/.gitignore
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.vscode/
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
env/
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pyopensky
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.9
|
|
4
4
|
Summary: A Python interface for OpenSky database
|
|
5
|
-
|
|
6
|
-
License: MIT
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Requires-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Requires-Dist:
|
|
17
|
-
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist: tqdm (>=4.65.0)
|
|
23
|
-
Requires-Dist: trino[sqlalchemy] (>=0.322)
|
|
24
|
-
Requires-Dist: typing-extensions (>=4.5.0)
|
|
25
|
-
Project-URL: Repository, https://github.com/open-aviation/pyopensky/
|
|
5
|
+
Author-email: Xavier Olive <git@xoolive.org>, Junzi Sun <j.sun-1@tudelft.nl>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Requires-Dist: appdirs>=1.4.4
|
|
9
|
+
Requires-Dist: httpx>=0.27.2
|
|
10
|
+
Requires-Dist: minio>=7.2.8
|
|
11
|
+
Requires-Dist: pandas>=2.2.2
|
|
12
|
+
Requires-Dist: pyarrow>=17.0.0
|
|
13
|
+
Requires-Dist: pyjwt>=2.9.0
|
|
14
|
+
Requires-Dist: tqdm>=4.66.5
|
|
15
|
+
Requires-Dist: trino[sqlalchemy]>=0.329.0
|
|
16
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
17
|
+
Provides-Extra: cartes
|
|
18
|
+
Requires-Dist: cartes>=0.8.0; extra == 'cartes'
|
|
19
|
+
Provides-Extra: decoding
|
|
20
|
+
Requires-Dist: pymodes>=2.18; extra == 'decoding'
|
|
21
|
+
Requires-Dist: rs1090>=0.3.0; extra == 'decoding'
|
|
26
22
|
Description-Content-Type: text/markdown
|
|
27
23
|
|
|
28
24
|
# pyopensky
|
|
@@ -43,12 +39,12 @@ The library is also available on conda-forge:
|
|
|
43
39
|
conda install -c conda-forge pyopensky
|
|
44
40
|
```
|
|
45
41
|
|
|
46
|
-
Development mode (with
|
|
42
|
+
Development mode (with uv):
|
|
47
43
|
|
|
48
44
|
```sh
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux and MacOS
|
|
46
|
+
irm https://astral.sh/uv/install.ps1 | iex # Windows
|
|
47
|
+
uv sync --dev
|
|
52
48
|
```
|
|
53
49
|
|
|
54
50
|
## Credentials
|
|
@@ -86,4 +82,3 @@ See details in the [documentation](https://open-aviation.github.io/pyopensky/cre
|
|
|
86
82
|
trino.history(start, stop, *, callsign, icao24, bounds)
|
|
87
83
|
trino.rawdata(start, stop, *, callsign, icao24, bounds)
|
|
88
84
|
```
|
|
89
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
build/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
a.reference code.literal span {
|
|
2
|
+
font-family: Lato, proxima-nova, Helvetica Neue, Arial, sans-serif;
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
font-weight: 500;
|
|
5
|
+
color: #2980b9;
|
|
6
|
+
}
|
|
7
|
+
.rst-content .document a {
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
text-underline-offset: 2pt;
|
|
10
|
+
}
|
|
11
|
+
.rst-content .document a code {
|
|
12
|
+
padding: 0
|
|
13
|
+
}
|
|
14
|
+
.rst-content code {
|
|
15
|
+
border: none;
|
|
16
|
+
background: none;
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
# Configuration file for the Sphinx documentation builder.
|
|
4
|
+
#
|
|
5
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
6
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
7
|
+
import pyopensky
|
|
8
|
+
|
|
9
|
+
# -- Project information -----------------------------------------------------
|
|
10
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
11
|
+
|
|
12
|
+
project = "pyopensky"
|
|
13
|
+
copyright = "2023, Xavier Olive, Junzi Sun"
|
|
14
|
+
author = "Xavier Olive, Junzi Sun"
|
|
15
|
+
release = pyopensky.__version__
|
|
16
|
+
|
|
17
|
+
# -- General configuration ---------------------------------------------------
|
|
18
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
19
|
+
|
|
20
|
+
extensions = [
|
|
21
|
+
"sphinx.ext.autodoc",
|
|
22
|
+
"sphinx.ext.autosectionlabel",
|
|
23
|
+
"sphinx.ext.githubpages",
|
|
24
|
+
"sphinx.ext.intersphinx",
|
|
25
|
+
"sphinx_autodoc_typehints",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
templates_path = ["_templates"]
|
|
29
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# -- Options for HTML output -------------------------------------------------
|
|
33
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
34
|
+
|
|
35
|
+
html_theme = "sphinx_rtd_theme"
|
|
36
|
+
html_static_path = ["_static"]
|
|
37
|
+
|
|
38
|
+
intersphinx_mapping = {
|
|
39
|
+
"python": ("https://docs.python.org/3", None),
|
|
40
|
+
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
|
|
41
|
+
"traffic": ("https://traffic-viz.github.io", None),
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def setup(app: Any) -> None:
|
|
46
|
+
# Specific stylesheet
|
|
47
|
+
app.add_css_file("main_stylesheet.css")
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Credentials
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Apply for access
|
|
5
|
+
----------------
|
|
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.
|
|
11
|
+
|
|
12
|
+
Configuration
|
|
13
|
+
-------------
|
|
14
|
+
|
|
15
|
+
The first time you use the library, a configuration file named ``settings.conf``
|
|
16
|
+
is created, including the following content:
|
|
17
|
+
|
|
18
|
+
.. code::
|
|
19
|
+
|
|
20
|
+
[default]
|
|
21
|
+
username =
|
|
22
|
+
password =
|
|
23
|
+
|
|
24
|
+
If you use the same login for the OpenSky website (therefore the REST API) and
|
|
25
|
+
for Trino (it will be unified one day), just fill it here.
|
|
26
|
+
|
|
27
|
+
You will identify the folder where the ``settings.conf`` file is located:
|
|
28
|
+
|
|
29
|
+
.. code:: python
|
|
30
|
+
|
|
31
|
+
from pyopensky.config import opensky_config_dir
|
|
32
|
+
|
|
33
|
+
print(opensky_config_dir)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
Different credentials per service
|
|
37
|
+
---------------------------------
|
|
38
|
+
|
|
39
|
+
If you want to specify different credentials for the REST API and for the Trino
|
|
40
|
+
database, use the following sections in the configuration file.
|
|
41
|
+
|
|
42
|
+
.. code::
|
|
43
|
+
|
|
44
|
+
[opensky] # REST API
|
|
45
|
+
username =
|
|
46
|
+
password =
|
|
47
|
+
|
|
48
|
+
[trino] # Trino database
|
|
49
|
+
username =
|
|
50
|
+
password =
|
|
51
|
+
|
|
52
|
+
If these sections are commented, the library will use the credentials from the
|
|
53
|
+
[default] section.
|
|
54
|
+
|
|
55
|
+
Fallback configuration
|
|
56
|
+
----------------------
|
|
57
|
+
|
|
58
|
+
If no username and password are specified in the `pyopensky` configuration file, the
|
|
59
|
+
following steps are performed in order:
|
|
60
|
+
|
|
61
|
+
- try to get the credentials from the `traffic <https://traffic-viz.github.io>`_
|
|
62
|
+
configuration file;
|
|
63
|
+
- get the credentials from ``$OPENSKY_USERNAME`` and ``$OPENSKY_PASSWORD``
|
|
64
|
+
environment variables;
|
|
65
|
+
- open a browser and log in on a dedicated webpage.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
pyopensky
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
.. toctree::
|
|
5
|
+
:maxdepth: 2
|
|
6
|
+
:caption: Contents:
|
|
7
|
+
|
|
8
|
+
Source code on `github <https://github.com/open-aviation/pyopensky>`_
|
|
9
|
+
|
|
10
|
+
The pyopensky library provides function to easily download data from
|
|
11
|
+
`The OpenSky Network <https://opensky-network.org/>`_ databases. This minimal
|
|
12
|
+
library is ideal for quickly downloading and locally saving data that you will
|
|
13
|
+
use in your future studies. All functions return pandas :class:`~pandas.DataFrame`.
|
|
14
|
+
|
|
15
|
+
.. hint::
|
|
16
|
+
|
|
17
|
+
If Python is your language of choice in general, and you are interested in
|
|
18
|
+
analysing aircraft trajectories, please refer to the following `section in
|
|
19
|
+
the traffic <https://traffic-viz.github.io/data_sources/opensky_db.html>`_
|
|
20
|
+
library. traffic wraps the same pyopensky queries and returns
|
|
21
|
+
:class:`~traffic.core.Traffic` and :class:`~traffic.core.Flight` objects.
|
|
22
|
+
|
|
23
|
+
.. toctree::
|
|
24
|
+
:maxdepth: 2
|
|
25
|
+
:caption: Contents
|
|
26
|
+
|
|
27
|
+
installation
|
|
28
|
+
credentials
|
|
29
|
+
api_reference
|
|
30
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Installation
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
pyopensky is available through pip:
|
|
5
|
+
|
|
6
|
+
.. code::
|
|
7
|
+
|
|
8
|
+
pip install pyopensky
|
|
9
|
+
|
|
10
|
+
The library is also available on conda-forge:
|
|
11
|
+
|
|
12
|
+
.. code::
|
|
13
|
+
|
|
14
|
+
conda install -c conda-forge pyopensky
|
|
15
|
+
|
|
16
|
+
Development mode (with poetry):
|
|
17
|
+
|
|
18
|
+
.. code::
|
|
19
|
+
|
|
20
|
+
git clone https://github.com/open-aviation/pyopensky
|
|
21
|
+
cd pyopensky
|
|
22
|
+
poetry install
|
|
23
|
+
|
|
24
|
+
.. hint::
|
|
25
|
+
|
|
26
|
+
pyopensky is automatically installed as a dependency of the `traffic
|
|
27
|
+
<https://traffic-viz.github.io>`_ library.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyopensky"
|
|
3
|
+
version = "2.9"
|
|
4
|
+
description = "A Python interface for OpenSky database"
|
|
5
|
+
repository = "https://github.com/open-aviation/pyopensky/"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Xavier Olive", email = "git@xoolive.org" },
|
|
8
|
+
{ name = "Junzi Sun", email = "j.sun-1@tudelft.nl" },
|
|
9
|
+
]
|
|
10
|
+
license = "MIT"
|
|
11
|
+
readme = "readme.md"
|
|
12
|
+
include = ["license.txt", "py.typed"]
|
|
13
|
+
requires-python = ">=3.9"
|
|
14
|
+
dependencies = [
|
|
15
|
+
"appdirs >= 1.4.4",
|
|
16
|
+
"httpx >= 0.27.2",
|
|
17
|
+
"minio >= 7.2.8",
|
|
18
|
+
"pandas >= 2.2.2",
|
|
19
|
+
"pyarrow >= 17.0.0",
|
|
20
|
+
"pyjwt >= 2.9.0",
|
|
21
|
+
"tqdm >= 4.66.5",
|
|
22
|
+
"trino[sqlalchemy] >= 0.329.0",
|
|
23
|
+
"typing-extensions >= 4.12.2",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.optional-dependencies]
|
|
27
|
+
cartes = ["cartes>=0.8.0"]
|
|
28
|
+
decoding = ["pymodes>=2.18", "rs1090>=0.3.0"]
|
|
29
|
+
|
|
30
|
+
[build-system]
|
|
31
|
+
requires = ["hatchling"]
|
|
32
|
+
build-backend = "hatchling.build"
|
|
33
|
+
|
|
34
|
+
[tool.uv]
|
|
35
|
+
dev-dependencies = [
|
|
36
|
+
"pre-commit >= 3.8.0",
|
|
37
|
+
"mypy >= 1.11.2",
|
|
38
|
+
"ruff >= 0.6.3",
|
|
39
|
+
"pytest >= 8.3.2",
|
|
40
|
+
"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",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
lint.select = [
|
|
49
|
+
"E",
|
|
50
|
+
"W", # pycodestyle
|
|
51
|
+
"F", # pyflakes
|
|
52
|
+
"I", # isort
|
|
53
|
+
"NPY", # numpy
|
|
54
|
+
# "PD", # pandas
|
|
55
|
+
"DTZ", # flake8-datetimez
|
|
56
|
+
"RUF",
|
|
57
|
+
]
|
|
58
|
+
line-length = 80
|
|
59
|
+
target-version = "py38"
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint.isort]
|
|
62
|
+
known-first-party = ["numpy", "pandas"]
|
|
63
|
+
|
|
64
|
+
[tool.mypy]
|
|
65
|
+
python_version = 3.8
|
|
66
|
+
platform = "posix"
|
|
67
|
+
color_output = true
|
|
68
|
+
pretty = true
|
|
69
|
+
show_column_numbers = true
|
|
70
|
+
strict = true
|
|
71
|
+
check_untyped_defs = true
|
|
72
|
+
ignore_missing_imports = true
|
|
73
|
+
warn_no_return = true
|
|
74
|
+
warn_redundant_casts = true
|
|
75
|
+
warn_unused_configs = true
|
|
76
|
+
warn_unused_ignores = true
|
|
@@ -16,12 +16,12 @@ The library is also available on conda-forge:
|
|
|
16
16
|
conda install -c conda-forge pyopensky
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Development mode (with
|
|
19
|
+
Development mode (with uv):
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux and MacOS
|
|
23
|
+
irm https://astral.sh/uv/install.ps1 | iex # Windows
|
|
24
|
+
uv sync --dev
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Credentials
|