Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

task_automation-0.0.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

task_automation-0.0.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file task_automation-0.0.1.tar.gz.

File metadata

  • Download URL: task_automation-0.0.1.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

Hashes for task_automation-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9f46bdd632e2b58cd20722f2af138847cda9484c7cdba357b3e6480a3b07d95d
MD5 1d9ed7f1d225d7f0c876819392559af1
BLAKE2b-256 fdd5fa96a6c545212f23096d18dcaf7965fee7467f7f61712a76bb36196aab3b

See more details on using hashes here.

File details

Details for the file task_automation-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for task_automation-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e05ffce20490cb3dcbe56b6505a33fdad9e72f2397ffca17d39cda932847d53e
MD5 3a15892c31d8221b5c0e3c97d6afae63
BLAKE2b-256 d4b546b978e362cecd3b22f5fe8876e916170a49571431e2c11b154bf1b506b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page