How to use the feedparser.__version__ function in feedparser

To help you get started, we’ve selected a few feedparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mk-fg / feedjack / feedjack / fjupdate.py View on Github external
import feedparser, feedjack
from feedjack.models import (
	transaction_wrapper, transaction, IntegrityError,
	transaction_signaled_commit, transaction_signaled_rollback )
from feedjack.utils import command_logger_setup

import itertools as it, operator as op, functools as ft
from datetime import datetime, timedelta
from time import struct_time, sleep
from collections import defaultdict
from hashlib import sha256
import os, sys, types, hmac, argparse

USER_AGENT = 'Feedjack/{} ({}) feedparser/{}'.format(
	feedjack.__version__, feedjack.__url__, feedparser.__version__ )
SLOWFEED_WARNING = 10

import logging
logging.EXTRA = (logging.DEBUG + logging.INFO) // 2
logging.addLevelName(logging.EXTRA, 'EXTRA')
log = logging.getLogger('feedjack.update')
log.extra = ft.partial(log.log, logging.EXTRA) # should only be used here


ENTRY_NEW, ENTRY_UPDATED,\
	ENTRY_SAME, ENTRY_ERR = xrange(4)

entry_keys = (
	(ENTRY_NEW, 'new'),
	(ENTRY_UPDATED, 'updated'),
	(ENTRY_SAME, 'same'),
github kurtmckee / feedparser / util / releasecheck.py View on Github external
feedparser_version = None
docs_version = None
setup_version = None
docs_date = None

makefile_re = re.compile(r'^VERSION\s*=\s*(.*?)$')
for line in file('Makefile'):
    m = makefile_re.search(line)
    if m:
        makefile_version = m.group(1)
        break
if not makefile_version:
    sys.stderr.write('could not determine Makefile version\n')
    sys.exit(1)

feedparser_version = feedparser.__version__
if not feedparser_version:
    sys.stderr.write('could not determine feedparser.py version\n')
    sys.exit(1)

docs_re = re.compile(r'^$')
for line in file('feedparser/docs/xml/feedparser.xml'):
    m = docs_re.search(line)
    if m:
        docs_version = m.group(1)
        break
if not docs_version:
    sys.stderr.write('could not determine feedparser docs version\n')
    sys.exit(1)

setup_re = re.compile(r'^\s*version\s*=\s*["\'](.*?)["\']\s*,\s*$')
for line in file('feedparser/setup.py'):
github Dieterbe / rss2email / rss2email.py View on Github external
smtpserver = send(fromhdr, tohdr, subjecthdr, content, contenttype, extraheaders, smtpserver)

					f.seen[frameid] = id

				f.etag, f.modified = r.get('etag', None), r.get('modified', None)
			except (KeyboardInterrupt, SystemExit):
				raise
			except:
				logging.warning ("=== rss2email encountered a problem with this feed ===")
				logging.warning ("=== See the rss2email FAQ at http://www.allthingsrss.com/rss2email/ for assistance ===")
				logging.warning ("=== If this occurs repeatedly, send this to lindsey@allthingsrss.com ===")
				logging.warning ("Could not parse %s", f.url)
				logging.warning (traceback.extract_stack())
				logging.warning ("rss2email %s", __version__)
				logging.warning ("feedparser %s", feedparser.__version__)
				logging.warning ("html2text %s", h2t.__version__)
				logging.warning ("Python %s", sys.version)
				logging.warning ("=== END HERE ===")
				continue

	finally:
		save(feeds)
		if smtpserver:
			smtpserver.quit()
github ggaughan / pipe2py / pipe2py / modules / pipefetchsitefeed.py View on Github external
# pipefetchsitefeed.py
#

try:
    import speedparser as feedparser
except ImportError:
    import feedparser

    feedparser.USER_AGENT = (
        "pipe2py (feedparser/%s) +https://github.com/ggaughan/pipe2py" %
        feedparser.__version__
    )

from urllib2 import urlopen
from pipe2py.lib import autorss
from pipe2py import util
from pipe2py.lib.dotdict import DotDict


def pipe_fetchsitefeed(context=None, _INPUT=None, conf=None, **kwargs):
    """This source fetches and parses the first feed found on one or more sites
       to yield the feed entries.

    Keyword arguments:
    context -- pipeline context
    _INPUT -- not used
    conf:
github kurtmckee / feedparser / setup.py View on Github external
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import pathlib
import setuptools
import sys

sys.path.append(str(pathlib.Path(__file__).parent))
import feedparser

with open('README.rst', 'r') as f:
    long_description = f.read()

setuptools.setup(
    name='feedparser',
    version=feedparser.__version__,
    license='BSD-2-Clause',
    description='Universal feed parser, handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds',
    long_description=long_description,
    long_description_content_type='text/x-rst',
    author='Kurt McKee',
    author_email='contactme@kurtmckee.org',
    url='https://github.com/kurtmckee/feedparser',
    download_url='https://pypi.python.org/pypi/feedparser',
    platforms=['POSIX', 'Windows'],
    packages=['feedparser', 'feedparser.datetimes', 'feedparser.namespaces', 'feedparser.parsers'],
    install_requires=[
        'sgmllib3k;python_version>="3.0"',
    ],
    keywords=['atom', 'cdf', 'feed', 'parser', 'rdf', 'rss'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
github kurtmckee / feedparser / docs / conf.py View on Github external
import os
import pathlib
import sys

sys.path.append(str(pathlib.Path(__file__).parent.parent))
import feedparser

# project information
project = u'feedparser'
copyright = u'2010-2020 Kurt McKee, 2004-2008 Mark Pilgrim'
version = feedparser.__version__
release = feedparser.__version__
language = u'en'

# documentation options
master_doc = 'index'
exclude_patterns = ['_build']

# use a custom extension to make Sphinx add a  to feedparser.css
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
extensions = ['add_custom_css']

# customize the html
# files in html_static_path will be copied into _static/ when compiled
html_static_path = ['_static']
github rss2email / rss2email / rss2email.py View on Github external
if type(self) == ProcessingError:  # not a more specific subclass
            LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            LOG.warning(_pprint.pformat(self.parsed))
            LOG.warning('rss2email', __version__)
            LOG.warning('feedparser', _feedparser.__version__)
            LOG.warning('html2text', _html2text.__version__)
            LOG.warning('Python', _sys.version)
            LOG.warning('=== END HERE ===')
github rss2email / rss2email / rss2email / error.py View on Github external
if type(self) == ProcessingError:  # not a more specific subclass
            _LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            _LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            _LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            _LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            _LOG.warning(_pprint.pformat(self.parsed))
            _LOG.warning('rss2email {}'.format(__version__))
            _LOG.warning('feedparser {}'.format(_feedparser.__version__))
            _LOG.warning('html2text {}'.format(_html2text.__version__))
            _LOG.warning('Python {}'.format(_sys.version))
            _LOG.warning('=== END HERE ===')
github woefe / ytcc / ytcc / cli.py View on Github external
import youtube_dl.version
    import subprocess
    import feedparser
    import lxml.etree
    import sqlalchemy
    print("---ytcc version---")
    print(ytcc.__version__)
    print()
    print("---youtube-dl version---")
    print(youtube_dl.version.__version__)
    print()
    print("---SQLAlchemy version---")
    print(sqlalchemy.__version__)  # type: ignore
    print()
    print("---feedparser version---")
    print(feedparser.__version__)
    print()
    print("---lxml version---")
    print(lxml.etree.__version__)
    print()
    print("---python version---")
    print(sys.version)
    print()
    print("---mpv version---")
    subprocess.run(["mpv", "--version"], check=False)
    print()
    print("---config dump---")
    print(ytcc_core.config)
github kurtmckee / feedparser / docs / conf.py View on Github external
import os
import pathlib
import sys

sys.path.append(str(pathlib.Path(__file__).parent.parent))
import feedparser

# project information
project = u'feedparser'
copyright = u'2010-2020 Kurt McKee, 2004-2008 Mark Pilgrim'
version = feedparser.__version__
release = feedparser.__version__
language = u'en'

# documentation options
master_doc = 'index'
exclude_patterns = ['_build']

# use a custom extension to make Sphinx add a  to feedparser.css
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
extensions = ['add_custom_css']

# customize the html
# files in html_static_path will be copied into _static/ when compiled
html_static_path = ['_static']