rfserver 1.0.1__tar.gz → 1.0.2__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 (29) hide show
  1. {rfserver-1.0.1 → rfserver-1.0.2}/PKG-INFO +21 -21
  2. {rfserver-1.0.1 → rfserver-1.0.2}/README.rst +12 -14
  3. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/contents/development.rst +1 -1
  4. {rfserver-1.0.1 → rfserver-1.0.2}/pyproject.toml +85 -37
  5. rfserver-1.0.2/src/rfserver/__init__.py +7 -0
  6. rfserver-1.0.2/src/rfserver/__version__.py +10 -0
  7. rfserver-1.0.2/src/rfserver/_help.py +77 -0
  8. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/db/create_database.py +1 -1
  9. rfserver-1.0.2/src/rfserver/main.py +117 -0
  10. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/rest_api/rest.py +2 -2
  11. rfserver-1.0.1/src/rfserver/__init__.py +0 -7
  12. rfserver-1.0.1/src/rfserver/main.py +0 -18
  13. {rfserver-1.0.1 → rfserver-1.0.2}/AUTHORS.md +0 -0
  14. {rfserver-1.0.1 → rfserver-1.0.2}/CHANGELOG.rst +0 -0
  15. {rfserver-1.0.1 → rfserver-1.0.2}/LICENSE +0 -0
  16. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/api/rfserver/db.rst +0 -0
  17. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/api/rfserver/rest_api.rst +0 -0
  18. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/api/rfserver.rst +0 -0
  19. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/contents/about.rst +0 -0
  20. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/contents/changelog.rst +0 -0
  21. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/contents/codeofconduct.rst +0 -0
  22. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/contents/usage.rst +0 -0
  23. {rfserver-1.0.1 → rfserver-1.0.2}/docs/source/index.rst +0 -0
  24. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/__main__.py +0 -0
  25. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/db/__init__.py +0 -0
  26. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/db/database.py +0 -0
  27. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/db/detail.db +0 -0
  28. {rfserver-1.0.1 → rfserver-1.0.2}/src/rfserver/rest_api/__init__.py +0 -0
  29. {rfserver-1.0.1 → rfserver-1.0.2}/tests/test_database.py +0 -0
@@ -1,8 +1,10 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: rfserver
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: RF Analysis Engine
5
- License: AGPL-3.0-only
5
+ License-Expression: AGPL-3.0-only
6
+ License-File: AUTHORS.md
7
+ License-File: LICENSE
6
8
  Keywords: Radio Frequency,RF,Node
7
9
  Author: Iso
8
10
  Maintainer: Iso
@@ -36,11 +38,11 @@ Requires-Dist: sphinx-inline-tabs (==2023.4.21) ; (python_version >= "3.8" and p
36
38
  Requires-Dist: sphinx-rtd-theme (<=3.0.2) ; (python_version >= "3.8" and python_version <= "3.14") and (extra == "docs")
37
39
  Requires-Dist: sphinxcontrib-mermaid (<=1.0.0) ; (python_version >= "3.8" and python_version <= "3.14") and (extra == "docs")
38
40
  Requires-Dist: sphinxcontrib-spelling (<=8.0.1) ; (python_version >= "3.10" and python_version <= "3.14") and (extra == "docs")
39
- Project-URL: Bug Tracker, https://github.com/alanmehio/rf-analysis-engine/issues
40
- Project-URL: CI: Github Actions, https://github.com/alanmehio/rf-analysis-engine/actions
41
- Project-URL: Changelog, https://github.com/alanmehio/rf-analysis-engine/blob/master/CHANGELOG.rst
41
+ Project-URL: Bug Tracker, https://github.com/alan-techdev/rf-analysis-engine/issues
42
+ Project-URL: CI: Github Actions, https://github.com/alan-techdev/rf-analysis-engine/actions
43
+ Project-URL: Changelog, https://github.com/alan-techdev/rf-analysis-engine/blob/master/CHANGELOG.rst
42
44
  Project-URL: Documentation, https://rf-analysis-engine.readthedocs.io/
43
- Project-URL: Source Code, https://github.com/alanmehio/rf-analysis-engine
45
+ Project-URL: Source Code, https://github.com/alan-techdev/rf-analysis-engine
44
46
  Description-Content-Type: text/x-rst
45
47
 
46
48
  RF Analysis Engine
@@ -57,7 +59,7 @@ COMMUNITY VERSION
57
59
  .. start-badges see https://shields.io/badges and collection see https://github.com/inttter/md-badges
58
60
 
59
61
  | |build| |release_version| |wheel|
60
- | |docs| |pylint| |supported_versions|
62
+ | |docs| |supported_versions| |contributors|
61
63
  | |ruff| |gh-lic| |commits_since_specific_tag_on_main|
62
64
 
63
65
 
@@ -68,12 +70,12 @@ COMMUNITY VERSION
68
70
  ==========
69
71
  Change Log
70
72
  ==========
71
- | `Change Log <https://github.com/alanmehio/rf-analysis-engine/blob/main/CHANGELOG.rst>`_.
73
+ | `Change Log <https://github.com/alan-techdev/rf-analysis-engine/blob/main/CHANGELOG.rst>`_.
72
74
 
73
75
  ==========
74
76
  Quickstart
75
77
  ==========
76
- | `Usage <https://github.com/alanmehio/rf-analysis-engine/blob/main/docs/source/contents/usage.rst>`_.
78
+ | `Usage <https://github.com/alan-techdev/rf-analysis-engine/blob/main/docs/source/contents/usage.rst>`_.
77
79
 
78
80
  =======
79
81
  License
@@ -85,7 +87,7 @@ License
85
87
 
86
88
  .. LINKS
87
89
 
88
- .. _GNU Affero General Public License v3.0: https://github.com/alanmehio/rf-analysis-engine/blob/main/LICENSE
90
+ .. _GNU Affero General Public License v3.0: https://github.com/alan-techdev/rf-analysis-engine/blob/main/LICENSE
89
91
 
90
92
 
91
93
 
@@ -94,9 +96,9 @@ License
94
96
  .. Build Status
95
97
  .. Github Actions: Test Workflow Status for specific branch <branch>
96
98
 
97
- .. |build| image:: https://img.shields.io/github/workflow/status/alanmehio/rf-analysis-engine/actions/workflows/ci_cd.yaml/badge.svg
99
+ .. |build| image:: https://img.shields.io/github/workflow/status/alan-techdev/rf-analysis-engine/actions/workflows/ci_cd.yaml/badge.svg
98
100
  :alt: GitHub Workflow Status (branch)
99
- :target: https://github.com/alanmehio/rf-analysis-engine/actions
101
+ :target: https://github.com/alan-techdev/rf-analysis-engine/actions
100
102
 
101
103
 
102
104
  .. Documentation
@@ -105,8 +107,9 @@ License
105
107
  :alt: Read the Docs (version)
106
108
  :target: https://rf-analysis-engine.readthedocs.io/en/latest/
107
109
 
108
- .. |pylint| image:: https://img.shields.io/badge/linting-pylint-yellowgreen
109
- :target: https://github.com/pylint-dev/pylint
110
+ .. |contributors| image:: https://img.shields.io/github/contributors/alan-techdev/rf-analysis-engine?color=blue&logo=github
111
+ :alt: GitHub contributors
112
+ :target: https://github.com/alan-techdev/rf-analysis-engine/graphs/contributors
110
113
 
111
114
  .. PyPI
112
115
 
@@ -123,19 +126,16 @@ License
123
126
  :target: https://pypi.org/project/rfserver
124
127
  .. Github Releases & Tags
125
128
 
126
- .. |commits_since_specific_tag_on_main| image:: https://img.shields.io/github/commits-since/alanmehio/rf-analysis-engine/release-1.0.0/main?color=blue&logo=github
129
+ .. |commits_since_specific_tag_on_main| image:: https://img.shields.io/github/commits-since/alan-techdev/rf-analysis-engine/release-1.0.0/main?color=blue&logo=github
127
130
  :alt: GitHub commits since tagged version (branch)
128
- :target: https://github.com/alanmehio/rf-analysis-engine/compare/release-1.0.0..main
129
-
130
- .. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/alanmehio/rf-analysis-engine/latest?color=blue&logo=semver&sort=semver
131
- :alt: GitHub commits since latest release (by SemVer)
131
+ :target: https://github.com/alan-techdev/rf-analysis-engine/compare/release-1.0.0..main
132
132
 
133
133
  .. LICENSE (eg AGPL, MIT)
134
134
  .. Github License
135
135
 
136
136
  .. |gh-lic| image:: https://img.shields.io/badge/license-GNU_Affero-orange
137
137
  :alt: GitHub
138
- :target: https://github.com/alanmehio/rf-analysis-engine/blob/main/LICENSE
138
+ :target: https://github.com/alan-techdev/rf-analysis-engine/blob/main/LICENSE
139
139
 
140
140
 
141
141
  .. Ruff linter for Fast Python Linting
@@ -12,7 +12,7 @@ COMMUNITY VERSION
12
12
  .. start-badges see https://shields.io/badges and collection see https://github.com/inttter/md-badges
13
13
 
14
14
  | |build| |release_version| |wheel|
15
- | |docs| |pylint| |supported_versions|
15
+ | |docs| |supported_versions| |contributors|
16
16
  | |ruff| |gh-lic| |commits_since_specific_tag_on_main|
17
17
 
18
18
 
@@ -23,12 +23,12 @@ COMMUNITY VERSION
23
23
  ==========
24
24
  Change Log
25
25
  ==========
26
- | `Change Log <https://github.com/alanmehio/rf-analysis-engine/blob/main/CHANGELOG.rst>`_.
26
+ | `Change Log <https://github.com/alan-techdev/rf-analysis-engine/blob/main/CHANGELOG.rst>`_.
27
27
 
28
28
  ==========
29
29
  Quickstart
30
30
  ==========
31
- | `Usage <https://github.com/alanmehio/rf-analysis-engine/blob/main/docs/source/contents/usage.rst>`_.
31
+ | `Usage <https://github.com/alan-techdev/rf-analysis-engine/blob/main/docs/source/contents/usage.rst>`_.
32
32
 
33
33
  =======
34
34
  License
@@ -40,7 +40,7 @@ License
40
40
 
41
41
  .. LINKS
42
42
 
43
- .. _GNU Affero General Public License v3.0: https://github.com/alanmehio/rf-analysis-engine/blob/main/LICENSE
43
+ .. _GNU Affero General Public License v3.0: https://github.com/alan-techdev/rf-analysis-engine/blob/main/LICENSE
44
44
 
45
45
 
46
46
 
@@ -49,9 +49,9 @@ License
49
49
  .. Build Status
50
50
  .. Github Actions: Test Workflow Status for specific branch <branch>
51
51
 
52
- .. |build| image:: https://img.shields.io/github/workflow/status/alanmehio/rf-analysis-engine/actions/workflows/ci_cd.yaml/badge.svg
52
+ .. |build| image:: https://img.shields.io/github/workflow/status/alan-techdev/rf-analysis-engine/actions/workflows/ci_cd.yaml/badge.svg
53
53
  :alt: GitHub Workflow Status (branch)
54
- :target: https://github.com/alanmehio/rf-analysis-engine/actions
54
+ :target: https://github.com/alan-techdev/rf-analysis-engine/actions
55
55
 
56
56
 
57
57
  .. Documentation
@@ -60,8 +60,9 @@ License
60
60
  :alt: Read the Docs (version)
61
61
  :target: https://rf-analysis-engine.readthedocs.io/en/latest/
62
62
 
63
- .. |pylint| image:: https://img.shields.io/badge/linting-pylint-yellowgreen
64
- :target: https://github.com/pylint-dev/pylint
63
+ .. |contributors| image:: https://img.shields.io/github/contributors/alan-techdev/rf-analysis-engine?color=blue&logo=github
64
+ :alt: GitHub contributors
65
+ :target: https://github.com/alan-techdev/rf-analysis-engine/graphs/contributors
65
66
 
66
67
  .. PyPI
67
68
 
@@ -78,19 +79,16 @@ License
78
79
  :target: https://pypi.org/project/rfserver
79
80
  .. Github Releases & Tags
80
81
 
81
- .. |commits_since_specific_tag_on_main| image:: https://img.shields.io/github/commits-since/alanmehio/rf-analysis-engine/release-1.0.0/main?color=blue&logo=github
82
+ .. |commits_since_specific_tag_on_main| image:: https://img.shields.io/github/commits-since/alan-techdev/rf-analysis-engine/release-1.0.0/main?color=blue&logo=github
82
83
  :alt: GitHub commits since tagged version (branch)
83
- :target: https://github.com/alanmehio/rf-analysis-engine/compare/release-1.0.0..main
84
-
85
- .. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/alanmehio/rf-analysis-engine/latest?color=blue&logo=semver&sort=semver
86
- :alt: GitHub commits since latest release (by SemVer)
84
+ :target: https://github.com/alan-techdev/rf-analysis-engine/compare/release-1.0.0..main
87
85
 
88
86
  .. LICENSE (eg AGPL, MIT)
89
87
  .. Github License
90
88
 
91
89
  .. |gh-lic| image:: https://img.shields.io/badge/license-GNU_Affero-orange
92
90
  :alt: GitHub
93
- :target: https://github.com/alanmehio/rf-analysis-engine/blob/main/LICENSE
91
+ :target: https://github.com/alan-techdev/rf-analysis-engine/blob/main/LICENSE
94
92
 
95
93
 
96
94
  .. Ruff linter for Fast Python Linting
@@ -12,7 +12,7 @@ Development
12
12
 
13
13
  .. code-block:: shell
14
14
 
15
- git clone git@github.com:alanmehio/rf-analysis-engine.git
15
+ git clone git@github.com:alan-techdev/rf-analysis-engine.git
16
16
  cd rf-analysis-engine
17
17
 
18
18
  | Make the project in edit mode
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [project]
8
8
  name = "rfserver" # package name same as project name
9
- version = "1.0.1"
9
+ version = "1.0.2"
10
10
  description = "RF Analysis Engine"
11
11
  authors = [
12
12
  {name="Iso"},
@@ -16,8 +16,8 @@ maintainers = [{name="Iso"}, {name="Alan"}] # must be an object
16
16
  license = "AGPL-3.0-only"
17
17
  readme = {file = "README.rst", content-type = "text/x-rst"}
18
18
 
19
- homepage = "https://github.com/alanmehio/rf-analysis-engine"
20
- repository = "https://github.com/alanmehio/rf-analysis-engine"
19
+ homepage = "https://github.com/alan-techdev/rf-analysis-engine"
20
+ repository = "https://github.com/alan-techdev/rf-analysis-engine"
21
21
  documentation = "https://rf-analysis-engine.readthedocs.io/"
22
22
 
23
23
  keywords = [
@@ -48,11 +48,11 @@ classifiers = [
48
48
 
49
49
 
50
50
  # PyPi url links, that appear in 'Project Links' section
51
- urls."Bug Tracker" = "https://github.com/alanmehio/rf-analysis-engine/issues"
52
- urls."CI: Github Actions" = "https://github.com/alanmehio/rf-analysis-engine/actions"
51
+ urls."Bug Tracker" = "https://github.com/alan-techdev/rf-analysis-engine/issues"
52
+ urls."CI: Github Actions" = "https://github.com/alan-techdev/rf-analysis-engine/actions"
53
53
  urls.Documentation = "https://rf-analysis-engine.readthedocs.io/"
54
- urls."Source Code" = "https://github.com/alanmehio/rf-analysis-engine"
55
- urls.Changelog = "https://github.com/alanmehio/rf-analysis-engine/blob/master/CHANGELOG.rst"
54
+ urls."Source Code" = "https://github.com/alan-techdev/rf-analysis-engine"
55
+ urls.Changelog = "https://github.com/alan-techdev/rf-analysis-engine/blob/master/CHANGELOG.rst"
56
56
 
57
57
 
58
58
 
@@ -65,7 +65,7 @@ dependencies = [
65
65
 
66
66
  ## optional dependency for test or other purpose
67
67
  ## Install in edit mode with the test dependencies
68
- ## $ pip install -e . rfserver[test]
68
+ ## $ pip install -e . [test]
69
69
  [project.optional-dependencies]
70
70
  test = [
71
71
  "pytest (>=8.4.0); python_version >='3.9' and python_version <='3.14'",
@@ -131,32 +131,16 @@ rfserver = 'rfserver.main:main'
131
131
  # CONFIG PLACE
132
132
  ##############
133
133
 
134
- # see https://black.readthedocs.io/en/stable/ code format with max line 95
135
- [tool.black]
136
- line-length = 95
137
- include = '\.pyi?$'
138
- extend-exclude = '''
139
- '''
140
-
141
- # see https://pycqa.github.io/isort/index.html arrange the import in right order
142
- [tool.isort]
143
- profile = 'black'
144
-
145
- # see https://bandit.readthedocs.io/en/latest/ check for security volubility
146
- # Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
147
- # Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
148
- [tool.bandit]
149
- tests = []
150
- skips = [
151
- "B101", # This plugin test checks for the use of the Python assert keyword. https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
152
- "B311" # https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html
153
- ]
134
+ # RUFF is a fast Python linter, written in Rust.
135
+ # It can be used as a replacement for Flake8, Pyflakes, pycodestyle, and other linters.
136
+ # It also includes some additional checks and features that are not available in those tools.
137
+ # https://docs.astral.sh/ruff/configuration/
138
+ # $ ruff check
154
139
 
155
- # RUFF covers the above so repeat is done again in one place
156
- # Linting and formatting with Ruff
157
- # see https://docs.astral.sh/ruff/configuration/
158
140
  [tool.ruff]
159
- #target-version = "py312"
141
+ target-version = "py310"
142
+ src = ["src/rfserver", "tests"]
143
+ exclude = ["docs/", "scripts"]
160
144
 
161
145
  [tool.ruff.lint]
162
146
  select = [
@@ -174,13 +158,77 @@ ignore = [
174
158
  "B008", # do not perform function calls in argument defaults
175
159
  "W191", # indentation contains tabs
176
160
  "B904", # Allow raising exceptions without from e, for HTTPException
177
- "W291", # Trailing whitespace
178
161
  "E101", # Indentation contains mixed spaces and tabs
179
162
  "W293", # Blank line contains whitespace
180
163
  ]
181
164
 
165
+ [tool.ruff.lint.isort]
166
+ known-first-party = ["rfnode"]
167
+
168
+ [tool.ruff.format]
169
+ # Use black-compatible formatting
170
+ quote-style = "double"
171
+ indent-style = "space"
172
+
173
+ [tool.ruff.lint.pydocstyle]
174
+ convention = "google"
175
+
176
+
177
+ #*********************************************************************
178
+ # mypy configuration moved from mypy.ini to pyproject.toml
179
+ # config file doc:https://mypy.readthedocs.io/en/stable/config_file.html
180
+ # $ mypy ./src/rfnode
181
+ #**********************************************************************
182
+ [tool.mypy]
183
+ # Global options:
184
+ warn_return_any = true
185
+ warn_unused_configs = true
186
+
187
+ # mypy per-module options:
188
+ [[tool.mypy.overrides]]
189
+ module = "rfnode.*"
190
+ disallow_untyped_defs = true
191
+
192
+
193
+ #*********************************************************************
194
+ # Pytest configuration moved from pytest.ini to pyproject.toml
195
+ # config file doc:https://docs.pytest.org/en/stable/reference/customize.html
196
+ # $ pytest
197
+ #**********************************************************************
198
+ [tool.pytest]
199
+ minversion = "9.0"
200
+ addopts = ["--strict-markers"]
201
+ pythonpath=["src"]
202
+ testpaths = ["tests"]
203
+
204
+
205
+ #*********************************************************************
206
+ # Test Coverage configuration moved from .coveragerc to pyproject.toml
207
+ # config file doc:https://coverage.readthedocs.io/en/7.15.4/config.html
208
+ #**********************************************************************
209
+ # $ coverage run -m pytest
210
+ [tool.coverage.run]
211
+ source = ["src/rfnode"]
212
+ parallel = true
213
+ # branch is the if else statement
214
+ branch = true
215
+
216
+ [tool.coverage.report]
217
+ fail_under=30 # threshold for test coverage, if below this number the test will fail
218
+ skip_covered = false
219
+ show_missing = true
220
+ precision = 2
221
+ omit = [
222
+ "tests/*",
223
+ "*/__init__.py"
224
+ ]
225
+
226
+ exclude_lines = [
227
+ "raise NotImplementedError",
228
+ "raise NotImplemented"
229
+ ]
230
+ ignore_errors = false
231
+
182
232
 
183
- # see scripts/parse_version.py
184
- # we need to update in toml file above and below also
185
- [tool.software-release]
186
- version_variable = "src/rfserver/__init__.py:__version__"
233
+ [tool.coverage.html]
234
+ directory = "coverage_html_report"
@@ -0,0 +1,7 @@
1
+
2
+ from .__version__ import __author__ as __author__
3
+ from .__version__ import __description__ as __description__
4
+ from .__version__ import __license__ as __license__
5
+ from .__version__ import __title__ as __title__
6
+ from .__version__ import __url__ as __url__
7
+ from .__version__ import __version__ as __version__
@@ -0,0 +1,10 @@
1
+ """
2
+ Application version
3
+ Application Summary
4
+ """
5
+ __title__ = "RFC Server"
6
+ __description__ = "Radio Frequency Surveillance Server"
7
+ __url__ = "https://rf-analysis-engine.readthedocs.io/en/latest/"
8
+ __version__ = "1.0.2"
9
+ __author__ = "Alan M - Iso H"
10
+ __license__ = "AGPL-3.0-only"
@@ -0,0 +1,77 @@
1
+ """Module containing bug report helper(s)."""
2
+
3
+ import json
4
+ import platform
5
+ import sys
6
+ from typing import Any
7
+
8
+ from . import __version__ as rfserver_version
9
+
10
+
11
+ def _implementation() -> Any:
12
+ """Return a dict with the Python implementation and version.
13
+
14
+ Provide both the name and the version of the Python implementation
15
+ currently running. For example, on CPython 3.10.3 it will return
16
+ {'name': 'CPython', 'version': '3.10.3'}.
17
+
18
+ This function works best on CPython and PyPy: in particular, it probably
19
+ doesn't work for Jython or IronPython. Future investigation should be done
20
+ to work out the correct shape of the code for those platforms.
21
+ """
22
+ implementation = platform.python_implementation()
23
+
24
+ if implementation == "CPython":
25
+ implementation_version = platform.python_version()
26
+ elif implementation == "PyPy":
27
+ pypy = sys.pypy_version_info # type: ignore[attr-defined]
28
+ implementation_version = f"{pypy.major}.{pypy.minor}.{pypy.micro}" # pyright: ignore[reportUnknownMemberType]
29
+ if sys.pypy_version_info.releaselevel != "final": # type: ignore[attr-defined]
30
+ implementation_version = "".join(
31
+ [implementation_version, sys.pypy_version_info.releaselevel] # type: ignore[attr-defined]
32
+ )
33
+ elif implementation == "Jython":
34
+ implementation_version = platform.python_version() # Complete Guess
35
+ elif implementation == "IronPython":
36
+ implementation_version = platform.python_version() # Complete Guess
37
+ else:
38
+ implementation_version = "Unknown"
39
+
40
+ return {"name": implementation, "version": implementation_version}
41
+
42
+
43
+ def info() -> dict[str, Any]:
44
+ """Generate information for a bug report."""
45
+ try:
46
+ platform_info = {
47
+ "system": platform.system(),
48
+ "release": platform.release(),
49
+ }
50
+ except OSError:
51
+ platform_info = {
52
+ "system": "Unknown",
53
+ "release": "Unknown",
54
+ }
55
+
56
+ implementation_info = _implementation()
57
+ rfserver_info = {"version": rfserver_version}
58
+
59
+
60
+
61
+
62
+ return {
63
+ "platform": platform_info,
64
+ "implementation": implementation_info,
65
+ "rfserver": {
66
+ "version": rfserver_info,
67
+ },
68
+ }
69
+
70
+
71
+ def bug_reporting() -> None:
72
+ """Pretty-print the bug information as JSON."""
73
+ print(json.dumps(info(), sort_keys=True, indent=2))
74
+
75
+
76
+ if __name__ == "__main__":
77
+ bug_reporting()
@@ -1,7 +1,7 @@
1
1
  """
2
2
  Database creator.
3
3
 
4
- This script creates the database on the user's local machine at its (script's) location.
4
+ This script creates the database on the user's local machine at its (script's) location.
5
5
  It checks if the database exists before creating a new one.
6
6
 
7
7
  Also, populates the database with dummy data that were captured from a real device.
@@ -0,0 +1,117 @@
1
+ from argparse import ArgumentParser, Namespace
2
+
3
+ from rfserver import (
4
+ __author__, # type:ignore
5
+ __description__, # type:ignore
6
+ __license__, # type:ignore
7
+ __title__, # type:ignore
8
+ __url__, # type:ignore
9
+ __version__, # type:ignore
10
+ )
11
+ from rfserver._help import bug_reporting
12
+ from rfserver.rest_api import rest
13
+
14
+ """
15
+ A- Make the project in edit mode
16
+ $ pwd
17
+ /home/alan/workspace-python/RTL-SDR/rf-surveillance
18
+ $ pip install -e .
19
+ $ rfnode setting.json -vvv -ld /home/alan/tmp
20
+
21
+ //////////////////////////////////////////
22
+
23
+ B- Using PYTHONPATH (Not recommended)
24
+ Linux:
25
+ =====
26
+ $ export PYTHONPATH=/home/alan/workspace-python/RTL-SDR/rf-surveillance/src
27
+ $ pwd
28
+ /home/alan/workspace-python/RTL-SDR/rf-surveillance/src
29
+ $ python rfnode setting.json -vvv -ld /home/alan/tmp
30
+
31
+ Windows:
32
+ ========
33
+ set PYTHONPATH=/home/alan/workspace-python/RTL-SDR/rf-surveillance/src
34
+ echo %PYTHONPATH%
35
+ python rfnode setting.json -vvv -ld /home/alan/tmp
36
+ Note: Check the devicemanager from the control panel for the port name
37
+ """
38
+
39
+
40
+ def main() -> None:
41
+ """
42
+ The main function is called only when the script is executed directly,
43
+ Execute data acquisition system using RTL-SDR devices.
44
+ It initializes a logging manager and configures it based on command-line arguments, responsible
45
+ for managing data flow between different components of the system.
46
+
47
+
48
+ """
49
+ # https://docs.python.org/3/howto/argparse.html
50
+ parser = ArgumentParser(
51
+ prog = "rfserver",
52
+ usage="rfserver [-h] [-ld dir] [-v] [--version] [--author] [--report-bug] [--description] [--license] [--title] [--url]",
53
+ description=" The server for Radio Frequency Scanner which capture given power threshold"
54
+ )
55
+
56
+ parser.add_argument(
57
+ "-ld",
58
+ "--log_directory",
59
+ help="store output log in a directory",
60
+ type=str,
61
+ metavar="dir",
62
+ )
63
+ parser.add_argument("-v",
64
+ "--verbose", help="increase output verbosity.Default to Error if not supplied, 40 is Debug", type=int, metavar="", default=0)
65
+
66
+ parser.add_argument("--version", action="store_true", help="Display current library version")
67
+ parser.add_argument("--author", action="store_true", help="Display author information")
68
+ parser.add_argument("--report-bug", action="store_true", help="Library detail information to report a bug")
69
+ parser.add_argument("--description", action="store_true", help="Display description of the package")
70
+ parser.add_argument("--license", action="store_true", help="Display license information")
71
+ parser.add_argument("--title", action="store_true", help="Display title of the package")
72
+ parser.add_argument("--url", action="store_true", help="Display read the docs url of the package")
73
+
74
+ args: Namespace = parser.parse_args()
75
+
76
+ if args.version:
77
+ print(f"Version: {__version__}")
78
+ return
79
+
80
+ if args.author:
81
+ print(f"Author: {__author__}")
82
+ return
83
+
84
+ if args.report_bug:
85
+ bug_reporting()
86
+ return
87
+
88
+ if args.description:
89
+ print(f"Description: {__description__}")
90
+ return
91
+
92
+ if args.license:
93
+ print(f"License: {__license__}")
94
+ return
95
+
96
+ if args.title:
97
+ print(f"Title: {__title__}")
98
+ return
99
+
100
+ if args.url:
101
+ print(f"URL: {__url__}")
102
+ return
103
+
104
+ rest.app.run()
105
+
106
+
107
+ if __name__ == "__main__":
108
+ main()
109
+
110
+ """
111
+ Steps:
112
+ >>> pwd
113
+ >>> python -m venv .venv
114
+ >>> source ./venv/bin/activate
115
+ >>> pip install -e .
116
+ >>> rfserver
117
+ """
@@ -18,7 +18,7 @@ app = Flask(__name__)
18
18
  methods=["GET"],
19
19
  )
20
20
  def search(
21
- min_power, max_power, min_frequency, max_frequency
21
+ min_power: float, max_power: float, min_frequency: float, max_frequency: float
22
22
  ) -> list[tuple[int, float, float, str]]:
23
23
  """Search API endpoint.
24
24
 
@@ -49,7 +49,7 @@ def search(
49
49
  (91, 104.3, 20.18, '06-06-2025 12:16:18')
50
50
  ]
51
51
  """
52
- result = DetailDataBaseManager.search_power_frequency(
52
+ result:list[tuple[int, float, float, str]] = DetailDataBaseManager.search_power_frequency(
53
53
  min_power, max_power, min_frequency, max_frequency
54
54
  )
55
55
  return result
@@ -1,7 +0,0 @@
1
-
2
- __version__ = "1.0.1"
3
-
4
- __all__ = (
5
- "__version__",
6
- "main",
7
- )
@@ -1,18 +0,0 @@
1
- from rfserver.rest_api import rest
2
-
3
-
4
- def main() -> None:
5
- rest.app.run()
6
-
7
-
8
- if __name__ == "__main__":
9
- main()
10
-
11
- """
12
- Steps:
13
- >>> pwd
14
- >>> python -m venv .venv
15
- >>> source ./venv/bin/activate
16
- >>> pip install -e .
17
- >>> rfserver
18
- """
File without changes
File without changes
File without changes
File without changes