perfact-api-app-fastapi 0.6__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.
- perfact_api_app_fastapi-0.6/PKG-INFO +51 -0
- perfact_api_app_fastapi-0.6/README.md +37 -0
- perfact_api_app_fastapi-0.6/pyproject.toml +43 -0
- perfact_api_app_fastapi-0.6/setup.cfg +4 -0
- perfact_api_app_fastapi-0.6/src/perfact/api/app_fastapi/__init__.py +0 -0
- perfact_api_app_fastapi-0.6/src/perfact/api/app_fastapi/routes.py +26 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/PKG-INFO +51 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/SOURCES.txt +11 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/dependency_links.txt +1 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/entry_points.txt +2 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/requires.txt +2 -0
- perfact_api_app_fastapi-0.6/src/perfact_api_app_fastapi.egg-info/top_level.txt +1 -0
- perfact_api_app_fastapi-0.6/tox.ini +32 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: perfact-api-app-fastapi
|
|
3
|
+
Version: 0.6
|
|
4
|
+
Summary: PerFact API - app FastAPI integration
|
|
5
|
+
Author-email: Viktor Dick <viktor.dick@perfact.de>
|
|
6
|
+
License: GPL-2.0-or-later
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: SQL
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: perfact-api-app
|
|
13
|
+
Requires-Dist: perfact-api-main
|
|
14
|
+
|
|
15
|
+
# perfact-api-app-fastapi
|
|
16
|
+
|
|
17
|
+
FastAPI routes plugin for the `app` namespace of the PerFact API.
|
|
18
|
+
|
|
19
|
+
Registers under the `perfact.assignapi` entry point group and mounts routes at `/app`.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pip install perfact-api-app-fastapi
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
# Install dependencies (editable, from sibling dirs)
|
|
31
|
+
python -m venv .venv && source .venv/bin/activate
|
|
32
|
+
pip install -e ../perfact-api-base-model/
|
|
33
|
+
pip install -e ../perfact-api-main/
|
|
34
|
+
pip install -e ../app/
|
|
35
|
+
pip install -e .
|
|
36
|
+
|
|
37
|
+
# Run all checks
|
|
38
|
+
tox
|
|
39
|
+
|
|
40
|
+
# Individual checks
|
|
41
|
+
ruff format --check src
|
|
42
|
+
ruff check src
|
|
43
|
+
mypy src
|
|
44
|
+
bandit --configfile ../bandit.yml -r src
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Entry point changes require re-running `pip install -e .` to regenerate the entry points file in site-packages.
|
|
48
|
+
|
|
49
|
+
## Maintainers
|
|
50
|
+
|
|
51
|
+
- Viktor Dick <viktor.dick@perfact.de>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# perfact-api-app-fastapi
|
|
2
|
+
|
|
3
|
+
FastAPI routes plugin for the `app` namespace of the PerFact API.
|
|
4
|
+
|
|
5
|
+
Registers under the `perfact.assignapi` entry point group and mounts routes at `/app`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install perfact-api-app-fastapi
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
# Install dependencies (editable, from sibling dirs)
|
|
17
|
+
python -m venv .venv && source .venv/bin/activate
|
|
18
|
+
pip install -e ../perfact-api-base-model/
|
|
19
|
+
pip install -e ../perfact-api-main/
|
|
20
|
+
pip install -e ../app/
|
|
21
|
+
pip install -e .
|
|
22
|
+
|
|
23
|
+
# Run all checks
|
|
24
|
+
tox
|
|
25
|
+
|
|
26
|
+
# Individual checks
|
|
27
|
+
ruff format --check src
|
|
28
|
+
ruff check src
|
|
29
|
+
mypy src
|
|
30
|
+
bandit --configfile ../bandit.yml -r src
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Entry point changes require re-running `pip install -e .` to regenerate the entry points file in site-packages.
|
|
34
|
+
|
|
35
|
+
## Maintainers
|
|
36
|
+
|
|
37
|
+
- Viktor Dick <viktor.dick@perfact.de>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.2", "setuptools-scm>=8.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "perfact-api-app-fastapi"
|
|
7
|
+
authors = [
|
|
8
|
+
{name="Viktor Dick", email="viktor.dick@perfact.de"},
|
|
9
|
+
]
|
|
10
|
+
description = "PerFact API - app FastAPI integration"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
license = {text = "GPL-2.0-or-later"}
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: SQL",
|
|
16
|
+
"Operating System :: POSIX :: Linux",
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"perfact-api-app",
|
|
20
|
+
"perfact-api-main",
|
|
21
|
+
]
|
|
22
|
+
dynamic = ["version"]
|
|
23
|
+
requires-python = ">=3.10"
|
|
24
|
+
|
|
25
|
+
[project.entry-points.'perfact.assignapi']
|
|
26
|
+
app = 'perfact.api.app_fastapi.routes:mount'
|
|
27
|
+
|
|
28
|
+
[tool.distutils.bdist_wheel]
|
|
29
|
+
universal = 1
|
|
30
|
+
|
|
31
|
+
[tool.setuptools]
|
|
32
|
+
include-package-data = true
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.packages.find]
|
|
35
|
+
where = ["src"]
|
|
36
|
+
|
|
37
|
+
[tool.setuptools_scm]
|
|
38
|
+
root = ".."
|
|
39
|
+
fallback_version = "0.0.0"
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
[tool.ruff.lint]
|
|
43
|
+
select = ["E", "F", "W", "I"]
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from fastapi import FastAPI
|
|
2
|
+
from perfact.api.app.model.apptblcleanup import AppTblCleanup
|
|
3
|
+
from perfact.api.main.dbsession import APIRouter, DBSession
|
|
4
|
+
|
|
5
|
+
routes = APIRouter()
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@routes.api_route("/tablecleanup", methods=["GET", "POST"], tags=["app"])
|
|
9
|
+
async def tablecleanup(session: DBSession) -> dict[str, AppTblCleanup.RunResult]:
|
|
10
|
+
"""
|
|
11
|
+
Clean up data according to given rules in apptblcleanup.
|
|
12
|
+
Yields after each processed batch. Returns a mapping from table name to
|
|
13
|
+
number of entries deleted.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
final_stats = {}
|
|
17
|
+
|
|
18
|
+
for current_stats in AppTblCleanup.run_cleanup_batches(session):
|
|
19
|
+
session.commit()
|
|
20
|
+
final_stats = current_stats
|
|
21
|
+
|
|
22
|
+
return final_stats
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def mount(app: FastAPI):
|
|
26
|
+
app.include_router(routes, prefix="/app")
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: perfact-api-app-fastapi
|
|
3
|
+
Version: 0.6
|
|
4
|
+
Summary: PerFact API - app FastAPI integration
|
|
5
|
+
Author-email: Viktor Dick <viktor.dick@perfact.de>
|
|
6
|
+
License: GPL-2.0-or-later
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: SQL
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: perfact-api-app
|
|
13
|
+
Requires-Dist: perfact-api-main
|
|
14
|
+
|
|
15
|
+
# perfact-api-app-fastapi
|
|
16
|
+
|
|
17
|
+
FastAPI routes plugin for the `app` namespace of the PerFact API.
|
|
18
|
+
|
|
19
|
+
Registers under the `perfact.assignapi` entry point group and mounts routes at `/app`.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pip install perfact-api-app-fastapi
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
# Install dependencies (editable, from sibling dirs)
|
|
31
|
+
python -m venv .venv && source .venv/bin/activate
|
|
32
|
+
pip install -e ../perfact-api-base-model/
|
|
33
|
+
pip install -e ../perfact-api-main/
|
|
34
|
+
pip install -e ../app/
|
|
35
|
+
pip install -e .
|
|
36
|
+
|
|
37
|
+
# Run all checks
|
|
38
|
+
tox
|
|
39
|
+
|
|
40
|
+
# Individual checks
|
|
41
|
+
ruff format --check src
|
|
42
|
+
ruff check src
|
|
43
|
+
mypy src
|
|
44
|
+
bandit --configfile ../bandit.yml -r src
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Entry point changes require re-running `pip install -e .` to regenerate the entry points file in site-packages.
|
|
48
|
+
|
|
49
|
+
## Maintainers
|
|
50
|
+
|
|
51
|
+
- Viktor Dick <viktor.dick@perfact.de>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
tox.ini
|
|
4
|
+
src/perfact/api/app_fastapi/__init__.py
|
|
5
|
+
src/perfact/api/app_fastapi/routes.py
|
|
6
|
+
src/perfact_api_app_fastapi.egg-info/PKG-INFO
|
|
7
|
+
src/perfact_api_app_fastapi.egg-info/SOURCES.txt
|
|
8
|
+
src/perfact_api_app_fastapi.egg-info/dependency_links.txt
|
|
9
|
+
src/perfact_api_app_fastapi.egg-info/entry_points.txt
|
|
10
|
+
src/perfact_api_app_fastapi.egg-info/requires.txt
|
|
11
|
+
src/perfact_api_app_fastapi.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
perfact
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[tox]
|
|
2
|
+
envlist = py3
|
|
3
|
+
isolated_build = true
|
|
4
|
+
|
|
5
|
+
[pytest]
|
|
6
|
+
|
|
7
|
+
[testenv]
|
|
8
|
+
passenv = SSH_AUTH_SOCK, PYTHONPATH, HTTP_PROXY, HTTPS_PROXY
|
|
9
|
+
setenv =
|
|
10
|
+
GIT_SSH_VARIANT=ssh
|
|
11
|
+
GIT_SSH_COMMAND=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
|
|
12
|
+
|
|
13
|
+
deps =
|
|
14
|
+
ruff
|
|
15
|
+
pytest
|
|
16
|
+
coverage
|
|
17
|
+
psycopg[binary]
|
|
18
|
+
pytest-postgresql
|
|
19
|
+
pytest-cov
|
|
20
|
+
pytest-typing
|
|
21
|
+
bandit
|
|
22
|
+
mypy
|
|
23
|
+
perfact-api-base-model
|
|
24
|
+
perfact-api-main
|
|
25
|
+
perfact-api-app
|
|
26
|
+
|
|
27
|
+
commands =
|
|
28
|
+
ruff format --check
|
|
29
|
+
ruff check
|
|
30
|
+
bandit --configfile {toxinidir}/../bandit.yml -r src
|
|
31
|
+
mypy src
|
|
32
|
+
# pytest --doctest-modules --cov-branch --cov=src --cov-report=term-missing {posargs:src}
|