forked from dB-SPL/takprotobuf
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes #7: CoT Time/Start/Stale timestamps aren't actually ISO-8601. - Fixes #8: Add readthedocs documentation site. - Fixes #9: Move setup.py metadata to setup.cfg - Fixes #10: Add additional test targets: Python 3.11 & 3.12
- Loading branch information
Showing
14 changed files
with
186 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ redis-server/ | |
__pycache__ | ||
.ipynb_checkpoints/ | ||
config.ini | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright 2023 Sensors & Signals LLC | ||
Copyright Sensors & Signals LLC https://www.snstac.com | ||
Copyright 2020 Delta Bravo-15 <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# Copyright 2023 Sensors & Signals LLC | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -14,7 +14,7 @@ | |
# limitations under the License. | ||
# | ||
# Author:: Greg Albrecht <[email protected]> | ||
# Copyright:: Copyright 2023 Sensors & Signals LLC | ||
# Copyright:: Copyright Sensors & Signals LLC https://www.snstac.com | ||
# License:: Apache License, Version 2.0 | ||
# | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,7 +174,7 @@ Authors | |
|
||
Copyright | ||
========= | ||
* Copyright 2023 Sensors & Signals LLC | ||
* Copyright Sensors & Signals LLC https://www.snstac.com | ||
* Copyright 2020 Delta Bravo-15 <[email protected]> | ||
|
||
|
||
|
@@ -185,7 +185,7 @@ Python Black, otherwise Google, then PEP-8. | |
|
||
License | ||
======= | ||
Copyright 2023 Sensors & Signals LLC | ||
Copyright Sensors & Signals LLC https://www.snstac.com | ||
|
||
Copyright 2020 Delta Bravo-15 <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
 | ||
|
||
# TAKProto - Python TAK Protocol Module | ||
|
||
TAKProto is a Python module for encoding & decoding TAK Protocol Protobuf packets. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
click | ||
ghp-import | ||
griffe | ||
importlib-metadata | ||
jinja2 | ||
markdown | ||
markdown-include | ||
markupsafe | ||
mergedeep | ||
mkdocs | ||
mkdocs-autorefs | ||
mkdocs-include-markdown-plugin | ||
mkdocs-material | ||
mkdocstrings-python | ||
mkdocstrings[python] | ||
packaging | ||
pymdown-extensions | ||
pyparsing | ||
python-dateutil | ||
pyyaml | ||
pyyaml-env-tag | ||
six | ||
zipp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
site_name: TAKProto - A Python TAK Protocol Protobuf Module | ||
site_url: https://takproto.rtfd.io/ | ||
repo_url: https://github.com/snstac/takproto/ | ||
site_description: A Python module to encode & decode 'TAK Protocol Payload - Version 1' Protocol Buffer based Cursor on Target (CoT) messages. | ||
site_author: Greg Albrecht <[email protected]> | ||
copyright: Copyright Sensors & Signals LLC https://www.snstac.com | ||
|
||
theme: | ||
name: material | ||
highlightjs: true | ||
|
||
plugins: | ||
- include-markdown: | ||
opening_tag: "{!" | ||
closing_tag: "!}" | ||
- search | ||
- mkdocstrings: | ||
handlers: | ||
# See: https://mkdocstrings.github.io/python/usage/ | ||
python: | ||
options: | ||
docstring_style: sphinx | ||
|
||
markdown_extensions: | ||
- markdown_include.include: | ||
base_path: . | ||
- admonition | ||
- toc: | ||
permalink: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Setup for the Python TAK Protocol Packet - Version 1 Module. | ||
# | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# Copyright 2020 Delta Bravo-15 | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
# | ||
|
||
|
||
[metadata] | ||
name = takproto | ||
version = attr: takproto.__version__ | ||
url = https://github.com/snstac/takproto | ||
project_urls = | ||
CI: GitHub Actions = https://github.com/snstac/takproto/actions | ||
GitHub: issues = https://github.com/snstac/takproto/issues | ||
GitHub: repo = https://github.com/snstac/takproto | ||
description = A Python module to encode & decode 'TAK Protocol Payload - Version 1' Protocol Buffer based Cursor on Target (CoT) messages. | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
maintainer = Greg Albrecht <[email protected]> | ||
maintainer_email = [email protected] | ||
license = MIT License | ||
license_files = LICENSE | ||
classifiers = | ||
License :: OSI Approved :: MIT License | ||
Intended Audience :: Developers | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
Programming Language :: Python :: 3.12 | ||
Development Status :: 5 - Production/Stable | ||
Operating System :: POSIX | ||
Operating System :: MacOS :: MacOS X | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: OS Independent | ||
keywords = | ||
Cursor on Target | ||
CoT | ||
ATAK | ||
TAK | ||
WinTAK | ||
iTAK | ||
TAK Server | ||
TAKX | ||
Protobuf | ||
|
||
|
||
[options] | ||
python_requires = >=3.6, <4 | ||
packages = takproto | ||
package_dir = | ||
adsbcot = takproto | ||
install_requires = | ||
protobuf >= 4.21.0 | ||
delimited-protobuf >= 1.0.0 | ||
|
||
|
||
[options.extras_require] | ||
test = | ||
pytest-cov | ||
pylint | ||
flake8 | ||
black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2023 Sensors & Signals LLC | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# Copyright 2020 Delta Bravo-15 | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|
@@ -26,63 +26,10 @@ | |
|
||
"""Setup for the Python TAK Protocol Packet - Version 1 Module. | ||
:license: MIT License | ||
:source: <https://github.com/snstac/takproto> | ||
""" | ||
|
||
import os | ||
import sys | ||
from setuptools import setup | ||
|
||
import setuptools | ||
|
||
__title__ = "takproto" | ||
__version__ = "2.0.0" | ||
__license__ = "MIT License" | ||
|
||
|
||
def publish(): | ||
"""Publish this package to pypi.""" | ||
if sys.argv[-1] == "publish": | ||
os.system("python setup.py sdist") | ||
os.system("twine upload dist/*") | ||
sys.exit() | ||
|
||
|
||
publish() | ||
|
||
|
||
def read_readme(readme_file="README.rst") -> str: | ||
"""Read the contents of the README file for use as a long_description.""" | ||
readme: str = "" | ||
this_directory = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(this_directory, readme_file), encoding="UTF-8") as rmf: | ||
readme = rmf.read() | ||
return readme | ||
|
||
|
||
setuptools.setup( | ||
version=__version__, | ||
name=__title__, | ||
packages=[__title__, f"{__title__}.proto"], | ||
package_dir={__title__: __title__, f"{__title__}.proto":f"{__title__}/proto"}, | ||
url=f"https://github.com/snstac/{__title__}", | ||
description=( | ||
"A Python module to encode & decode 'TAK Protocol Payload - Version 1'" | ||
" Protocol Buffer based Cursor on Target (CoT) messages." | ||
), | ||
author="Greg Albrecht", | ||
author_email="[email protected]", | ||
package_data={"": ["LICENSE"]}, | ||
license="MIT License", | ||
long_description=read_readme(), | ||
long_description_content_type="text/x-rst", | ||
zip_safe=False, | ||
include_package_data=True, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
], | ||
keywords=["Cursor on Target", "ATAK", "TAK", "CoT", "WinTAK", "iTAK"], | ||
install_requires=["protobuf >= 4.21.0", "delimited-protobuf >= 1.0.0"], | ||
) | ||
if __name__ == "__main__": | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2023 Sensors & Signals LLC | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -22,14 +22,16 @@ | |
# SOFTWARE. | ||
# | ||
|
||
"""TAKProto Module. | ||
"""A Python module to encode & decode 'TAK Protocol Payload - Version 1' Protocol Buffer based Cursor on Target (CoT) messages. | ||
:author: Greg Albrecht <[email protected]> | ||
:copyright: Copyright 2023 Sensors & Signals LLC | ||
:copyright: Copyright Sensors & Signals LLC https://www.snstac.com | ||
:license: MIT License | ||
:source: <https://github.com/snstac/takproto> | ||
""" | ||
|
||
__version__ = "2.1.0-beta1" | ||
|
||
from .functions import ( # NOQA | ||
xml2proto, | ||
parse_proto, | ||
|
@@ -40,6 +42,6 @@ | |
from .constants import TAKProtoVer # NOQA | ||
|
||
__author__ = "Greg Albrecht <[email protected]>" | ||
__copyright__ = "Copyright 2023 Sensors & Signals LLC" | ||
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com" | ||
__license__ = "MIT License" | ||
__source__ = "https://github.com/snstac/takproto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2023 Sensors & Signals LLC | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -27,18 +27,20 @@ | |
from enum import Enum | ||
|
||
__author__ = "Greg Albrecht <[email protected]>" | ||
__copyright__ = "Copyright 2023 Sensors & Signals LLC" | ||
__copyright__ = "Copyright Sensors & Signals LLC https://www.snstac.com" | ||
__license__ = "Apache License, Version 2.0" | ||
|
||
|
||
DEFAULT_PROTO_HEADER = bytearray(b"\xbf") | ||
DEFAULT_MESH_HEADER = bytearray(b"\xbf\x01\xbf") | ||
ISO_8601_UTC = "%Y-%m-%dT%H:%M:%S.%fZ" | ||
|
||
W3C_XML_DATETIME: str = "%Y-%m-%dT%H:%M:%S.%fZ" | ||
ISO_8601_UTC = W3C_XML_DATETIME # Issue 7: Not technically correct. | ||
|
||
|
||
class TAKProtoVer(Enum): | ||
"""Enumerator for TAK Protocol Versions.""" | ||
|
||
XML = 0 | ||
MESH = 1 | ||
STREAM = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2023 Sensors & Signals LLC | ||
# Copyright Sensors & Signals LLC https://www.snstac.com | ||
# Copyright 2020 Delta Bravo-15 <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
|