Use your Email-account as Storage for data structures and files
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. Have a look at the documentation.
- Before reaching version 1.0, the storage layout may change when updating
python3.5 or later. It should work Python3.4+ but tests are running on 2.7, 3.5 and 3.7.
This project makes use of the following libraries:
You can install the latest release from pip:
pip install imap-storage
from imap_storage import Account, Config config = Config() config.imap.user = 'firstname.lastname@example.org' config.imap.password = '123' config.imap.host = 'imap.example.com' # config.imap.port default is 993 account = Account(config, 1) directory = account.storage.directory_by_path(account.config.directory) email = directory.new_email('Your_first_item') email.add_item('TestMessage', text='Your first message') email.save() email.delete() account.close()
Running the tests¶
Rename ‘secrets.sample.py’ in tests directory to ‘secrets.py’ and include your e-mail account for testing. Then run this inside root directory:
python -m unittest # tests all python -m unittest tests.test_account # tests only account
or run it with coverage:
coverage run --source='imap_storage' -m unittest && coverage report -m --skip-covered
And coding style tests¶
Code style is not finished, mostly because of missing docstrings.
This library is not ready to be deployed productive
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. During beta development minor versions may be incompatible, too.