openadmin 0.2.0__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 (64) hide show
  1. openadmin-0.2.0/.github/ISSUE_TEMPLATE/bug.md +13 -0
  2. openadmin-0.2.0/.github/ISSUE_TEMPLATE/chore.md +15 -0
  3. openadmin-0.2.0/.github/ISSUE_TEMPLATE/feature.md +15 -0
  4. openadmin-0.2.0/.github/actions/branch-name/action.yml +15 -0
  5. openadmin-0.2.0/.github/actions/dependency-cves/action.yml +10 -0
  6. openadmin-0.2.0/.github/actions/format/action.yml +10 -0
  7. openadmin-0.2.0/.github/actions/license/action.yml +10 -0
  8. openadmin-0.2.0/.github/actions/lint/action.yml +10 -0
  9. openadmin-0.2.0/.github/actions/security/action.yml +10 -0
  10. openadmin-0.2.0/.github/actions/spell-check/action.yml +10 -0
  11. openadmin-0.2.0/.github/actions/test/action.yml +10 -0
  12. openadmin-0.2.0/.github/actions/typecheck/action.yml +12 -0
  13. openadmin-0.2.0/.github/actions/unused-code/action.yml +10 -0
  14. openadmin-0.2.0/.github/workflows/ci.yml +91 -0
  15. openadmin-0.2.0/.github/workflows/publish.yml +34 -0
  16. openadmin-0.2.0/.gitignore +12 -0
  17. openadmin-0.2.0/.python-version +1 -0
  18. openadmin-0.2.0/LICENSE +661 -0
  19. openadmin-0.2.0/LICENSES/AGPL-3.0-or-later.txt +235 -0
  20. openadmin-0.2.0/Makefile +45 -0
  21. openadmin-0.2.0/PKG-INFO +304 -0
  22. openadmin-0.2.0/README.md +289 -0
  23. openadmin-0.2.0/REUSE.toml +17 -0
  24. openadmin-0.2.0/docs/assets/logo.png +0 -0
  25. openadmin-0.2.0/examples/__init__.py +0 -0
  26. openadmin-0.2.0/examples/health.py +17 -0
  27. openadmin-0.2.0/examples/main.py +31 -0
  28. openadmin-0.2.0/examples/users.py +46 -0
  29. openadmin-0.2.0/openadmin/fastapi/__init__.py +11 -0
  30. openadmin-0.2.0/openadmin/fastapi/admin_page.py +526 -0
  31. openadmin-0.2.0/openadmin/fastapi/admin_panel.py +89 -0
  32. openadmin-0.2.0/openadmin/fastapi/types/__init__.py +36 -0
  33. openadmin-0.2.0/openadmin/fastapi/types/action.py +20 -0
  34. openadmin-0.2.0/openadmin/fastapi/types/area_chart.py +19 -0
  35. openadmin-0.2.0/openadmin/fastapi/types/bar_chart.py +19 -0
  36. openadmin-0.2.0/openadmin/fastapi/types/form.py +20 -0
  37. openadmin-0.2.0/openadmin/fastapi/types/line_chart.py +19 -0
  38. openadmin-0.2.0/openadmin/fastapi/types/markdown.py +19 -0
  39. openadmin-0.2.0/openadmin/fastapi/types/page_protocol.py +12 -0
  40. openadmin-0.2.0/openadmin/fastapi/types/pie_chart.py +19 -0
  41. openadmin-0.2.0/openadmin/fastapi/types/section.py +15 -0
  42. openadmin-0.2.0/openadmin/fastapi/types/stat.py +19 -0
  43. openadmin-0.2.0/openadmin/fastapi/types/table.py +19 -0
  44. openadmin-0.2.0/openadmin/fastapi/utils.py +167 -0
  45. openadmin-0.2.0/openadmin/spec/__init__.py +41 -0
  46. openadmin-0.2.0/openadmin/spec/components/__init__.py +35 -0
  47. openadmin-0.2.0/openadmin/spec/components/action.py +22 -0
  48. openadmin-0.2.0/openadmin/spec/components/area_chart.py +19 -0
  49. openadmin-0.2.0/openadmin/spec/components/bar_chart.py +19 -0
  50. openadmin-0.2.0/openadmin/spec/components/form.py +22 -0
  51. openadmin-0.2.0/openadmin/spec/components/http_methods.py +7 -0
  52. openadmin-0.2.0/openadmin/spec/components/line_chart.py +19 -0
  53. openadmin-0.2.0/openadmin/spec/components/markdown.py +19 -0
  54. openadmin-0.2.0/openadmin/spec/components/pie_chart.py +19 -0
  55. openadmin-0.2.0/openadmin/spec/components/property.py +17 -0
  56. openadmin-0.2.0/openadmin/spec/components/property_type.py +18 -0
  57. openadmin-0.2.0/openadmin/spec/components/stat.py +19 -0
  58. openadmin-0.2.0/openadmin/spec/components/table.py +21 -0
  59. openadmin-0.2.0/openadmin/spec/page.py +15 -0
  60. openadmin-0.2.0/openadmin/spec/section.py +15 -0
  61. openadmin-0.2.0/openadmin/spec/spec.py +16 -0
  62. openadmin-0.2.0/pyproject.toml +56 -0
  63. openadmin-0.2.0/tests/test_hello.py +7 -0
  64. openadmin-0.2.0/uv.lock +868 -0
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: ๐Ÿ› Bug
3
+ about: Report a bug or unexpected behavior
4
+ title: "[๐Ÿ› Bug] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ # Description
10
+ <!-- What went wrong and what was expected? -->
11
+
12
+ # Notes
13
+ <!-- Steps to reproduce, environment details, or relevant logs. -->
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: ๐Ÿ”ง Chore
3
+ about: Track maintenance, refactoring, or non-feature work
4
+ title: "[๐Ÿ”ง Chore] "
5
+ labels: chore
6
+ assignees: ""
7
+ ---
8
+
9
+ # Description
10
+
11
+ <!-- What needs to be done and why? -->
12
+
13
+ # Notes
14
+
15
+ <!-- Any dependencies, risks, or follow-up tasks. -->
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: โœจ Feature
3
+ about: Propose a new feature or enhancement
4
+ title: "[โœจ Feature] "
5
+ labels: feature
6
+ assignees: ""
7
+ ---
8
+
9
+ # Description
10
+
11
+ <!-- What should be added and why? -->
12
+
13
+ # Notes
14
+
15
+ <!-- Any extra context, constraints, or references. -->
@@ -0,0 +1,15 @@
1
+ name: "๐ŸŒฟ Branch Name"
2
+ description: "Validate branch name follows naming conventions"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - shell: bash
7
+ run: |
8
+ BRANCH="${{ github.head_ref || github.ref_name }}"
9
+ PATTERN="^(main|dev|prod|develop|(feat|fix|chore|refactor|docs|test|release|hotfix)/[a-zA-Z0-9._-]+)$"
10
+ if [[ ! "$BRANCH" =~ $PATTERN ]]; then
11
+ echo "Branch name '$BRANCH' does not match required pattern: $PATTERN"
12
+ echo "Valid prefixes: feat/, fix/, chore/, refactor/, docs/, test/, release/, hotfix/"
13
+ exit 1
14
+ fi
15
+ echo "Branch name '$BRANCH' is valid."
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿ“ฆ Dependency CVEs"
2
+ description: "Run uv audit to check for known CVEs"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/cves
@@ -0,0 +1,10 @@
1
+ name: "๐ŸŽจ Format"
2
+ description: "Run ruff format check"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/format
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿ“„ License"
2
+ description: "Check license headers with reuse"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/license
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿงน Lint"
2
+ description: "Run ruff linter"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/lint
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿ›ก๏ธ Security"
2
+ description: "Run bandit security scan"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/security
@@ -0,0 +1,10 @@
1
+ name: "โœ๏ธ Spell Check"
2
+ description: "Check spelling with codespell"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/spell
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿงช Test"
2
+ description: "Run pytest test suite"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/test
@@ -0,0 +1,12 @@
1
+ name: "๐Ÿท๏ธ Typecheck"
2
+ description: "Run pyright type checker"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: uv sync
11
+ - shell: bash
12
+ run: make check/typing
@@ -0,0 +1,10 @@
1
+ name: "๐Ÿ—‘๏ธ Unused Code"
2
+ description: "Run vulture to find dead code"
3
+ runs:
4
+ using: composite
5
+ steps:
6
+ - uses: astral-sh/setup-uv@v4
7
+ with:
8
+ enable-cache: true
9
+ - shell: bash
10
+ run: make check/unused
@@ -0,0 +1,91 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: ["**"]
6
+ workflow_call:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.head_ref || github.sha }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ lint:
14
+ name: "๐Ÿงน Lint"
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: ./.github/actions/lint
19
+
20
+ format:
21
+ name: "๐ŸŽจ Format"
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: ./.github/actions/format
26
+
27
+ typecheck:
28
+ name: "๐Ÿท๏ธ Typecheck"
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: ./.github/actions/typecheck
33
+
34
+ unused-code:
35
+ name: "๐Ÿ—‘๏ธ Unused Code"
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: ./.github/actions/unused-code
40
+
41
+ spell-check:
42
+ name: "โœ๏ธ Spell Check"
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: ./.github/actions/spell-check
47
+
48
+ branch-name:
49
+ name: "๐ŸŒฟ Branch Name"
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ - uses: ./.github/actions/branch-name
54
+
55
+ security:
56
+ name: "๐Ÿ›ก๏ธ Security"
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - uses: ./.github/actions/security
61
+
62
+ dependency-cves:
63
+ name: "๐Ÿ“ฆ Dependency CVEs"
64
+ runs-on: ubuntu-latest
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+ - uses: ./.github/actions/dependency-cves
68
+
69
+ license:
70
+ name: "๐Ÿ“„ License"
71
+ runs-on: ubuntu-latest
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - uses: ./.github/actions/license
75
+
76
+ test:
77
+ name: "๐Ÿงช Test"
78
+ runs-on: ubuntu-latest
79
+ needs:
80
+ - lint
81
+ - format
82
+ - typecheck
83
+ - unused-code
84
+ - spell-check
85
+ - branch-name
86
+ - security
87
+ - dependency-cves
88
+ - license
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - uses: ./.github/actions/test
@@ -0,0 +1,34 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - prod
7
+ - dev
8
+
9
+ jobs:
10
+ ci:
11
+ name: "โœ… CI"
12
+ uses: ./.github/workflows/ci.yml
13
+
14
+ publish:
15
+ name: "๐Ÿš€ Publish"
16
+ runs-on: ubuntu-latest
17
+ needs: ci
18
+ environment:
19
+ name: ${{ github.ref_name == 'prod' && 'pypi' || 'pypi-dev' }}
20
+ url: https://pypi.org/project/${{ github.ref_name == 'prod' && 'openadmin' || 'openadmin-dev' }}/
21
+ permissions:
22
+ id-token: write
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: astral-sh/setup-uv@v4
26
+ with:
27
+ enable-cache: true
28
+ - name: Override package name for dev
29
+ if: github.ref_name == 'dev'
30
+ run: sed -i 's/^name = "openadmin"$/name = "openadmin-dev"/' pyproject.toml
31
+ - name: Build
32
+ run: uv build
33
+ - name: Publish to PyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,12 @@
1
+ # IDE
2
+ .vscode
3
+
4
+ # Python
5
+ .pytest_cache
6
+ .ruff_cache
7
+ .venv
8
+ **/__pycache__
9
+
10
+ # DB
11
+ *.db
12
+ *.sqlite
@@ -0,0 +1 @@
1
+ 3.14