semvec/pypi-packages huggingface dataset:
collist 0.2
UNKNOWN
License: MIT

collist
=======
``collist`` is a simple module which provides the function
``collist()``, the single purpose of which is to columnate lists of
output for printing to the terminal. It is very much like the unix
command ``column``, but it works on python iterables. This package also
exports the command ``cols`` which is similar to ``column`` but works
better (on my system), though it has fewer options; see ``cols --help``.

The program uses the ``tput`` command internally, and therefore will not
work with Windows and other strange, non-POSIX operation systems.

Monkey Patch `collist` into the Python Interactive Prompt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Python interactive prompt print the representation of the return
value of any expression you give it.  If that return value is a list,
dictionary, or tuple, It returns the literal that will produce the
object.

When these collection objects get rather longer, printing them sucks.
``collist`` is designed to make lists of things look better. ``collist``
has a ``representation`` function which will output a nicely columnated
repr of a python dictionary, list or tuple. This repr is a valid python
literal.

In order to get this behavior in the standard interactive prompt or
bpython, add this to your ~/.pystart:

.. code:: python

    import sys # if you haven't already.
    from collist import displayhook

    sys.displayhook = displayhook

Then, you'll get nicely columnated list, tuples and dictionaries back in
the interactive prompt.

.. code:: python

  >>> [i for i in ('foo bar bing ' * 15).split()]
  ['foo',  'bar',  'bing', 'foo',  'bar',  'bing', 'foo',  'bar',
   'bing', 'foo',  'bar',  'bing', 'foo',  'bar',  'bing', 'foo',
   'bar',  'bing', 'foo',  'bar',  'bing', 'foo',  'bar',  'bing',
   'foo',  'bar',  'bing', 'foo',  'bar',  'bing', 'foo',  'bar',
   'bing', 'foo',  'bar',  'bing', 'foo',  'bar',  'bing', 'foo',
   'bar',  'bing', 'foo',  'bar',  'bing']

Nice! This is what the people want. There is a bug at the moment where
the terminal size is stuck at whatever it was when the interactive
prompt was started. I assume this has something to do with ``tput``
getting the terminal size from sterr, but I'm not really sure. If
anyone has a fix, I will be glad to accept a patch.

Also this patch won't work in ipython, since it has it's own replacement
for displayhook, of which I know nothing. It prints nicely already. kind
of.

.. vim: tw=72
bottle-elastic 0.2.1
Elasticsearch integration for Bottle
License: MIT

Bottle Elasticsearch
==============

.. image:: https://travis-ci.org/bsao/bottle-elastic.svg?branch=master
    :target: https://travis-ci.org/bsao/bottle-elastic

This bottle-elastic plugin integrates Elasticsearch with your Bottle
application. It injects a Elastic connection in your route and handle the
session cycle.

Support elasticsearch 2.x


Usage Example:

.. code-block:: python

    from bottle import Bottle
    from bottle_elastic import ElasticPlugin
    from datetime import datetime

    app = Bottle()
    plugin = ElasticPlugin(hosts=["localhost:9200"])
    app.install(plugin)

    @app.route('/', method='GET')
    def index(elastic):
        # elastic search operation
        return "ok"

    @app.route('/create/', method='POST')
    def create(elastic):
        doc = {
            'name': 'bsao',
            'text': 'Elasticsearch: cool.',
            'timestamp': datetime.now(),
        }
        response = elastic.index(index="test-index", doc_type='tweet', id=1, body=doc)
        return response
middlebury-directory 1.0.0
A Python API for the Middlebury directory.
License: MIT
Keywords: directory middlebury search people

Middlebury Directory
====================

.. image:: https://travis-ci.org/coursereviews/directory.svg?branch=master
    :target: https://travis-ci.org/coursereviews/directory

A Python API for the Middlebury directory.

.. code-block:: python

    from directory import search

    search(email="dsilver@middlebury.edu")
    # [<Person 30972781062F9A6167A8D944F82CFD64>]

Simple Search
-------------

Perform a simple keyword search.

.. code-block:: python

    from directory import search

    search("Dana Silver")
    # [<Person 30972781062F9A6167A8D944F82CFD64>]

This is equivalent passing the ``query`` keyword argument:

.. code-block:: python

    from directory import search

    search(query="Dana Silver")
    # [<Person 30972781062F9A6167A8D944F82CFD64>]


Advanced Search
---------------

Perform an advanced search with some or all of the available search fields:
first_name, last_name, email, phone, address, location, job_title, person_type,
department.

You can't perform a simple search and an advanced search in the same query.
Setting `query` and any of the other fields will fail validation.

.. code-block:: python

    from directory import search

    search(email="dsilver@middlebury.edu")
    # [<Person 30972781062F9A6167A8D944F82CFD64>]

.. code-block:: python

    from directory import search

    search(first_name="Dana", person_type="Faculty")
    # [<Person 90338E439DA4652A2BDE2AC3F327A563>]


Advanced Usage
--------------

For raw access to validation and search fields, and control over when the HTTP
requests are sent, use the Search class. The Search class can be initialized
with any of the arguments to the search method.

.. code-block:: python

    from directory import Search

    # Construct a search object
    query = Search('Dana Silver')

    # Validate the search
    query.validate()

    # Get the search fields (makes an HTTP request for form parameters)
    query.search_fields()

    # Get the search results (makes HTTP requests for the search results)
    query.results()