midas-civil 1.0.2__py3-none-any.whl → 1.0.3__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.

Potentially problematic release.


This version of midas-civil might be problematic. Click here for more details.

midas_civil/__init__.py CHANGED
@@ -1,3 +1,21 @@
1
+ import requests
2
+ _version_ = "1.0.3"
3
+
4
+
5
+ print('')
6
+ print('*'*20,' MIDAS CIVIL-NX PYTHON LIBRARY v',_version_,' 🐍 ','*'*20)
7
+ print('')
8
+
9
+ resp = requests.get("https://pypi.org/pypi/midas_civil/json").json()
10
+ latest_ver = resp["info"]["version"]
11
+ if _version_ != latest_ver:
12
+ print(
13
+ f"⚠️ Warning: You are using v{_version_}, "
14
+ f"but the latest available version is v{latest_ver}.\n"
15
+ f" Run 'pip install midas_civil --upgrade' to update."
16
+ )
17
+ print("-"*85)
18
+
1
19
  from ._mapi import *
2
20
  from ._model import *
3
21
  from ._boundary import *
@@ -23,9 +41,3 @@ from ._view import *
23
41
  from ._movingload import*
24
42
  from ._settlement import*
25
43
 
26
-
27
-
28
- print('')
29
- print('*'*20,' MIDAS CIVIL-NX PYTHON LIBRARY v1.0.2 🐍 ','*'*20)
30
- print('')
31
-
midas_civil/_mapi.py CHANGED
@@ -15,7 +15,7 @@ class MAPI_COUNTRY:
15
15
 
16
16
  country = "US"
17
17
 
18
- def __init__(self,country:str):
18
+ def __init__(self,country:str="US"):
19
19
  ''' Define Civil NX country to automatically set Base URL and MAPI Key from registry.
20
20
  ```
21
21
  MAPI_COUNTRY('US') # For english version
@@ -35,7 +35,7 @@ class MAPI_COUNTRY:
35
35
  class MAPI_BASEURL:
36
36
  baseURL = "https://moa-engineers.midasit.com:443/civil"
37
37
 
38
- def __init__(self, baseURL:str):
38
+ def __init__(self, baseURL:str = "https://moa-engineers.midasit.com:443/civil"):
39
39
  ''' Define the Base URL for API connection.
40
40
  ```
41
41
  MAPI_BASEURL('https://moa-engineers.midasit.com:443/civil')
@@ -81,13 +81,15 @@ class MAPI_KEY:
81
81
  registry_key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, key_path, 0, winreg.KEY_READ)
82
82
  value = winreg.QueryValueEx(registry_key, "Key")
83
83
  my_key = value[0]
84
- print(f' 🔑 MAPI-KEY is taken from Registry entry. >> {my_key[:35]}...')
85
84
  MAPI_KEY(my_key)
85
+ print(f' 🔑 MAPI-KEY is taken from Registry entry. >> {my_key[:35]}...')
86
+ print("-"*85)
86
87
  except:
87
88
  print(f"🔑 MAPI KEY is not defined. Click on Apps > API Settings to copy the MAPI Key.\n Define it using MAPI_KEY('xxxx')")
88
89
  sys.exit(0)
89
90
  else:
90
91
  my_key = MAPI_KEY.data
92
+
91
93
  return my_key
92
94
  #---------------------------------------------------------------------------------------------------------------
93
95
 
@@ -141,4 +143,11 @@ def _setUNIT(unitJS):
141
143
  "1" : unitJS
142
144
  }
143
145
  }
144
- MidasAPI('PUT','/db/UNIT',js)
146
+ MidasAPI('PUT','/db/UNIT',js)
147
+
148
+
149
+
150
+ resp = MidasAPI('GET','/config/ver',{})['VER']
151
+ print(f"Connected to {resp["NAME"]} 🟢")
152
+ print(f"USER : {resp["USER"]} | COMPANY : {resp["COMPANY"]}")
153
+ print("-"*85)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Python library for MIDAS Civil NX
5
5
  Home-page: https://github.com/MIDASIT-Co-Ltd/midas-civil-python
6
6
  Author: Sumit Shekhar
@@ -1,11 +1,11 @@
1
- midas_civil/__init__.py,sha256=FLQxclh4avM2ich9ZhAxFcFLM1fVCGKlFjVNnwW9B2o,581
1
+ midas_civil/__init__.py,sha256=cNRskckAnVa-yPS6WsAoT7rEPldE1XyuNljYmCSKg-c,997
2
2
  midas_civil/_boundary.py,sha256=s5mgZIc1b0-P7AdWuaPAQ5cIbHL5CR1YRKJA7KE4W_U,32958
3
3
  midas_civil/_construction.py,sha256=q9C3gGdvky5t7jCDzd6lBRv6pm8cMycI91xfkgDV37Y,40673
4
4
  midas_civil/_construction_backup.py,sha256=Pj7V-NYCkkT-aMjKXfs1jKa9klsGh48UXDLwn3BLYTY,18225
5
5
  midas_civil/_element.py,sha256=O6PBn5yWI_EFpHpCMOVoo8zsA5fup1pwdY058LSc0pY,30411
6
6
  midas_civil/_group.py,sha256=Go4If-cwdKMfIDlNi1MYYq4jPYOa3MlVvNkX2pTkyCs,9864
7
7
  midas_civil/_load.py,sha256=TltWAjDaeC5MNW8IIPKgpLahDQgJR3J6SzinkCrJS7A,30171
8
- midas_civil/_mapi.py,sha256=SnX16e19jAuFEc7W_95FtY7aadfmdkgVxZie6hkgyEY,4867
8
+ midas_civil/_mapi.py,sha256=b6-ZRUMLvOedhdgIfzW3byG9hXjEdqJetAwayJWGtKc,5136
9
9
  midas_civil/_material.py,sha256=uJEIHJM9OhwTRWUI2mtd_0BQSxdlYhATYJu9P7tNNBA,69511
10
10
  midas_civil/_model.py,sha256=I7lzMsOhqWcDcBYtPSqBUs97sBEf5M1mJ0KLftyGGB4,16597
11
11
  midas_civil/_movingload.py,sha256=kzTbi4vFjOnUYOyhDDTmSHFU-sDGb_MgMBNXUmFmUZc,80001
@@ -20,8 +20,8 @@ midas_civil/_tendon.py,sha256=mXNJeLikFsBpgn8u9fED2qx9oqnKh3XtIpYwp3moEfk,33395
20
20
  midas_civil/_thickness.py,sha256=4xQsLA3Q_gIGCwLc_glFmiErdWdQUSwhlEhJ_IPJseA,3248
21
21
  midas_civil/_utils.py,sha256=GR9cj-mgRPmtwmgqEj4JeEjMlRS6zmvhcxFV5IHbpRk,2708
22
22
  midas_civil/_view.py,sha256=o7rkfoQzmgAb3dT0ujPIQLVwVlveo3rMRIbZU1UosZo,849
23
- midas_civil-1.0.2.dist-info/licenses/LICENSE,sha256=zrL4RwZC4rb-by_ZHKXwKdIwcs6ATy59TPZ9HxPHCrs,1071
24
- midas_civil-1.0.2.dist-info/METADATA,sha256=25Lm__RTdXyuo2Gwkgm3Qp4snPVKVP-CMHqpHgd1fLI,2085
25
- midas_civil-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- midas_civil-1.0.2.dist-info/top_level.txt,sha256=_NFmrlN5V9OxJ-PAO4s_om8OA8uupXho3QqZcSsnbuI,12
27
- midas_civil-1.0.2.dist-info/RECORD,,
23
+ midas_civil-1.0.3.dist-info/licenses/LICENSE,sha256=zrL4RwZC4rb-by_ZHKXwKdIwcs6ATy59TPZ9HxPHCrs,1071
24
+ midas_civil-1.0.3.dist-info/METADATA,sha256=eTANjSQcccpH8UvxKCrjExV7olqV30r47d0MaZRh-tM,2085
25
+ midas_civil-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ midas_civil-1.0.3.dist-info/top_level.txt,sha256=_NFmrlN5V9OxJ-PAO4s_om8OA8uupXho3QqZcSsnbuI,12
27
+ midas_civil-1.0.3.dist-info/RECORD,,