semvec/pypi-packages huggingface dataset:
speedparser 0.2.0
feedparser but faster and worse
License: MIT
Keywords: feedparser rss atom rdf lxml

speedparser
-----------

Speedparser is a black-box "style" reimplementation of the `Universal Feed
Parser <http://code.google.com/p/feedparser/>`_.  It uses some feedparser code
for date and authors, but mostly re-implements its data normalization algorithms
based on feedparser output.  It uses ``lxml`` for feed parsing and for optional
HTML cleaning.  Its compatibility with ``feedparser`` is very good for a strict
subset of fields, but poor for fields outside that subset.  See
``tests/speedparsertests.py`` for more information on which fields are more or
less compatible and which are not.

On an Intel(R) Core(TM) i5 750, running only on one core, ``feedparser`` managed
``2.5 feeds/sec`` on the test feed set (roughly 4200 "feeds" in 
``tests/feeds.tar.bz2``), while ``speedparser`` manages around ``65 feeds/sec``
with HTML cleaning on and ``200 feeds/sec`` with cleaning off.

installing
----------

``pip install speedparser``

usage
-----

Usage is similar to feedparser::

    >>> import speedparser
    >>> result = speedparser.parse(feed)
    >>> result = speedparser.parse(feed, clean_html=False)

differences
-----------

There are a few interface differences and many result differences between
speedparser and feedparser.  The biggest similarity is that they both return
a ``FeedParserDict()`` object (with keys accessible as attributes), they both
set the ``bozo`` key when an error is encountered, and various aspects of the
``feed`` and ``entries`` keys are likely to be identical *or* very similar.

``speedparser`` uses different (and in some cases less or none; buyer beware)
data cleaning algorithms than ``feedparser``.  When it is enabled, lxml's
``html.cleaner`` library will be used to clean HTML and give similar but not
identical protection against various attributes and elements.  If you supply
your own ``Cleaner`` element to the "``clean_html`` kwarg, it will be used
by ``speedparser`` to clean the various attributes of the feed and entries.

``speedparser`` does not attempt to fix character encoding by default because
this processing can take a long time for large feeds.  If the encoding value of
the feed is wrong, or if you want this extra level of error tollerance, you
can either use the ``chardet`` module to detect the encoding based on the
document or pass ``encoding=True`` to ``speedparser.parse`` and it will fall
back to encoding detection if it encounters encoding errors.

If your application is using ``feedparser`` to consume many feeds at once and
CPU is becoming a bottleneck, you might want to try out ``speedparser`` as an
alternative (using ``feedparser`` as a backup).  If you are writing an
application that does not ingest many feeds, or where CPU is not a problem,
you should use ``feedparser`` as it is flexible with bad or malformed data and
has a much better test suite.
jinjaconfig 0.1.1
A jinja2 renderer receiving a JSON string from commandline. Useful for generating config files in deployment enviroments
License: MIT

jinjaconfig
===========

A jinja2 renderer receiving a JSON string from commandline. Useful for generating config files in deployment
environments.


Installation
------------
Install jinja config ::

    pip install jinjaconfig

Install from sources ::

    pip install git+https://bitbucket.org/luisfernando/jinjaconfig.git

Usage ::

    usage: jinjaconfig [-h] --values [values] [file]

    A jinja2 renderer receiving arguments from commandline. Useful for generating
    config files in deployment enviroments

    positional arguments:
      file               template to parse

    optional arguments:
      -h, --help         show this help message and exit
      --values [values]  json encoded values

Basic Use
---------

1. Pass arguments from command line ::

    jinjaconfig example.conf --values="{"celery":{"task":"mytask","path":"/home/x/Env/myenv/bin/celery"},
    "num_procs":2,"user":"user","workdir":"/home/x/app/app/","logs":{"error":"/home/x/app/logs/err.log",
    "log":"/home/x/app/logs/log.log"}}"

2. Pass arguments from a file (\*NIX, Bash) and output to file ::

    jinjaconfig example.conf --values="`cat arguments.json`" > result.conf

example.conf ::

    ; ==================================
    ;  configuration example
    ; ==================================

    [program:celery]
    ; Set full path to celery program if using virtualenv
    command={{ celery.path }} worker -A {{ celery.task }}

    directory={{ workdir }}
    user={{ user }}
    numprocs={{ num_procs }}
    stdout_logfile={{ logs.log }}
    stderr_logfile={{ logs.error }}
    autostart=true
    autorestart=true
    startsecs=10

    ; Need to wait for currently executing tasks to finish at shutdown.
    ; Increase this if you have very long running tasks.
    stopwaitsecs = 600

    ; When resorting to send SIGKILL to the program to terminate it
    ; send SIGKILL to its whole process group instead,
    ; taking care of its children as well.
    killasgroup=true

    ; if rabbitmq is supervised, set its priority higher
    ; so it starts first
    priority=998

arguments.json ::

    {
       "celery" : {
          "task" : "mytask",
          "path" : "/home/x/Env/myenv/bin/celery"
       },
       "num_procs" : 2,
       "user" : "user",
       "workdir" : "/home/x/app/app/",
       "logs" : {
          "error" : "/home/x/app/logs/err.log",
          "log" : "/home/x/app/logs/log.log"
       }
    }




Authors:
========

- Luis Fernando Barrera (luisfernando@informind.com) @joyinsky