semvec/pypi-packages huggingface dataset:
abbreviate 0.1.1
Automatically abbreviate text
License: MIT
Keywords: string formatting

Abbreviate
==========

This filter attempts to automatically and intelligently abbreviate strings.

This library contains a dictionary of known abbreviations. Some words have
multiple abbreviations, e.g. Thursday could be abbreviated as any of Thurs,
Thur, Thr, Th, or T depending on context. With no other information, each word
has a "preferred abbreviation" (Thr), however options can push things one way
or another. For words without known abbreviations, a series of heuristics are
applied to shorten them as needed.

The basic `abbreviate` method will only apply preferred abbreviations and
no heuristics. For more advanced applications, the library can be given a
target length and effort, and will attempt to generate the best string
possible. Length can be supplied either as a simple character count, or with a
custom length function. The latter is useful in many graphics applications
without monospaced fonts or constant kerning. By default, abbreviate will not
shorten any exisiting abbreviations (e.g. Thur -> Th), assuming that any
explicit abbreviation was passed as such for a reason.

Issues, updates, pull requests, etc should be directed
`to github <https://github.com/ppannuto/python-abbreviate`__.


State
-----

This tool was written to scratch an immediate itch and is thus quite
incomplete, but with extensibility and somewhat grander ideas in mind.
Architectural thoughts, radical changes to methodology, or just greater
abbreviations are all welcome.

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

The easiest method is to simply use pip:

::

    (sudo) pip install abbreviate

Usage
-----

TODO
rump 0.2.1
Upstream selection.
License: MIT

====
rump
====

.. image:: https://travis-ci.org/bninja/rump.png
   :target: https://travis-ci.org/bninja/rump

.. image:: https://coveralls.io/repos/bninja/rump/badge.png
   :target: https://coveralls.io/r/bninja/rump

R(outing)Ump(ire) is an **experimenal** upstream (i.e. server) selector for
HTTP requests. It does **not** proxy the request but instead integrates with a
load-balancer or reverse-proxy that exposes an upstream selection interface:

- nginx `X-Accel-* <http://wiki.nginx.org/X-accel>`_
- ...

dev
===

.. code:: bash

   $ git clone git@github.com:bninja/rump.git
   $ cd rump
   $ mkvirtualenv rump
   (rump)$ pip install -e .[tests]
   (rump)$ py.test test/ --cov=rump --cov-report term-missing

wtf?
====

Typically you can embed complex routing logic directly in a load-balancer or
reverse-proxy (e.g. nginx lua, varnish vcl, etc) and that's what should be
done 99% of the time.

This is an **experiment** to see what writing a Python based HTTP upstream
selector would look like and what flexibility that gives you.

Use it as a ``program`` or embed it as a ``lib`` in your proxy.

program
=======

Install it:

- `ansible-rump <https://github.com/bninja/ansible-rump>`_
- ...

Use it:

.. code:: bash

   $ rump list
   my-router
   $ rump show -d my-router
   ...
   $ rump edit -d my-router
   $ service rumpd status


lib
===

Get it:

.. code:: bash

   $ pip install rump
    
    
Use it:

.. code:: python

   import rump
   
   router = rump.Router(
       name='my-router',
       ...
   )

   upstream = router.match_upstream(router.request_type(wsgi_environ))
   if upstream:
      server = upstream()