![]() download ( destination = '/home/myname/Downloads' ) # Logout user. get_received ( age = 7 ) for transfer in transfers : transfer. delete_contact ( unfriendly ) # Download received transfers for the past 7 days transfers = user. update_contact ( contact ) # Delete contact unfriendly = user. get_contact ( ) # Update that contact contact = 'Mr. get_contacts () # Get one single contact contact = user. get_sent ( expired = True ) # Get contacts user. User ( username =, password = 'YourSecretPassword2014' ) # List all prior transfers transfers = user. send ( auto_complete = True ) # Login to a registered Filemail account user = pyfilemail. add_files ( list_of_files ) # Send files to recipient(s) transfer. add_files ( '/path/to/my/BIG_file.ext' ) # Add multiple files list_of_files = transfer. Transfer ( user, to =, subject = 'My BIG file no email can handle', message = 'You will not belive the speed of this download!', notify = True, confirmation = True, days = 7, password = 'JuSt2BeSaf£' ) # Add a single file to transfer queue transfer. ![]() User ( username = ) transfer = pyfilemail. delete-password Delete password stored in keychainįile (s ) and/or folder (s ) to transfer Python API examples import pyfilemail # Setup a transfer # Initialize Filemail with as free (as in free beer) user user = pyfilemail. store-password Store user password in keychain if available password PASSWORD Protect transfer with the supplied password Recipient (s ) of the transfer (email addresses ) subject SUBJECT Subject of email sent with transfer notify Notify when recipients download your files? message MESSAGE Message to the recipient (s ) of the transfer downloads 0 Number of times the file (s ) may be downloaded. days 3 Number of days the file (s ) are available for download confirm Email confirmation after sending the files? compress Compress (ZIP ) data before sending? nc, -no-checksum Skip calculating checksum on added files free Send files without a registered Filemail account version show program 's version number and exitĪdd API KEY from Filemail to local config file h, -help show this help message and exit Machine topsecretpassword Command line help usage: pyfilemail ] ]Ĭommand line Filemail transfer through Python Make sure you restrict access to only allow your own user to read it. pyfilemail -add-api-key YOUR-API-KEY-FROM-FILEMAIL netrc ![]() You can add the API KEY to the local config file with the -add-api-key argumet. payload /path/to/file.ext /path/to/folder/ Add API KEY message "Have you seen how amazingly big this document is?" \ Pyfilemail is still work in progress and parts of the API might change as I develop and test it further. I use this software myself and have not yet experienced broken files, but I take no responsibility for the files sent or received using pyfilemail whether it comes to content or state of files passing through. I’ll try to get my hands on a Windows and OSX machine and addapt the code to make sure it works there as well.ĪPI documentation is available at readthedocsĪny feedback is more than welcome and please report bugs through github Installation pip install pyfilemail Disclaimer So far this has been developed and tested on Ubuntu 16.04. It also saves me a lot of head ache writing rock solid validation code and I think this is a more flexible way of doing it if the Filemail team decides to changeĪppart from pyfilemail.User and pyfilemail.Transfer classes, all return objects from filemail are dict objects based on json responses. The reason for this is that I don’t work at filemail and have no insight in what validation they have for the data passed. I’ve tried to keep this api as simple as possible and rely on filemail’s own validation of data to keep you all in check :) Without registering you’ll still be able to send files as a free plan user but remember to use the -free argument in the command line tool.įor more info on the different plans please go to Filemail If you register for a paid plan you unlock all features and will be able to add/delete/update your transfers/contacts/group/company settings. To avoid nagging about API KEY you should register and get one here. Pyfilemail is a command line tool and API for sending and recieving files with Filemail
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |