sftp-smtp-imap


Namesftp-smtp-imap JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/SUNESHPANDITA/sftp-smtp-imap-package.git
SummaryThis package includes functionality to work with any SFTP, IMAP and SMTP server
upload_time2024-07-11 03:19:44
maintainerNone
docs_urlNone
authorSunesh Pandita
requires_python>=3.9.0
licenseCopyright 2024 @Sunesh Pandita Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ### Package name is SFTP-SMTP-IMAP.

    This package will simplify to work with SFTP, IMAP and SMTP server with the commonly used functionalities.
    This package includes 3 classes (sftp, smtp and imap) to work with.

#### Dependency
     pip install mail-parser==3.15.0
     pip install pysftp==0.2.9

### Class sftp:-
        This class includes all the functions required to work with SFTP server.

        setup_credentials(self, sftp_host, sftp_port, sftp_username, sftp_password, sftp_remote_locatio)
            As a first step, user need to pass SFTP credentials for setting details in variables.

        list_files_directories(self, remote_location, extension, prefix, postfix, within)
            This will give list of files and directories based on criteria passed in
            extension, prefix, postfix and within parameters.

        create_remote_folder(self, remote_location, foldername)
            This function can be used to create a folder on SFTP server.

        delete_remote_folder(self, remote_location, foldername)
            This function can be used to delete a folder on SFTP server.

        rename_remote_folder(self, remote_location, old_foldername, new_foldername)
            This function can be used to rename a folder on SFTP server.

        upload_local_files(self, local_folder, remote_folder, list_of_filenames)
            This function can be used to upload single or list of files on SFTP server.

        download_remote_files(self, remote_folder, local_folder, list_of_filenames)
            This function can be used to download single or list of files from SFTP server to local server/machine.

        rename_remote_file(self, remote_location, old_filename, new_filename)
            This function can be used to rename a file on SFTP server.

        delete_remote_files(self, remote_location, list_of_filenames)
            This function can be used to delete a single or list of files on SFTP server.



### Class smtp:-
        This class includes all the functions required to work with SMTP server.

        setup_credentials(self, smtp_host, smtp_port, smtp_username, smtp_password)
            As a first step, user need to pass SMTP credentials for setting details in variables.

        sendmail_without_attachment(self, TO, CC, BCC, SUBJECT, BODY, FROM_EMAIL)
            Use this function when you want to send email without any attachment.

        sendmail_with_attachment(self, TO, CC, BCC, SUBJECT, BODY, ATTACHMENTS, FROM_EMAIL)
            Use this function when you want to send email with single or multiple attachments.



### Class imap:-
        This class includes all the functions required to work with IMAP server.

        setup_credentials(self, imap_host, imap_port, imap_username, imap_password)
            As a first step, user need to pass IMAP credentials for setting details in variables.

        email_verification(EmailSubject, FromEmail, Messageid, filter_for, prefix, postfix, within)
            Use this function when you want to know the what mail to process from given mail folder.

        download_attachments_only(self, mail_foldername, attachment_folder_location, filter_for="", prefix="", postfix="", within="")
            Use this function when you want to download email attachments only.

        purge_email(self, mail_foldername, list_of_messageid)
            Use this function when you want to delete an email from mail folder.
            Example of mail_foldername can be Inbox, Processed, Sent etc.

        move_emails(self, source_mail_foldername, destination_mail_foldername, list_of_messageid)
            Use this function when you want to delete an email from mail folder.
            Example of source_mail_foldername/destination_mail_foldername can be Inbox, Processed, Sent etc.

        save_email_data_in_xml(self, mail_foldername, xml_folder_location, filter_for="", prefix="", postfix="", within="")
            Use this function when you want to download email details in a XML file.

        save_email_data_in_xml_with_attachment_in_folder(self, mail_foldername, xml_folder_location, attachment_folder_location,filter_for="", prefix="", postfix="", within="")
            Use this function when you want to download email details in a XML file along with attachments.



## How to use this project: 

### For SFTP
   - from sftp.sftp import sftp

   - sftp.setup_credentials(sftp, "", , "", "")  # Mandatory to use

   - sftp.list_files_directories(sftp, "")
   - sftp.create_remote_folder(sftp, "", "")
   - sftp.delete_remote_files(sftp, "", [""])
   - sftp.rename_remote_folder(sftp, "", "", "")
   - sftp.download_remote_files(sftp, "", "", [""])
   - sftp.upload_local_files(sftp, "", "", [""])  # This function return result in form of "SUCCESS" or "FAILURE"   
                                                    for a single or list of files. This will be a collective result of processing.
   - sftp.rename_remote_file(sftp, "", "", "")
   - sftp.delete_remote_files(sftp, "", [""])

### For SMTP
   - from smtp.smtp import smtp

   - smtp.setup_credentials(smtp,"", , "", "")    #Mandatory to use

   - smtp.sendmail_without_attachment(smtp, "", "", "", "", "", "")
   - smtp.sendmail_with_attachment(smtp, "", "", "", "", "", [""], "")

### For IMAP
   - from imap.imap import imap

   - imap.setup_credentials(imap, "","" , "", "")   #Mandatory to use

   - imap.download_attachments_only(imap, "", "", filter_for="", prefix="", postfix="", within="")
   - imap.purge_email(imap, "", "")
   - imap.move_emails(imap, "", "", "")
   - imap.save_email_data_in_xml(imap, "", "", filter_for="", prefix="", postfix="", within="")
   - imap.save_email_data_in_xml_with_attachment_in_folder(imap, "", "", "", filter_for="", prefix="", postfix="", within="")



This package is developed by Sunesh Pandita.
GitHub repo:- [Link](https://github.com/SUNESHPANDITA/sftp-smtp-imap-package.git) 



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SUNESHPANDITA/sftp-smtp-imap-package.git",
    "name": "sftp-smtp-imap",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sunesh Pandita",
    "author_email": "suneshpandita2009@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/85/9e/06f2008f0a835264787346864be2130451d882efb97576385a45e0ed0fd3/sftp_smtp_imap-1.0.4.tar.gz",
    "platform": "Windows",
    "description": "### Package name is SFTP-SMTP-IMAP.\r\n\r\n    This package will simplify to work with SFTP, IMAP and SMTP server with the commonly used functionalities.\r\n    This package includes 3 classes (sftp, smtp and imap) to work with.\r\n\r\n#### Dependency\r\n     pip install mail-parser==3.15.0\r\n     pip install pysftp==0.2.9\r\n\r\n### Class sftp:-\r\n        This class includes all the functions required to work with SFTP server.\r\n\r\n        setup_credentials(self, sftp_host, sftp_port, sftp_username, sftp_password, sftp_remote_locatio)\r\n            As a first step, user need to pass SFTP credentials for setting details in variables.\r\n\r\n        list_files_directories(self, remote_location, extension, prefix, postfix, within)\r\n            This will give list of files and directories based on criteria passed in\r\n            extension, prefix, postfix and within parameters.\r\n\r\n        create_remote_folder(self, remote_location, foldername)\r\n            This function can be used to create a folder on SFTP server.\r\n\r\n        delete_remote_folder(self, remote_location, foldername)\r\n            This function can be used to delete a folder on SFTP server.\r\n\r\n        rename_remote_folder(self, remote_location, old_foldername, new_foldername)\r\n            This function can be used to rename a folder on SFTP server.\r\n\r\n        upload_local_files(self, local_folder, remote_folder, list_of_filenames)\r\n            This function can be used to upload single or list of files on SFTP server.\r\n\r\n        download_remote_files(self, remote_folder, local_folder, list_of_filenames)\r\n            This function can be used to download single or list of files from SFTP server to local server/machine.\r\n\r\n        rename_remote_file(self, remote_location, old_filename, new_filename)\r\n            This function can be used to rename a file on SFTP server.\r\n\r\n        delete_remote_files(self, remote_location, list_of_filenames)\r\n            This function can be used to delete a single or list of files on SFTP server.\r\n\r\n\r\n\r\n### Class smtp:-\r\n        This class includes all the functions required to work with SMTP server.\r\n\r\n        setup_credentials(self, smtp_host, smtp_port, smtp_username, smtp_password)\r\n            As a first step, user need to pass SMTP credentials for setting details in variables.\r\n\r\n        sendmail_without_attachment(self, TO, CC, BCC, SUBJECT, BODY, FROM_EMAIL)\r\n            Use this function when you want to send email without any attachment.\r\n\r\n        sendmail_with_attachment(self, TO, CC, BCC, SUBJECT, BODY, ATTACHMENTS, FROM_EMAIL)\r\n            Use this function when you want to send email with single or multiple attachments.\r\n\r\n\r\n\r\n### Class imap:-\r\n        This class includes all the functions required to work with IMAP server.\r\n\r\n        setup_credentials(self, imap_host, imap_port, imap_username, imap_password)\r\n            As a first step, user need to pass IMAP credentials for setting details in variables.\r\n\r\n        email_verification(EmailSubject, FromEmail, Messageid, filter_for, prefix, postfix, within)\r\n            Use this function when you want to know the what mail to process from given mail folder.\r\n\r\n        download_attachments_only(self, mail_foldername, attachment_folder_location, filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n            Use this function when you want to download email attachments only.\r\n\r\n        purge_email(self, mail_foldername, list_of_messageid)\r\n            Use this function when you want to delete an email from mail folder.\r\n            Example of mail_foldername can be Inbox, Processed, Sent etc.\r\n\r\n        move_emails(self, source_mail_foldername, destination_mail_foldername, list_of_messageid)\r\n            Use this function when you want to delete an email from mail folder.\r\n            Example of source_mail_foldername/destination_mail_foldername can be Inbox, Processed, Sent etc.\r\n\r\n        save_email_data_in_xml(self, mail_foldername, xml_folder_location, filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n            Use this function when you want to download email details in a XML file.\r\n\r\n        save_email_data_in_xml_with_attachment_in_folder(self, mail_foldername, xml_folder_location, attachment_folder_location,filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n            Use this function when you want to download email details in a XML file along with attachments.\r\n\r\n\r\n\r\n## How to use this project: \r\n\r\n### For SFTP\r\n   - from sftp.sftp import sftp\r\n\r\n   - sftp.setup_credentials(sftp, \"\", , \"\", \"\")  # Mandatory to use\r\n\r\n   - sftp.list_files_directories(sftp, \"\")\r\n   - sftp.create_remote_folder(sftp, \"\", \"\")\r\n   - sftp.delete_remote_files(sftp, \"\", [\"\"])\r\n   - sftp.rename_remote_folder(sftp, \"\", \"\", \"\")\r\n   - sftp.download_remote_files(sftp, \"\", \"\", [\"\"])\r\n   - sftp.upload_local_files(sftp, \"\", \"\", [\"\"])  # This function return result in form of \"SUCCESS\" or \"FAILURE\"   \r\n                                                    for a single or list of files. This will be a collective result of processing.\r\n   - sftp.rename_remote_file(sftp, \"\", \"\", \"\")\r\n   - sftp.delete_remote_files(sftp, \"\", [\"\"])\r\n\r\n### For SMTP\r\n   - from smtp.smtp import smtp\r\n\r\n   - smtp.setup_credentials(smtp,\"\", , \"\", \"\")    #Mandatory to use\r\n\r\n   - smtp.sendmail_without_attachment(smtp, \"\", \"\", \"\", \"\", \"\", \"\")\r\n   - smtp.sendmail_with_attachment(smtp, \"\", \"\", \"\", \"\", \"\", [\"\"], \"\")\r\n\r\n### For IMAP\r\n   - from imap.imap import imap\r\n\r\n   - imap.setup_credentials(imap, \"\",\"\" , \"\", \"\")   #Mandatory to use\r\n\r\n   - imap.download_attachments_only(imap, \"\", \"\", filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n   - imap.purge_email(imap, \"\", \"\")\r\n   - imap.move_emails(imap, \"\", \"\", \"\")\r\n   - imap.save_email_data_in_xml(imap, \"\", \"\", filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n   - imap.save_email_data_in_xml_with_attachment_in_folder(imap, \"\", \"\", \"\", filter_for=\"\", prefix=\"\", postfix=\"\", within=\"\")\r\n\r\n\r\n\r\nThis package is developed by Sunesh Pandita.\r\nGitHub repo:- [Link](https://github.com/SUNESHPANDITA/sftp-smtp-imap-package.git) \r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 @Sunesh Pandita  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "This package includes functionality to work with any SFTP, IMAP and SMTP server",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/SUNESHPANDITA/sftp-smtp-imap-package.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "119f7774e6bfb8d54bad6f0015b5101f12477dd17a6533c0af231c6b12bbf3a1",
                "md5": "6e3c5c48ac8c4ebd81ec4e0cde210ff2",
                "sha256": "bdba32d25ac025aec3c731d9eb72206c34e4e2232d9f8c6aeab49f171c94f218"
            },
            "downloads": -1,
            "filename": "sftp_smtp_imap-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e3c5c48ac8c4ebd81ec4e0cde210ff2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 10958,
            "upload_time": "2024-07-11T03:19:42",
            "upload_time_iso_8601": "2024-07-11T03:19:42.186714Z",
            "url": "https://files.pythonhosted.org/packages/11/9f/7774e6bfb8d54bad6f0015b5101f12477dd17a6533c0af231c6b12bbf3a1/sftp_smtp_imap-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "859e06f2008f0a835264787346864be2130451d882efb97576385a45e0ed0fd3",
                "md5": "849f58d3ad619233c2b47edc41372783",
                "sha256": "afa8d7c78b56bab471a56053ccdd1abace666d8605d05217f87761aa3e472823"
            },
            "downloads": -1,
            "filename": "sftp_smtp_imap-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "849f58d3ad619233c2b47edc41372783",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 10187,
            "upload_time": "2024-07-11T03:19:44",
            "upload_time_iso_8601": "2024-07-11T03:19:44.248504Z",
            "url": "https://files.pythonhosted.org/packages/85/9e/06f2008f0a835264787346864be2130451d882efb97576385a45e0ed0fd3/sftp_smtp_imap-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-11 03:19:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SUNESHPANDITA",
    "github_project": "sftp-smtp-imap-package",
    "github_not_found": true,
    "lcname": "sftp-smtp-imap"
}
        
Elapsed time: 0.29518s