How Open PASSWORD PROTECTED pdf file using textract - python

I'm working on pdf's and have created full project but now facing one problem that how to parse through contents of Password Protected PDF files (I know that password).

Related

.ipynb files can we protect with password and save on cloud?

Is it possible to save jupyter files on clouds with file level password ?
so that it will be double safe with cloud password as well as file password!
right now I am using only google drive to store my file.
Is there a better way to save the file with protection ?

How to extract data of password protected PDF using apache tika in python?

I have got many code of parser.from_file but didn't get any code to get data from password protected pdf file.

Embedding password protected pdf's?

I have some pdf files which I would like to publish on my websites. I don't want them to be downloaded. Is there any way that I can publish those files as password protected such that they are automatically opened on the website but when someone downloads it they can't open unless they have the password?

Python Sending Excel Attachment corrupts file

Using the ezgmail library, I am sending an E-mail with an Excel file attached.
I am able to send the E-mail with the attached Excel file, but when I open the Excel file from the sent E-mail, it seems it becomes corrupt for some reason because I get this message:
We found a problem with some content in 'attached_file.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.
When I click "Yes" I get:
Excel cannot open the file 'attached_file.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
The excel file that I attach opens fine from my desktop, or if I E-mail it manually. I get these prompts only after E-mailing it via my python script which leverages ezgmail. Does anyone have ideas?

Encrypt a file with a password to send via email in python

Here is what I need to do in python:
Take a CSV from a saved location. Encrypt it. Send it via email.
We have a report that creates a csv every week and it needs to get emailed to someone. When they open the attachment from their email, it needs to ask them to input a predetermined password before they can view the csv contents.
I know how to send email with attachments using the smtp and mime modules.
I don't really know much about encryption but most of my searches turn up for files that are going to also be DEcrypted by python, or for encrypting passwords themselves.
Is asking for password upon opening a .csv file possible? Are there any resources out there for tutorials on this?
As an unsophisticated approach, you could zip the csv file that requires a password to unzip. This is a simple command line option (to the zip utility) that you could call from Python, then attach the resulting file. This wouldn't give you the best encryption, but may serve your purpose. See this link on using stronger encryption with zip archives.

Categories