Package contains functions to perform simple task such as FTP transfer, Import to miscrosoft database etc.
Project description
This module contains functions to perform the small tasks such as downloading email attachment, FTP upload and FTP download, importing or appending the csv or txt file to Microsoft SQL server database etc.
Functions
attachment_verification(file_path, files)
Compares size of downloaded file with the file attached to the email.
download_attachment(email_sender, email_subject, files, download_location, received_duration=1,email_folder="Inbox")
Downloads attachments from an email.
csv_to_txt(csvfile,txtfile,delimiter='\t',replace_if_exist=True)
Converts csv file to txt file using delimiter.
ftp_upload_verify(hostname, username, password, ftp_dir, files, filepath,TLS)
Verifies the uploaded file size with original file size.
ftp_upload(hostname, username, password, ftp_dir, files, filepath,TLS=False)
Uploads files to the FTP server and compares the uploaded file size with
original file size.
ftp_download_verify(hostname, username, password, ftp_dir, files, filepath,TLS)
Veryfies the file size of the downloaded file with the original file.
ftp_download(hostname, username, password, ftp_dir, files, filepath,TLS=False)
Downloads files from FTP server and compares the file size of the
downloaded file with the original file.
execute_msql(sql_file, con)
Executes query from '.sql' file.
append_csv_msql(filepath,con,insert_query,has_header=False)
Appends the .CSV file to the existing table
in Microsoft SQL Server database.
append_txt_msql(filepath, con, insert_query,has_header=False,delimiter='|')
Appends the .txt file to the existing table
in Microsoft SQL Server database.
import_csv_msql(filepath,con,create_query,insert_query,has_header)
Imports the .CSV file to the Microsoft SQL Server database.
NOTE: This function will drop the table if already exist and will
create a new one.
import_text_msql(filepath, con, create_query, insert_query, has_header)
Imports .TXT file to the microsoft SQL server database.
NOTE: This function will drop the table if already exist and will
create a new one.
msql_results_to_file(sql_file, output_file, con, save_as='CSV', header=False)
Executes query in .sql file and saves resulting table as 'CSV' or
'TXT'('|' delimited) file.
query_results_to_file(query, output_file, con, save_as="CSV", header=False)
Executes the query and saves the result as 'CSV' or 'TXT'('|' delimited) file.
run_msql(con, query)
Runs SQL query.
send_email(profilename, recipients, CC, subject, email_body, attachments)
Sends email to the recipients, can also send attachments with email.
send_reply(email_sender, email_subject, reply_body, received_duration=1,email_folder="Inbox")
Sends reply(Reply all) to the email.
sftp_file_verify(hostname,port, username, password,ftp_dir,filepath,file)
After upload or download transaction, compares size of the file on
the sftp server with size of the file on the device/network.
sftp_upload(hostname,port, username, password,ftp_dir,filepath,file)
Uploads file to SFTP server.
sftp_download(hostname,port, username, password,ftp_dir,filepath,file)
Downloads file from SFTP server.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file task_automation_test-0.0.2.tar.gz
.
File metadata
- Download URL: task_automation_test-0.0.2.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0acee50d0f4bbd1186d37271364797d35e4dc88031341210921306d228ff6d |
|
MD5 | 6a20d06735161c3c1bf4a94207a62c92 |
|
BLAKE2b-256 | 2f3787dbac74e3d6d50b633de227887ab8720cb60378df4f0e5e9c450ea07aa9 |
File details
Details for the file task_automation_test-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: task_automation_test-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6eaf49236e55e540d59ecb4e46032a4171de58151397e40a87bf0d052a00ddf |
|
MD5 | 78972982001488b8551a6920da8e48ba |
|
BLAKE2b-256 | 52cd169862fd4ba7f2ba74ee9d42b78d64ce168b1f4824b2738b8a3382a8a332 |