semvec/pypi-packages huggingface dataset:
twixxy 0.1.1
Twisted integration with the twiggy logging library.
License: MIT

twixxy
======

.. image:: https://secure.travis-ci.org/dreid/twixxy.png?branch=master
    :target: http://travis-ci.org/dreid/twixxy

twixxy - twiggy + twisted

twixxy consists primarily of twisted log observer which can installed to
forward calls to ``log.msg`` and ``log.err`` to the appropriate Twiggy
log methods.

Using with twistd
-----------------

twixxy provides a log observer factory compatible with
``twistd --logger``.

::

    > twistd --logger=twixxy.observerFactory -n web --path=.
    2012-06-19T22:09:43Z:INFO:twisted:Log opened.
    2012-06-19T22:09:43Z:INFO:twisted:twistd 12.1.0 (/Users/dreid/.virtualenvs/twixxy/bin/python 2.7.1) starting up.
    2012-06-19T22:09:43Z:INFO:twisted:reactor class: twisted.internet.selectreactor.SelectReactor.
    2012-06-19T22:09:43Z:INFO:twisted:Site starting on 8080
    2012-06-19T22:09:43Z:INFO:twisted:Starting factory <twisted.web.server.Site instance at 0x10b718fc8>

Replacing Twisted's Logging without twistd.
-------------------------------------------

::

    import sys
    import twiggy
    from twisted.python import log
    from twixxy import TwiggyLoggingObserver

    twiggy.quickSetup(file=sys.stdout)
    observer = TwiggyLoggingObserver('example')
    log.startLoggingWithObserver(observer.emit)

    log.msg('Hello, World!')

Using in conjunction with Twisted's logging.
--------------------------------------------

::

    import sys
    import twiggy
    from twisted.python import log
    from twixxy import TwiggyLoggingObserver

    twiggy.quickSetup(file='twiggy.log')
    observer = TwiggyLoggingObserver('example2')
    observer.start()
    log.startLogging(sys.stdout)

    log.msg('Hello, World!')
linux-metrics 0.1.4
linux-metrics - System Metrics/Stats Library for Linux
License: MIT

=============
linux-metrics
=============

*System Metrics/Stats Library for Linux*

* 2010-2013 `Corey Goldberg <http://goldb.org>`_
* Dev Home: https://github.com/cgoldberg/linux-metrics
* PyPI: http://pypi.python.org/pypi/linux-metrics
* Free Open Source : `MIT License <http://www.opensource.org/licenses/MIT>`_

.. image:: https://travis-ci.org/cgoldberg/linux-metrics.png
    :target: https://travis-ci.org/cgoldberg/linux-metrics 

----

-----------
Description
-----------

`linux-metrics` is a Python package containing modules for getting OS metrics on systems running the Linux kernel.  It is a pure python library with no external dependencies.

Basic stats for major subsystems are provided (Processor/CPU, Disk, Memory, Network).

-----------------
Install from PyPI
-----------------

* `pip install linux-metrics`
 
------------
Requirements
------------

* Python 2.6/2.7/3.1/3.2/3.3/PyPy
* Linux 2.6+

-------------
Example Usage
-------------

print number of processes running::

    from linux_metrics import cpu_stat

    print cpu_stat.procs_running()

print CPU utilization every 5 secs::

    >>> from linux_metrics import cpu_stat
    >>> 
    >>> while True:
    ...     cpu_pcts = cpu_stat.cpu_percents(5)
    ...     print 'cpu utilization: %.2f%%' % (100 - cpu_pcts['idle'])
    ... 
    cpu utilization: 0.70%
    cpu utilization: 0.50%
    cpu utilization: 24.80%
    cpu utilization: 20.89%
    cpu utilization: 40.04%

---
API
---

::

  * linux_metrics
    * cpu_stat
      * cpu_times()
      * cpu_percents(sample_duration=1)
      * procs_running()
      * procs_blocked()
      * load_avg()
      * cpu_info()
    * disk_stat
      * disk_busy(device, sample_duration=1)
      * disk_reads_writes(device)
      * disk_usage(path)
      * disk_reads_writes_persec(device, sample_duration=1)
    * mem_stat
      * mem_stats()
    * net_stat
      * rx_tx_bytes(interface)
      * rx_tx_bits(interface)
      * rx_tx_dump(interface)

-------
Example
-------

`linux-metrics` package contains an example script:

* `example.py <https://github.com/cgoldberg/linux-metrics/blob/master/example.py>`_

----------
Unit Tests
----------

You can run the included unit tests and verify all cases pass in your environment:

::

    $ nosetests

Note:  you may need to adjust the configuration of the unit tests to match your environment.  They are set by default to use:

::

    DISK_DEVICE = 'sda1'
    
    NETWORK_INTERFACE = 'eth0'
lurker 0.1
a tiny wrapper for mysqldb
License: MIT

Lurker
======
Lurker is a tiny mysql wrapper built on the top of python-mySQLdb.

Installation
======
```
git clone git://github.com/emre/lurker.git
python setup.py install
```

Quick Tutorial
======

Connecting to the database
--------

* with Configuration objects. (This could be preferrable for seperating environments like DevConfig, ProdConfig, TestConfig)


``` python
class DatabaseConfig(BaseLurkerConfig):
    host = 'localhost'
    user = 'root'
    passwd = ''
    db = ''

connection = Connection(DbConfig)

```

* without Configuration objects

```python

connection = Connection().quick_connect("mysql_user", "mysql_passwd", "db_name", "host")

```

Sending Queries
--------
``` python
# returns last_id
connection.execute("INSERT INTO table_name (name) VALUES (%s)", ['Selami Sahin', ])

# returns row count
connection.execute("UPDATE table_name SET name = %s", ["Muhittin Bosat", ])

# returns a result set
all_people = connection.get_results("SELECT * FROM people")

# returns a row
one_people = connection.get_row("SELECT * FROM people WHERE id = 1")

# server-side cursor
for person in connection.iterate("SELECT * FROM people"):
    print person
```

Query Caching Support with Redis
--------
* In order to activate caching support, you need to set cache and cache_information variables in your config class.

``` python
from lurker.configuration import BaseLurkerConfig
from lurker.connection import Connection
from lurker.cache.backends.redis_backend import RedisBackend

class DbConfig(BaseLurkerConfig):
    host = 'localhost'
    user = 'root'
    passwd = 'passwd'
    db = 'db_name'
    cache = True
    cache_information = {
        'backend': RedisBackend,
        'args': (),
        'kwargs': {'host': 'localhost', 'port': 6379, 'db': 0},
    }
```

* Usage in get_results and get_row

``` python

print connection.get_row("SELECT * FROM people WHERE id = %s", parameters=(1,), cache=30)
print connection.get_row("SELECT * FROM people WHERE id = %s", parameters=(1,), cache=30)

# output
# DEBUG:root:cache miss: SELECT * FROM people WHERE id = %s
# {'id': 1L, 'name': u'Emre Yilmaz'}
# DEBUG:root:cache hit: SELECT * FROM people WHERE id = %s
# {u'id': 1, u'name': u'Emre Yilmaz'}

```

Maintainer
======
Emre Yılmaz - [@emre_yilmaz](http://twitter.com/emre_yilmaz)

Contributors
=============
Mirat Can Bayrak - [@mirat](http://twitter.com/mirat)

Projects/Scripts powered by lurker
====================================
 - Database Copy: https://gist.github.com/4686232#file-db_copy-py