semvec/pypi-packages huggingface dataset:
sifter 0.1
Parser/evaluator for the Sieve filtering language (RFC 5228)
License: BSD

Python implementation of the Sieve email filtering language (RFC 5228).

https://github.com/garyp/sifter


FEATURES
========

- Supports all of the base Sieve spec from RFC 5228, except for features still
  listed under TODO below
- Extensions supported:

  - regex (draft-ietf-sieve-regex-01)


EXAMPLE
=======

::

    import email
    import sifter.parser
    rules = sifter.parser.parse_file(open('my_rules.sieve'))
    msg = email.message_from_file(open('an_email_to_me.eml'))
    msg_actions = rules.evaluate(msg)

In the above example, ``msg_actions`` is a list of actions to apply to the
email message. Each action is a tuple consisting of the action name and
action-specific arguments. It is up to the caller to manipulate the message and
message store based on the actions returned.


WARNINGS
========

- No thought has been given yet to hardening against malicious user input. The
  current implementation is aimed at users that are running their own sieve
  scripts.
- The current implementation is not optimized for performance, though hopefully
  it's not too slow for normal inputs.


TODO
====

In rough order of importance:

- An example adaptor that provides Unix LDA behavior using sieve for filtering
- Base spec features not yet implemented:

  - encoded characters (section 2.4.2.4)
  - multi-line strings (section 2.4.2)
  - bracketed comments (section 2.3)
  - message uniqueness (section 2.10.3)
  - envelope test (section 5.4)
  - handle message loops (section 10)
  - limit abuse of redirect action (section 10)
  - address test should limit allowed headers to those that contain addresses
    (section 5.1)

- Make sure character sets are actually handled according to the spec
- Make string parsing comply with the grammar in section 8.1 and the features
  described in section 2.4.2
- Check that python's ``email.message`` implements header comparisons the same
  way as the sieve spec
- Make sure regular expressions are actually handled according to the extension
  spec
- Add support for various extensions:

  - variables (RFC 5229)
  - externally stored lists (draft-melnikov-sieve-external-lists)
  - body (RFC 5173)
  - relational (RFC 5231)
  - subaddress (RFC 5233)
  - copy (RFC 3894)
  - environment (RFC 5183)
  - date and index (RFC 5260)
  - editheader (RFC 5293)
  - ihave (RFC 5463)
  - mailbox metadata (RFC 5490)
  - notifications (RFC 5435), mailto notifications (RFC 5436), xmpp
    notifications (RFC 5437)
django-extraconfig 0.1.1
An entry-point based solution to extendthe Django configuration.
License: BSD
Keywords: Django settings

django-extraconfig
==================

With ``django-extraconfig`` it's easy to extend a Django project
``settings.py`` file. The only function provided by this module is
``load_extraconfig(entry_point_name, module_name)``.

``extraconfig.load(entry_point_name, module_name)``
    Loads all uppercase values from the entry point modules
    into the module with the name ``module_name`` overriding
    any existing values.

Usage
=====

At the bottom of your ``settings.py`` file add::

    try:
        import extraconfig
    except ImportError:
        pass
    else:
        extraconfig.load(<entry_point_name>, __name__)

``entry_point_name`` can be any string value but it's a good practice to
include the projectname in order to avoid name collisions. For example to
load the extra configuration showed below, ``entry_point_name`` should be
set to *"my_project.extraconfig"*.

Creating an extra configuration
===============================

It's easy to create an extra configuration module. The minimal project
layout is composed of two files: ``setup.py`` and the module file. The module
will be installed using the ``setup.py`` file just like any other regular
Python module. In order for ``django-extraconfig`` to know that this module
should be used to override your Django configuration in ``setup.py`` you must
add it in the entry point config.

A minimal ``setup.py`` file can look like this::

    from setuptools import setup

    setup(
        name='my_extra_config',
        version='0.1',
        py_modules=['my_extra_config'],
        entry_points = {
            'my_project.extraconfig': 'main = my_extra_config'
        }
    )

Now you can add a ``my_extra_config.py`` file with the settings you want to
override::

    DEBUG = True

Installing the extra configuration
==================================

Once the extra configuration project is ready you can run::

    python setup.py develop

This will install the extra configuration module in development mode, meaning
you can edit the extra settings and all the changes will be visible without
reinstalling it.