conn
Functions
Initialize and return an ArcGIS Online GIS connection using credentials. |
|
Initialize and return a HART API connection tuple (URL, HTTPBasicAuth). |
|
Initialize and return a HBSMR API connection response. |
|
Initialize and return an EmailMsal connection object. |
|
Initialize and return an ArcGIS GIS connection using a token. |
|
Initialize and return a VaultCipher instance for encryption/decryption. |
- agol(url, user, password, debug=False)
Initialize and return an ArcGIS Online GIS connection using credentials.
- Parameters:
Caution
SECURITY WARNING: This method currently disables SSL certificate verification (
verify_cert=False) by default. This makes the connection vulnerable to Man-in-the-Middle (MitM) attacks. Please ensure you are connecting over a trusted network or manually provide a certificate bundle in your own implementation if higher security is required.from ntsm.conn import agol gis = agol(url="https://nt.maps.arcgis.com", user="username", password="password", debug=True)
- Return type:
- Returns:
An authenticated AGOL GIS object if successful, otherwise
None.
- hart(url, user, password, debug=False)
Initialize and return a HART API connection tuple (URL, HTTPBasicAuth).
- Parameters:
from ntsm.conn import hart import requests url, auth = hart(url="API_URL", user="user", password="pwd") response = requests.get(url, auth=auth)
- Return type:
- Returns:
Tuple of
(api_url, auth_object)if successful, otherwiseNone.
- hbsmr(url, user, password, debug=False)
Initialize and return a HBSMR API connection response.
- Parameters:
from ntsm.conn import hbsmr resp = hbsmr(url="API_URL", user="user", password="pwd") if resp: data = resp.json()
- Return type:
- Returns:
The response object from the HBSMR API if successful, otherwise
None.
- msal(tenant_id, client_id, client_email, client_secret, debug=False)
Initialize and return an EmailMsal connection object.
- Parameters:
from ntsm.conn import msal mail = msal(tenant_id="...", client_id="...", client_email="...", client_secret="...") mail.send(to="test@example.com", subject="Hello", body="Test")
- Return type:
- Returns:
An authenticated
EmailMsalinstance if successful, otherwiseNone.
- token(token, debug=False)
Initialize and return an ArcGIS GIS connection using a token.
- Parameters:
from ntsm.conn import token gis = token(token="YOUR_ARCGIS_TOKEN", debug=True)
- Return type:
- Returns:
An authenticated GIS object if successful, otherwise
None.
- vault(key_file=None, key_env=None)
Initialize and return a VaultCipher instance for encryption/decryption.
Sets up a secure vault using either a physical master key file or an environment variable.
- Parameters:
from ntsm.conn import vault # via environment variable v = vault(key_env="GIS_KEY") # OR via local file v = vault(key_file="C:/keys/prod.key")
- Return type:
- Returns:
An instance of VaultCipher.