semvec/pypi-packages huggingface dataset:
userv.socket-server 0.3.2
Async server for userv
License: MIT

The catch
=========
Most simplistic socket server for micropython

Webserver
=========
first we need to add routes to a router. This is described in userv.core
although serving static files is described below.

Example:
::

    from userv.routing import Router
    from userv.socket_server import run_server
    router = Router()
    # we add some routes

    run_server(router)

this way the server starts and runs forever.
Because sometimes you want to start a standby mode there is way to kill the run task
by given a callback which controls the loop.
We call it the timeout callback for now. Basicly the server runs as
long as the function returns True.

Example:
::

    def we_never_timeout():
        return True

    run_server(router, timeout_callback=we_never_timeout)

This is only a realy simple and silly example, but be aware to not do heavy lifting in this function,
because it will hinder your server to react normal.
Django-HTTPolice 0.5.0
Django integration for HTTPolice
License: MIT
Requires Python: >= 3.4
Keywords: HTTP message request response standards RFC validator Django

`HTTPolice`__ is a **validator or “linter” for HTTP requests and responses**.
It can spot bad header syntax, inappropriate status codes, and other potential
problems in your HTTP server or client.

__ https://github.com/vfaronov/httpolice

This package provides `Django`__ 1.11+ integration for HTTPolice.

__ https://www.djangoproject.com/

`Read the docs`__.

__ https://django-httpolice.readthedocs.io/

Many details from the `main repo`__'s ``HACKING.rst`` apply here as well.

__ https://github.com/vfaronov/httpolice
mitmproxy-HTTPolice 0.9.0
mitmproxy integration for HTTPolice
License: MIT
Requires Python: >= 3.6
Keywords: HTTP message request response standards RFC validator proxy

`HTTPolice`__ is a **validator or “linter” for HTTP requests and responses**.
It can spot bad header syntax, inappropriate status codes, and other potential
problems in your HTTP server or client.

__ https://github.com/vfaronov/httpolice

This package provides `mitmproxy`__ integration for HTTPolice.

__ https://mitmproxy.org/

`Read the docs`__.

__ https://mitmproxy-httpolice.readthedocs.io/

Many details from the `main repo`__'s ``HACKING.rst`` apply here as well.

__ https://github.com/vfaronov/httpolice
HTTPolice 0.9.0
Validator for HTTP
License: MIT
Requires Python: >= 3.4
Keywords: HTTP message request response standards RFC lint validator

HTTPolice
=========

HTTPolice is a **validator or “linter” for HTTP requests and responses**.
It can spot bad header syntax, inappropriate status codes, and other potential
problems in your HTTP server or client.

See `example report`__.

__ https://httpolice.readthedocs.io/page/showcase.html

As a command-line tool, it can read `HAR files`__ or raw HTTP/1.x TCP streams.
It can `integrate with mitmproxy`__ for TLS-encrypted and HTTP/2 traffic.
Or you can use it as a Python (3.4+) library.
There is a `Django integration`__ package and a third-party `Chrome extension`__.

__ https://en.wikipedia.org/wiki/.har
__ https://github.com/vfaronov/mitmproxy-httpolice
__ https://github.com/vfaronov/django-httpolice
__ https://chrome.google.com/webstore/detail/httpolice-devtool/hnlnhebgfcfemjaphgbeokdnfpgbnhgn

Start with the `quickstart`__.

__ https://httpolice.readthedocs.io/page/quickstart.html

A full `user manual`__ is available.
Also, a `list of all problems`__ HTTPolice can detect.

__ https://httpolice.readthedocs.io/
__ https://httpolice.readthedocs.io/page/notices.html

HTTPolice was partly inspired by `REDbot`__, another QA tool for the Web.
But the approach is different: instead of actively testing your server,
HTTPolice just analyzes anything you feed into it.
Thus, it can be used on requests and responses captured
from a real process or test suite.

__ https://redbot.org/

HTTPolice is hosted `on GitHub`__
and released under the MIT license (see ``LICENSE.txt``).
If you want to hack on HTTPolice, check out ``HACKING.rst``.

__ https://github.com/vfaronov/httpolice

`BrowserStack`__ kindly provide a free subscription for testing HTTPolice.

__ https://www.browserstack.com/
AnyStrEnum 0.2.0
Elegant implementation of Enum which inherits from str or bytes
License: MIT
Requires Python: >=3.6
Keywords: enum str strenum bytesenum bytestrenum typing auto autoenum


AnyStrEnum
==========


.. image:: https://img.shields.io/badge/Python%203.7-blue.svg
   :target: https://python.org
   :alt: Python 3.7


.. image:: https://img.shields.io/pypi/v/AnyStrEnum.svg
   :target: https://pypi.python.org/pypi/AnyStrEnum
   :alt: PyPi Package Version


Elegant implementation of Enum which inherits from str or bytes

As simple as this
-----------------

.. code-block:: python

   from anystrenum import StrEnum

   class Season(StrEnum):
       spring: str
       summer: str
       autumn: str
       winter: str

   print(Season.summer)
   print(isinstance(Season.summer, str))
   # summer
   # True

Features
========


* Easy members assignment with type hinting (No need to use ``auto()`` or other stubs)
* Automatic value generation with support of custom converters or separators
* Method to filter members (\ ``contains``\ , ``contained_in``\ , ``startswith``\ , ``endswith``\ , etc.)
* Custom ``str`` and ``bytes`` types support

Installation
============

.. code-block:: bash

   $ pip install AnyStrEnum

Examples
========

Using custom words separator
----------------------------

To automatically replace all underscores (\ ``_``\ ) in names to something more suitable, use ``sep`` parameter:

.. code-block:: python

   from anystrenum import StrEnum

   class Region(StrEnum, sep='-'):
       us_east_1: str
       us_west_1: str
       ca_central_1: str
       cn_northwest_1: str
       eu_central_1: str
       eu_west_1: str
       eu_north_2: str
       sa_east_1: str

   print(Region.us_east_1)
   # us-east-1

Using str converter and custom words separator
----------------------------------------------

If you need to apply to your names more changes, you can use ``converter`` parameter. Pass a function in here which will be called on every member

.. code-block:: python

   from anystrenum import StrEnum

   class ContentType(StrEnum, converter=lambda s: s.replace('_', '/', 1), sep='-'):
       application_json: str
       application_octet_stream: str
       application_x_json_stream: str
       audio_mpeg: str
       audio_pcm: str
       audio_ogg: str

   print(ContentType.application_octet_stream)
   # application/octet-stream

As you can see from an example, firstly, names will be converted with our lambda function and then, 
remaining underscores will be replaced with given separator

Filtering enum members
----------------------

Using enums from previous examples
##################################

.. code-block:: python

   print(ContentType.filter(contains='-', startswith='a', endswith='m'))
   # {<ContentType.application_octet_stream: 'application/octet-stream'>, 
   # <ContentType.application_x_json_stream: 'application/x-json-stream'>}

   print(ContentType.filter(contained_in='Usually content type for MP3 is audio/mpeg'))
   # {<ContentType.audio_mpeg: 'audio/mpeg'>}

   print(Region.filter(startswith='eu', endswith='1'))
   # {<Region.eu_west_1: 'eu-west-1'>, <Region.eu_central_1: 'eu-central-1'>}