Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 30 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
name: ci

on:
push:
branches:
- master
- main
pull_request:

permissions:
contents: write
contents: read

jobs:
deploy:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
python-version: "3.12"
- run: python -m pip install uv
- run: uv sync --frozen
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run ty check
- run: uv run python -m unittest discover -v
- run: uv build

docs:
needs: quality
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
key: ${{ github.ref }}
path: .cache
# - run: pip install -r requirements.txt
- run: pip install pymdown-extensions
- run: pip install mkdocs
- run: pip install mkdocs-material
- run: pip install mkdocs-charts-plugin
- run: pip install mkdocs-callouts
- run: pip install mkdocs-git-revision-date-localized-plugin
- run: pip install mkdocstrings
- run: pip install mkdocstrings-python
- run: mkdocs gh-deploy --force
python-version: "3.12"
- run: python -m pip install uv
- run: uv sync --frozen
- run: uv run mkdocs gh-deploy --force
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,17 @@ venv.bak/
# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# ruff
.ruff_cache/

# Pyre type checker
.pyre/
# ty type checker
.ty_cache/

# pytype static type analyzer
.pytype/
# Local git worktrees
.worktrees/

# wily metrics cache
.wily/

# Cython debug symbols
cython_debug/
Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
default_stages: [pre-commit]
fail_fast: true

repos:
- repo: local
hooks:
- id: quality-check
name: quality check
entry: uv run python tools/quality.py check
language: system
pass_filenames: false

- id: detect-secrets-baseline
name: detect-secrets baseline
entry: uv run detect-secrets-hook --baseline .secrets.baseline
language: system

- id: lizard-report
name: lizard report
entry: uv run lizard xpwebapi -i -1
language: system
pass_filenames: false
types: [python]

- id: cohesion-report
name: cohesion report
entry: uv run cohesion -d xpwebapi
language: system
pass_filenames: false
types: [python]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
127 changes: 127 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "GitLabTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "IPPublicDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "OpenAIDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "PypiTokenDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TelegramBotTokenDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2026-06-19T19:34:38Z"
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ See [X-Plane Web API](https://developer.x-plane.com/article/x-plane-web-api/).
pip install 'xpwebapi @ git+https://github.com/devleaks/xplane-webapi.git'
```

For development, add option `dev`:
For development, clone the repository and sync the development dependency group:


```sh
pip install 'xpwebapi[dev] @ git+https://github.com/devleaks/xplane-webapi.git'
git clone https://github.com/devleaks/xplane-webapi.git
cd xplane-webapi
uv sync
```
3 changes: 3 additions & 0 deletions docs/reference/async-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Async REST

::: xpwebapi.async_rest
3 changes: 3 additions & 0 deletions docs/reference/beacon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Beacon

::: xpwebapi.beacon
3 changes: 3 additions & 0 deletions docs/reference/core-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Core API

::: xpwebapi.api
3 changes: 3 additions & 0 deletions docs/reference/exceptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Exceptions

::: xpwebapi.exceptions
16 changes: 13 additions & 3 deletions docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ hide:
- navigation
---

# ::: xpwebapi
options:
show_submodules: true
# API reference

The reference section is generated from source docstrings with `mkdocstrings`.

- [Package](package.md)
- [Core API](core-api.md)
- [REST](rest.md)
- [Async REST](async-rest.md)
- [WebSocket](websocket.md)
- [UDP](udp.md)
- [Beacon](beacon.md)
- [Exceptions](exceptions.md)
- [Logging](logging.md)
3 changes: 3 additions & 0 deletions docs/reference/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Logging

::: xpwebapi.logging_config
5 changes: 5 additions & 0 deletions docs/reference/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Package

::: xpwebapi
options:
show_submodules: false
3 changes: 3 additions & 0 deletions docs/reference/rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# REST

::: xpwebapi.rest
3 changes: 3 additions & 0 deletions docs/reference/udp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# UDP

::: xpwebapi.udp
3 changes: 3 additions & 0 deletions docs/reference/websocket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# WebSocket

::: xpwebapi.ws
Loading