semvec/pypi-packages huggingface dataset:
rlog 0.2
Small handler and formatter for using python logging with Redis
License: MIT
Keywords: Redis,logging,log,logs

rlog
====

| Small handler and formatter for using python logging with Redis.
| This is cleared and simplified version of
  `python-redis-log <https://github.com/jedp/python-redis-log>`__ by Jed
  Parsons, with Python3 support.

| |Build Status|
| |Coverage Status|

Installation
------------

The current stable release:

::

    pip install rlog

or:

::

    easy_install rlog

or from source:

::

    $ sudo python setup.py install

Usage
-----

::

    >>> from rlog import RedisHandler
    >>> logger = logging.getLogger()
    >>> logger.addHandler(RedisHandler(channel='test'))
    >>> logger.warning("Spam!")
    >>> logger.error("Eggs!")

Redis clients subscribed to ``test`` will get a json log record by
default.

| *RedisHandler* and *RedisListHandler* also accepted all redis client
  settings as kwargs. More info about client settings
| you may find in `redis-py <https://github.com/andymccurdy/redis-py>`__
  documentation.

| Custom formatters also supported, handlers accept this as *formatter*
  keyword argument. JSONFormatter from this package
| used as default.

| You can use the ``redis-cli`` shell that comes with ``redis`` to test
  this. At
| the shell prompt, type ``subscribe my:channel`` (replacing with the
  channel
| name you choose, of course). You will see subsequent log data printed
  in the
| shell.

Also you can use it with Django:

.. code:: python

        LOGGING = {
            'version': 1,
            'disable_existing_loggers': True,
            'handlers': {
                'redis': {
                    'level': 'DEBUG',
                    'class': 'rlog.RedisHandler',
                    'host': 'localhost',
                    'password': 'redis_password',
                    'port': 6379,
                    'channel': 'my_amazing_logs'
                }
            },
            'loggers': {
                'django': {
                    'level': 'INFO',
                    'handlers': ['redis'],
                    'propagate': True,
                },
            }
        }

You can also simply use it with logstash.

.. |Build Status| image:: https://travis-ci.org/lobziik/rlog.svg?branch=master
   :target: https://travis-ci.org/lobziik/rlog
.. |Coverage Status| image:: https://coveralls.io/repos/lobziik/rlog/badge.png?branch=master
   :target: https://coveralls.io/r/lobziik/rlog?branch=master
pyneuronjs 1.2.0
The python middleware for neuron.js
License: MIT
Keywords: neuron.js middleware javascript loader facade

|Build Status|

pyneuronjs
==========

Python utilities and middleware for neuron.js

pyneuronjs analyzes the dependencies from user defined facades according
to the dependency tree, and outputs ``<script>`` tags and configurations
for `neuron.js <https://github.com/kaelzhang/neuron>`__

The dependency tree can be generated by
`neuron-package-dependency <https://github.com/kaelzhang/neuron-package-dependency>`__

Install
-------

.. code:: sh

    $ pip install pyneuronjs

Usage
-----

.. code:: py

    from pyneuronjs import Neuron

    n = Neuron(
      dependency_tree=dependency_tree,  # must defined
      resolve=resolve,
      version=version,
      cache=cache,
      debug=False)

``pyneuronjs`` could be used either in template file or your python
controller.

`Here <./sample/sample-jinja.html>`__ is a sample Jinja2 template file.

-  **dependency\_tree** ``dict`` the ``json.loads()``\ ed dependency
   tree
-  **resolve** ``function(id)=`` (optional) implements your own custom
   resolver. ``resolve`` accepts one parameter ``id`` which can be
   either a ``str`` of module id or a ``list`` of module ids. If a
   ``str`` is passed in, the method should returns the resolved absolute
   url of the module id. If ``id`` is a ``list``, an url of comboed
   script files should be returned.
-  **debug** ``function|bool=False`` tells pyneuronjs whether should
   switch on debug mode. When on debug mode, no javascript files of
   dependencies will be preloaded, and the output will not be
   compressed.
-  if ``debug`` is callable, pyneuronjs will use the return value of
   method ``debug``
-  if ``debug`` is a boolean value, and ``debug`` is true, the debug
   mode will be on.
-  **cache** ``dict=None`` if ``cache`` is defined, it should contains 3
   methods:
-  ``cache.has(key)`` returns ``bool``
-  ``cache.get(key)`` looks up and returns the cached value by key
-  ``cache.set(key, value)`` sets the value by key
-  **version** ``str`` only works if ``cache`` is defined. pyneuronjs
   will uses ``version`` to generate the key to cache the output result

module id
^^^^^^^^^

.. code:: js

    <name>@<version><path>  # for example: 'jquery@2.0.0/jquery.js'

n.facade(entry, data=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^

-  **entry** ``str`` id of the entry module

Registers a facade entry with ``data``. pyneuronjs will

Returns ``''``\ (empty string), so you can use this method in python
template

n.combo(id...)
^^^^^^^^^^^^^^

Returns ``''``

n.css(id)
^^^^^^^^^

Returns ``''``

n.output()
^^^^^^^^^^

Returns ``str``

n.output\_css()
^^^^^^^^^^^^^^^

Returns ``str``

License
-------

MIT

.. |Build Status| image:: https://travis-ci.org/kaelzhang/pyneuronjs.svg?branch=master
   :target: https://travis-ci.org/kaelzhang/pyneuronjs