diff --git a/README.md b/README.md index 8e97c8c..f5cedd4 100644 --- a/README.md +++ b/README.md @@ -1 +1,53 @@ -== feed2imap +# feed2imap + +## Requirements + +- Python 3.X (3.8 tested) + +## Installation + +### Linux / Mac OS / *nix + + ```bash + sudo python3 setup.py install + ``` + +### Windows (using PowerShell) + + ```PowerShell + & $(where.exe python).split()[0] setup.py install + ``` + +## Usage + +1. Create a feeds file in YAML format with the following syntax: + +```yaml +default-email: feed-sender@domain.com +disable-ssl-verification: true +include-images: true +feeds: +- name: Slashdot RSS + url: http://rss.slashdot.org/Slashdot/slashdot + target: "imaps://username:password@server.domain.com/INBOX.Feeds.Technology.Slashdot" # The dot separate folders. You can also use IMAP without SSL using imap: as protocol at the begging. + ``` + +1. Run: + + ```bash + feed2imap.py [OPTIONS] + ``` + +### Options + + ``` + --debug-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET] Debug level. + -f, --feeds-file TEXT File in YAML with the information of the feeds. + -l, --log-file TEXT File to store all log information. + -e, --default-email TEXT Email address for the sender of the feed items. + -n, --disable-ssl-verification Disable SSL verification for the IMAP server certificate. + -i, --include-images Include images from feed items. + -f, --feeds TEXT Feed item in JSON format. + -c, --cache-file TEXT Cache file to store downloaded items. + --help Show this message and exit. + ``` diff --git a/feed2imap/__init__.py b/feed2imap/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/feed2imap.py b/feed2imap/feed2imap.py similarity index 100% rename from feed2imap.py rename to feed2imap/feed2imap.py index d033d10..b572140 100644 --- a/feed2imap.py +++ b/feed2imap/feed2imap.py @@ -15,6 +15,7 @@ import imaplib import email from email import message import urllib +from defusedxml.ElementTree import fromstring import yaml import requests @@ -22,7 +23,6 @@ import click import click_config_file import logging from logging.handlers import SysLogHandler -from defusedxml.ElementTree import fromstring class feed2imap(): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4f59099 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +click +click_config_file +pyyaml +requests \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..cfdc443 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,9 @@ +[metadata] +name = %project_codename% +version = %version% + +[options] +packages = %project_codename% +install_requires = + requests + importlib; python_version == "3.6" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a4f49f9 --- /dev/null +++ b/setup.py @@ -0,0 +1,2 @@ +import setuptools +setuptools.setup()