Metadata-Version: 2.4
Name: tsdk-git
Version: 5.3.4
Summary: Telecom System Development Kit
Home-page: https://github.com/alirazaanis/tsdk-git
Author: Ali Raza Anis
Author-email: alirazaanis@gmail.com
License: ATEC
Project-URL: Homepage, https://github.com/alirazaanis/tsdk-git
Project-URL: PyPI, https://pypi.org/project/tsdk-git/
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Telecommunications Industry
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: System :: Networking
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.5.1
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pyodbc>=4.0.34
Requires-Dist: SQLAlchemy>=1.4.42
Requires-Dist: StrEnum>=0.4.8
Requires-Dist: numpy>=1.23.4
Requires-Dist: paramiko>=2.0.2
Requires-Dist: paramiko-expect>=0.3.4
Requires-Dist: APScheduler>=3.9.1
Requires-Dist: openpyxl>=3.0.10
Requires-Dist: XlsxWriter>=3.0.3
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# tsdk-git





## Install


```
pip install tsdk-git
```



## Usage


### Copy database example


```
from tsdk import DbConfig, OdbcDrivers, copy_data

source = DbConfig(OdbcDrivers.SQLite, "", "database1.db", "", "", False)
destination = DbConfig(OdbcDrivers.MicrosoftSQLServer, "localhost", "database2", "uid", "pwd", False)
copy_data(source, destination)
```


### Server object example


#### Set TsdkServer configuration


```
s = TsdkServer()
s.set_configuration(OdbcDrivers.MicrosoftSQLServer, "localhost", "tsdk", "", "", True)
```


#### Save configuration


Save to custom file


```
s.save_configuration("conf_test.json")
```


Save to default file


```
s.save_configuration()
```


#### Setup TsdkServer System Tables


Safely call this function for the first time,
Should be used with care, it will delete exsisting system tables


```
s.setup_database()
```


#### Export/Import System Tables


Find sample system tables in release v1.0.0 Assets


Export system tables to Excel file


Call setup_database before exporting system tables for the first time


```
s.export_system_tables(r"c:/users/ali/desktop/tsdk_system_tables.xlsx")
```


Import system tables from Excel file,


Should be used with care, it will overwrite existing system tables


```
s.import_system_tables(r"c:/users/ali/desktop/tsdk_system_tables.xlsx")
```


#### Execute SQL statement on SQL server


```
s.execute_sql("select * from table")
```


#### Load database table to dataframe


return tuple df, err


```
df, err = s.sql_to_dataframe("select * from table")
```


#### Load dataframe to database table


```
s.dataframe_to_db(df, "table_name", index=False)
```


#### Load Excel file with multiple sheets to database tables,


Sheet names will be used as table name


```
s.load_all_excel_sheets_to_db(excel_file)
```


#### Load Excel sheet to database table


```
s.load_excel_sheet_to_db(excel_file, sheet_name)
```


#### Load CSV file to database table


```
s.load_csv_to_db(csv_file, table_name)
```


#### Run Audit


```
nr_basic_audit_v2()
```


#### Run Scheduler


```
df, err = s.sql_to_dataframe("SELECT * FROM scheduler")
sch = TsdkScheduler(jobs_df=df)
sch.start()
```
