semvec/pypi-packages huggingface dataset:
silex 0.2.0
string utilities
License: MIT

silex
=====

|Build| |downloads| |license| |version| |PEP8|

A bunch of useful functions for string manipulation.

Install (automatic)
-------------------

::

    $ pip install silex

Install (manual)
----------------

::

    $ git clone 
    $ cd silex
    $ python setup.py install

Usage
-----

.. code:: python

    In [1]: from silex import *

    In [2]: print chop("whitespace", 5)
    ['white', 'space', '']

    In [3]: print numberex('1.2euros')
    1.2

    In [4]: print surround('b', '<', '>')
    <b>

    In [5]: print strip_html('<p><i>hello</i></p>')
    hello

    In [6]: print unslugify('sex_appeal')
    sex appeal

    In [7]: print slugify(u'je suis\ épuisé')
    je-suis-epuise

    In [8]: print clean('hello\n    word\n')
    hello word

    In [9]: print kebabcase('hello  world')
    hello-world

    In [10]: print pascalcase('hello world')
    HelloWorld

    In [11]: print camelcase('hello world')
    helloWorld

    In [12]: print snakecase('hello world')
    hello_world

License
-------

MIT

.. |Build| image:: https://travis-ci.org/walidsa3d/silex.svg?branch=master
.. |downloads| image:: https://img.shields.io/pypi/dm/silex.svg
.. |license| image:: https://img.shields.io/pypi/l/silex.svg
.. |version| image:: https://img.shields.io/pypi/v/silex.svg
.. |PEP8| image:: https://img.shields.io/badge/code%20style-pep8-orange.svg
   :target: https://www.python.org/dev/peps/pep-0008/
django-echo 0.2.2
Django library for creating skills for the Amazon Echo (Alexa)
License: MIT

===========
django-echo
===========

Django library for creating skills for the Amazon Echo (Alexa)

===============
Getting Started
===============

django-echo is mainly composed of three classes:

- ``echo.skill.EchoSkill``: A subclass of Django's generic.View that handles routing intents and dealing with request data.
- ``echo.request.EchoRequest``: A small wrapper around the JSON data in the request from Amazon.
- ``echo.response.EchoResponse``: A subclass of Django's http.HttpResponse that knows how to generate a valid Amazon Echo response.


Creating a Skill
----------------
A skill is a class that subclasses EchoSkill that provides intent handlers::

    from echo.skill import EchoSkill

    class HoroscopeSkill(EchoSkill):
        def get_horoscope(self, request, sign):
            # Ignore the sign because astrology is bunk.
            return self.respond(
                "Today you need to act first and ask questions later!",
                card=None,
                should_end_session=True
            )


On the Amazon side you would setup an intent called ``GetHoroscope`` that has
a ``sign`` slot, and when that intent is called this ``get_horoscope`` method
will be called with the slot data.

The ``self.respond`` is a helper method that essentially just acts as a
pass-through to ``EchoResponse``. You can also use SSML directly and
EchoResponse will set the response up correctly::

    self.respond("<speak>Today you need to ask questions first and act later!</speak>")

Then you just need to wire the skill up to your urls.py::

    from django.conf.urls import url

    from .views import HoroscopeSkill

    urlpatterns = [
        url(
            regex=r'^horoscope/$',
            view=HoroscopeSkill.as_view(),
            name='horoscope_skill'
        )
    ]


Responding With A Card
----------------------
EchoSkill provides a helper to create a simple card::

        return self.respond(
            "What alexa should say",
            card=self.create_simple_card("The card title", "The card's content")
        )


Session Handling
----------------
EchoSkill sets ``self.request`` to an instance of EchoRequest (it also saves
the http request to ``self.http_request``.) EchoRequest provides the session
attributes via a ``session`` attribute::

    sign = self.request.session.get('sign')

    request.session.update({
        'has_requested_horoscope': True
    })

If you use ``EchoSkill.respond`` this session data will be automatically
attached to the response, otherwise you'll need to pass it when creating the
response::

        return EchoResponse("Output text", session=self.request.session)
Flask-Humanize 0.1.0
Common humanization utilities for Flask applications.
License: MIT
Keywords: flask humanize datetime

Humanize-Flask
==============

Extension provides common humanization utilities, like turning number into a
fuzzy human-readable duration or into human-readable size, to your flask
application.

Contributing
------------

Don't hesitate to create a `GitHub issue
<https://github.com/vitalk/flask-humanize/issues>`_ for any **bug** or
**suggestion**.