PyONDE 0.1.2__py3-none-any.whl
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.
- PyONDE/__init__.py +52 -0
- PyONDE/_version.py +24 -0
- PyONDE/bin/__init__.py +0 -0
- PyONDE/onde.py +3827 -0
- PyONDE/onde_versions/ONDE_fields_v0.9.1pre.csv +202 -0
- pyonde-0.1.2.dist-info/METADATA +46 -0
- pyonde-0.1.2.dist-info/RECORD +10 -0
- pyonde-0.1.2.dist-info/WHEEL +5 -0
- pyonde-0.1.2.dist-info/licenses/LICENSE.txt +202 -0
- pyonde-0.1.2.dist-info/top_level.txt +1 -0
PyONDE/__init__.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import os.path
|
|
4
|
+
|
|
5
|
+
from .onde import (ONDEAccessoryClass,
|
|
6
|
+
ONDEArray,
|
|
7
|
+
ONDEBase,
|
|
8
|
+
ONDEClass,
|
|
9
|
+
ONDEClassDefinitions,
|
|
10
|
+
ONDEClassInstanceWrapper,
|
|
11
|
+
ONDEDatasetFile,
|
|
12
|
+
ONDEDatasetFileGraph,
|
|
13
|
+
ONDEField,
|
|
14
|
+
ONDEFile,
|
|
15
|
+
ONDEFileGraph,
|
|
16
|
+
ONDEFileGraphSnapshot,
|
|
17
|
+
ONDEFileObject,
|
|
18
|
+
ONDEObject,
|
|
19
|
+
ONDEOpScope,
|
|
20
|
+
ONDEPath,
|
|
21
|
+
ONDEProxy,
|
|
22
|
+
ONDEReferenceArray,
|
|
23
|
+
ONDETransaction,
|
|
24
|
+
ONDEValue)
|
|
25
|
+
|
|
26
|
+
class dummy(object):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
pkgpath = sys.modules[dummy.__module__].__file__
|
|
31
|
+
pkgdir=os.path.split(pkgpath)[0]
|
|
32
|
+
|
|
33
|
+
onde_versions_path = os.path.join(pkgdir,"onde_versions")
|
|
34
|
+
|
|
35
|
+
def generate_onde_uuid(vendor_name,equip_serial,timestamp,suffix):
|
|
36
|
+
"""Generate and return an ONDE UUID string beginning with "2.25.".
|
|
37
|
+
If you have no way to extract an equipment serial number, suggest using the python UUID module str(uuid.getnode()) to use ethernet hardware interface information in its place. timestamp can come from datetime.now() and suffix should distinguish between multiple datasets that might have the same timestamp."""
|
|
38
|
+
unique_string = f"{vendor_name:s} {equip_serial:s} {timestamp.year:d} {timestamp.month:d} {timestamp.day:d} {timestamp.hour:d} {timestamp.minute:d} {timestamp.second:d} {timestamp.microsecond:d} {suffix:s}"
|
|
39
|
+
py_major = sys.version_info.major
|
|
40
|
+
py_minor = sys.version_info.minor
|
|
41
|
+
hl_kwargs = {}
|
|
42
|
+
if py_major > 3 or py_minor >= 9 :
|
|
43
|
+
hl_kwargs["usedforsecurity"] = False
|
|
44
|
+
pass
|
|
45
|
+
import hashlib
|
|
46
|
+
m = hashlib.sha256(**hl_kwargs)
|
|
47
|
+
m.update(unique_string.encode("utf8"))
|
|
48
|
+
digest256 = m.digest()
|
|
49
|
+
assert(len(digest256) == 32)
|
|
50
|
+
digest128 = digest256[16:]
|
|
51
|
+
int128 = int.from_bytes(digest128,signed = False)
|
|
52
|
+
return f"2.25.{int128:d}"
|
PyONDE/_version.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.1.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 2)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'gf408d6c9c'
|
PyONDE/bin/__init__.py
ADDED
|
File without changes
|