ntsm 0.1.3__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.
ntsm-0.1.3/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present Adrian Coman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ntsm-0.1.3/PKG-INFO ADDED
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: ntsm
3
+ Version: 0.1.3
4
+ Summary: GIS Custom Modules package
5
+ Author-email: Adrian Coman <adrian.coman@nationaltrust.org.uk>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024-present Adrian Coman
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/adrian-coman/ntsm
28
+ Project-URL: Issues, https://github.com/adrian-coman/ntsm/issues
29
+ Project-URL: Documentation, https://ntsm.readthedocs.io/en/latest/
30
+ Keywords: ntsm,ntm,nts
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: OS Independent
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Topic :: Software Development :: Build Tools
37
+ Requires-Python: >=3.10
38
+ Description-Content-Type: text/x-rst
39
+ License-File: LICENSE
40
+ Requires-Dist: cryptography>=41.0.0
41
+ Requires-Dist: msal>=1.20.0
42
+ Requires-Dist: requests>=2.28.0
43
+ Requires-Dist: loguru>=0.7.0
44
+ Provides-Extra: docs
45
+ Requires-Dist: sphinx>=5.0.0; extra == "docs"
46
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
47
+ Requires-Dist: sphinx-autodoc-typehints>=1.0.0; extra == "docs"
48
+ Requires-Dist: nbsphinx>=0.8.0; extra == "docs"
49
+ Requires-Dist: sphinx-github-alerts>=1.0.0; extra == "docs"
50
+ Requires-Dist: ipython>=7.0.0; extra == "docs"
51
+ Provides-Extra: dev
52
+ Requires-Dist: twine>=4.0.0; extra == "dev"
53
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
54
+ Dynamic: license-file
55
+
56
+ ========================
57
+ NTSM - Vault & Utilities
58
+ ========================
59
+
60
+ .. image:: https://img.shields.io/pypi/v/ntsm.svg
61
+ :target: https://pypi.org/project/ntsm/
62
+ :alt: PyPI Version
63
+
64
+ .. image:: https://img.shields.io/pypi/pyversions/ntsm.svg
65
+ :target: https://pypi.org/project/ntsm/
66
+ :alt: Supported Python Versions
67
+
68
+ .. image:: https://readthedocs.org/projects/ntsm/badge/?version=latest
69
+ :target: https://ntsm.readthedocs.io/en/latest/?badge=latest
70
+ :alt: Documentation Status
71
+
72
+ .. image:: https://img.shields.io/badge/License-MIT-yellow.svg
73
+ :target: https://opensource.org/licenses/MIT
74
+ :alt: License: MIT
75
+
76
+ .. image:: https://img.shields.io/badge/status-beta-orange.svg
77
+ :target: https://pypi.org/project/ntsm/
78
+ :alt: Project Status: Beta
79
+
80
+ The **NTSM** package serves as a central hub for GIS teams, providing a consistent and secure method for managing sensitive credentials across various platforms. Its primary objective is to eliminate hardcoded secrets and unify the connectivity patterns for frequently used APIs like ArcGIS Online or MSAL.
81
+
82
+ **Disclaimer & Attribution**
83
+ ----------------------------
84
+ This project is an evolved library that incorporates various third-party code snippets and open-source logic. While primary development and architecture are steered by the author(s), many components have been refined, optimized, and adjusted using different AI agents to meet specific production requirements.
85
+
86
+ .. note::
87
+ This package is a **"transition and backward compatibility"** version and not yet a stable release; it should be used with appropriate caution.
88
+
89
+ Key Features
90
+ ------------
91
+ * **Vault Security**: AES-256-GCM encryption with PBKDF2-HMAC-SHA512 key derivation.
92
+ * **Standardized Connections**: Unified interface for ArcGIS, MSAL and more.
93
+ * **Productivity Utilities**: Standardized logging, file handling, archiving, and more.
94
+
95
+ Installation
96
+ ------------
97
+ Install the latest version from PyPI:
98
+
99
+ .. code-block:: bash
100
+
101
+ pip install ntsm
102
+
103
+ Quick Start
104
+ -----------
105
+
106
+ .. code-block:: python
107
+
108
+ from ntsm.conn import vault
109
+ # Initialize vault via environment variable
110
+ v = vault(key_env="GIS_KEY")
111
+
112
+ from ntsm.lib import setup_logging
113
+ logger = setup_logging("my_app", "./logs")
114
+ logger.info("Application started")
115
+
116
+ Module Examples
117
+ ---------------
118
+
119
+ Secure Vault (aeadencrypt)
120
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
121
+ Modern encryption for sensitive data.
122
+
123
+ .. code-block:: python
124
+
125
+ from ntsm.aeadencrypt import VaultCipher
126
+ v = VaultCipher(key_name="MY_KEY")
127
+ encrypted = v.encrypt("secret message")
128
+ decrypted = v.decrypt(encrypted)
129
+
130
+ # Legacy AES-128-CBC
131
+ from ntsm.aeadencrypt import VaultUtils
132
+ enc = VaultUtils.encrypt_text("hello", "secret")
133
+
134
+ Connections (conn)
135
+ ~~~~~~~~~~~~~~~~~~
136
+ Easy access to common services.
137
+
138
+ .. code-block:: python
139
+
140
+ from ntsm.conn import agol, msal
141
+
142
+ # ArcGIS Online
143
+ gis = agol(url="https://nt.maps.arcgis.com", user="u", password="p")
144
+
145
+ # MSAL Email
146
+ mail = msal(tenant_id="...", client_id="...", client_email="...", client_secret="...")
147
+
148
+ Library Utilities (lib)
149
+ ~~~~~~~~~~~~~~~~~~~~~~~
150
+ A wide range of helper functions and classes.
151
+
152
+ .. code-block:: python
153
+
154
+ from ntsm.lib import Files, Archive, FormatTime
155
+
156
+ # File & Folder management
157
+ Files.copy_dir("src", "dst")
158
+ Archive.make_zip("data")
159
+
160
+ # Time helpers
161
+ from datetime import datetime
162
+ t_str = FormatTime.to_str(datetime.now())
163
+
164
+ Package Structure
165
+ -----------------
166
+
167
+ * **ntsm.aeadencrypt**: ``VaultCipher`` (AES-256-GCM), ``VaultUtils`` (Legacy support).
168
+ * **ntsm.conn**: ``vault``, ``agol``, ``token``, ``msal``, and more.
169
+ * **ntsm.lib**: ``Email``, ``Files``, ``Archive``, ``setup_logging``, ``timer_wrap``, and more.
170
+
171
+ Full Documentation
172
+ ------------------
173
+ Access documentation locally or online:
174
+
175
+ .. code-block:: bash
176
+
177
+ # Open the interactive documentation viewer
178
+ ntsmdocs
179
+
180
+ Online documentation is hosted at `Read the Docs <https://ntsm.readthedocs.io/>`_.
181
+
182
+ Contact & Support
183
+ -----------------
184
+ * **Author**: Adrian Coman
185
+ * **Email**: adrian.coman@nationaltrust.org.uk
186
+ * **Project Status**: Transition/Beta
ntsm-0.1.3/README.rst ADDED
@@ -0,0 +1,131 @@
1
+ ========================
2
+ NTSM - Vault & Utilities
3
+ ========================
4
+
5
+ .. image:: https://img.shields.io/pypi/v/ntsm.svg
6
+ :target: https://pypi.org/project/ntsm/
7
+ :alt: PyPI Version
8
+
9
+ .. image:: https://img.shields.io/pypi/pyversions/ntsm.svg
10
+ :target: https://pypi.org/project/ntsm/
11
+ :alt: Supported Python Versions
12
+
13
+ .. image:: https://readthedocs.org/projects/ntsm/badge/?version=latest
14
+ :target: https://ntsm.readthedocs.io/en/latest/?badge=latest
15
+ :alt: Documentation Status
16
+
17
+ .. image:: https://img.shields.io/badge/License-MIT-yellow.svg
18
+ :target: https://opensource.org/licenses/MIT
19
+ :alt: License: MIT
20
+
21
+ .. image:: https://img.shields.io/badge/status-beta-orange.svg
22
+ :target: https://pypi.org/project/ntsm/
23
+ :alt: Project Status: Beta
24
+
25
+ The **NTSM** package serves as a central hub for GIS teams, providing a consistent and secure method for managing sensitive credentials across various platforms. Its primary objective is to eliminate hardcoded secrets and unify the connectivity patterns for frequently used APIs like ArcGIS Online or MSAL.
26
+
27
+ **Disclaimer & Attribution**
28
+ ----------------------------
29
+ This project is an evolved library that incorporates various third-party code snippets and open-source logic. While primary development and architecture are steered by the author(s), many components have been refined, optimized, and adjusted using different AI agents to meet specific production requirements.
30
+
31
+ .. note::
32
+ This package is a **"transition and backward compatibility"** version and not yet a stable release; it should be used with appropriate caution.
33
+
34
+ Key Features
35
+ ------------
36
+ * **Vault Security**: AES-256-GCM encryption with PBKDF2-HMAC-SHA512 key derivation.
37
+ * **Standardized Connections**: Unified interface for ArcGIS, MSAL and more.
38
+ * **Productivity Utilities**: Standardized logging, file handling, archiving, and more.
39
+
40
+ Installation
41
+ ------------
42
+ Install the latest version from PyPI:
43
+
44
+ .. code-block:: bash
45
+
46
+ pip install ntsm
47
+
48
+ Quick Start
49
+ -----------
50
+
51
+ .. code-block:: python
52
+
53
+ from ntsm.conn import vault
54
+ # Initialize vault via environment variable
55
+ v = vault(key_env="GIS_KEY")
56
+
57
+ from ntsm.lib import setup_logging
58
+ logger = setup_logging("my_app", "./logs")
59
+ logger.info("Application started")
60
+
61
+ Module Examples
62
+ ---------------
63
+
64
+ Secure Vault (aeadencrypt)
65
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
66
+ Modern encryption for sensitive data.
67
+
68
+ .. code-block:: python
69
+
70
+ from ntsm.aeadencrypt import VaultCipher
71
+ v = VaultCipher(key_name="MY_KEY")
72
+ encrypted = v.encrypt("secret message")
73
+ decrypted = v.decrypt(encrypted)
74
+
75
+ # Legacy AES-128-CBC
76
+ from ntsm.aeadencrypt import VaultUtils
77
+ enc = VaultUtils.encrypt_text("hello", "secret")
78
+
79
+ Connections (conn)
80
+ ~~~~~~~~~~~~~~~~~~
81
+ Easy access to common services.
82
+
83
+ .. code-block:: python
84
+
85
+ from ntsm.conn import agol, msal
86
+
87
+ # ArcGIS Online
88
+ gis = agol(url="https://nt.maps.arcgis.com", user="u", password="p")
89
+
90
+ # MSAL Email
91
+ mail = msal(tenant_id="...", client_id="...", client_email="...", client_secret="...")
92
+
93
+ Library Utilities (lib)
94
+ ~~~~~~~~~~~~~~~~~~~~~~~
95
+ A wide range of helper functions and classes.
96
+
97
+ .. code-block:: python
98
+
99
+ from ntsm.lib import Files, Archive, FormatTime
100
+
101
+ # File & Folder management
102
+ Files.copy_dir("src", "dst")
103
+ Archive.make_zip("data")
104
+
105
+ # Time helpers
106
+ from datetime import datetime
107
+ t_str = FormatTime.to_str(datetime.now())
108
+
109
+ Package Structure
110
+ -----------------
111
+
112
+ * **ntsm.aeadencrypt**: ``VaultCipher`` (AES-256-GCM), ``VaultUtils`` (Legacy support).
113
+ * **ntsm.conn**: ``vault``, ``agol``, ``token``, ``msal``, and more.
114
+ * **ntsm.lib**: ``Email``, ``Files``, ``Archive``, ``setup_logging``, ``timer_wrap``, and more.
115
+
116
+ Full Documentation
117
+ ------------------
118
+ Access documentation locally or online:
119
+
120
+ .. code-block:: bash
121
+
122
+ # Open the interactive documentation viewer
123
+ ntsmdocs
124
+
125
+ Online documentation is hosted at `Read the Docs <https://ntsm.readthedocs.io/>`_.
126
+
127
+ Contact & Support
128
+ -----------------
129
+ * **Author**: Adrian Coman
130
+ * **Email**: adrian.coman@nationaltrust.org.uk
131
+ * **Project Status**: Transition/Beta
ntsm-0.1.3/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.3
@@ -0,0 +1,59 @@
1
+ [tool.setuptools.packages.find]
2
+ where = ["src"]
3
+ include = ["ntsm*"]
4
+
5
+ [project]
6
+ name = "ntsm"
7
+ description = "GIS Custom Modules package"
8
+ readme = "README.rst"
9
+ requires-python = ">=3.10"
10
+ keywords = ["ntsm", "ntm", "nts"]
11
+ license = { file = "LICENSE" }
12
+ authors = [
13
+ { name = "Adrian Coman", email = "adrian.coman@nationaltrust.org.uk" },
14
+ ]
15
+
16
+ classifiers = [
17
+ 'Development Status :: 4 - Beta',
18
+ 'Intended Audience :: Developers',
19
+ 'License :: OSI Approved :: MIT License',
20
+ 'Operating System :: OS Independent',
21
+ 'Programming Language :: Python :: 3.10',
22
+ 'Topic :: Software Development :: Build Tools',
23
+ ]
24
+
25
+ dependencies = [
26
+ "cryptography>=41.0.0",
27
+ "msal>=1.20.0",
28
+ "requests>=2.28.0",
29
+ "loguru>=0.7.0",
30
+ ]
31
+
32
+ dynamic = ["version"]
33
+
34
+ [project.optional-dependencies]
35
+ docs = [
36
+ "sphinx>=5.0.0",
37
+ "sphinx-rtd-theme>=1.0.0",
38
+ "sphinx-autodoc-typehints>=1.0.0",
39
+ "nbsphinx>=0.8.0",
40
+ "sphinx-github-alerts>=1.0.0",
41
+ "ipython>=7.0.0",
42
+ ]
43
+ dev = ["twine>=4.0.0", "pytest>=7.0.0"]
44
+
45
+
46
+ [tool.setuptools.dynamic]
47
+ version = { file = "VERSION" }
48
+
49
+ [project.urls]
50
+ Homepage = "https://github.com/adrian-coman/ntsm"
51
+ Issues = "https://github.com/adrian-coman/ntsm/issues"
52
+ Documentation = "https://ntsm.readthedocs.io/en/latest/"
53
+
54
+ [project.scripts]
55
+ ntsmdocs = "ntsm._docs:_read"
56
+
57
+ [build-system]
58
+ requires = ["setuptools>=61.0", "wheel"]
59
+ build-backend = "setuptools.build_meta"
ntsm-0.1.3/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ from ntsm import aeadencrypt, lib, conn
2
+
3
+ __all__ = [
4
+ "aeadencrypt",
5
+ "lib",
6
+ "conn",
7
+ ]
@@ -0,0 +1,10 @@
1
+ import webbrowser
2
+
3
+ def _read():
4
+ """Opens the official Read the Docs page."""
5
+ url = "https://ntsm.readthedocs.io/en/latest/"
6
+ print(f"Opening documentation: {url}")
7
+ webbrowser.open(url, new=2)
8
+
9
+ if __name__ == "__main__":
10
+ _read()