afgutils 1.3.3__tar.gz → 1.4.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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: afgutils
3
- Version: 1.3.3
3
+ Version: 1.4.2
4
4
  Summary: Shared support functions
5
5
  Author: Araz Heydarov
6
6
  Author-email: araz.heydarov@asiafinancegroup.com
@@ -11,7 +11,14 @@ Requires-Dist: pyodbc>=4.0.39
11
11
  Requires-Dist: pywin32>=306
12
12
  Requires-Dist: python-dotenv>=1.0.0
13
13
  Requires-Dist: boto3>=1.27.0
14
- Requires-Dist: pandas>=2.0.3
14
+ Requires-Dist: pandas>=2.1.4
15
15
  Requires-Dist: xmltodict>=0.13.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: description
19
+ Dynamic: license
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
16
23
 
17
24
  Shared support functions
@@ -33,7 +33,7 @@ class DB:
33
33
 
34
34
  if dsn:
35
35
  conn_str = f"DSN={dsn}"
36
- elif prefix and driver and driver and user and password and server and port:
36
+ elif prefix and driver and user and password and server and port:
37
37
  conn_str = (
38
38
  f"DRIVER={driver};"
39
39
  f"DATABASE={database};"
@@ -95,6 +95,26 @@ def clear_mfv(mfv: dict) -> dict:
95
95
  return mfv
96
96
 
97
97
 
98
+ def http_print(content: str | None = None, content_type: str = "text/plain; charset=utf-8", headers: dict[str, str] | None = None) -> \
99
+ None:
100
+ headers_actual={
101
+ "Status": "200 OK"
102
+ ,"Content-Type": content_type
103
+ ,"Cache-Control": "no-store"
104
+ }
105
+
106
+ if headers is not None:
107
+ for key in headers:
108
+ headers_actual[key] = headers[key]
109
+ # Overwrite any default headers if provided in headers dict
110
+
111
+ for key in headers_actual:
112
+ print(key + ": " + headers_actual[key])
113
+
114
+ print("")
115
+ if content is not None: print(content)
116
+
117
+
98
118
  # def get_username()-> str:
99
119
  # conn_repserv = DB.get_connection('repserv')
100
120
  # cursor_repserv = conn_repserv.cursor()
@@ -232,7 +252,7 @@ parse_row_into_object = parse_dict_into_object # added for legacy compatibility
232
252
 
233
253
  class AfgBaseMixin:
234
254
  """
235
- Base extension for all AFG objects; restricts operations on private and callabe attributes.
255
+ Base extension for all AFG objects; restricts operations on private and callable attributes.
236
256
 
237
257
  __str__ ommits private and callable attributes
238
258
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: afgutils
3
- Version: 1.3.3
3
+ Version: 1.4.2
4
4
  Summary: Shared support functions
5
5
  Author: Araz Heydarov
6
6
  Author-email: araz.heydarov@asiafinancegroup.com
@@ -11,7 +11,14 @@ Requires-Dist: pyodbc>=4.0.39
11
11
  Requires-Dist: pywin32>=306
12
12
  Requires-Dist: python-dotenv>=1.0.0
13
13
  Requires-Dist: boto3>=1.27.0
14
- Requires-Dist: pandas>=2.0.3
14
+ Requires-Dist: pandas>=2.1.4
15
15
  Requires-Dist: xmltodict>=0.13.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: description
19
+ Dynamic: license
20
+ Dynamic: requires-dist
21
+ Dynamic: requires-python
22
+ Dynamic: summary
16
23
 
17
24
  Shared support functions
@@ -3,5 +3,5 @@ pyodbc>=4.0.39
3
3
  pywin32>=306
4
4
  python-dotenv>=1.0.0
5
5
  boto3>=1.27.0
6
- pandas>=2.0.3
6
+ pandas>=2.1.4
7
7
  xmltodict>=0.13.0
@@ -1,6 +1,6 @@
1
1
  from setuptools import find_packages, setup
2
2
 
3
- VERSION = "1.3.3"
3
+ VERSION = "1.4.2"
4
4
  DESCRIPTION = "Shared support functions"
5
5
  LONG_DESCRIPTION = "Shared support functions"
6
6
 
@@ -20,7 +20,7 @@ setup(
20
20
  "pywin32>=306",
21
21
  "python-dotenv>=1.0.0",
22
22
  "boto3>=1.27.0",
23
- "pandas>=2.0.3",
23
+ "pandas>=2.1.4",
24
24
  "xmltodict>=0.13.0",
25
25
  ],
26
26
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes