semvec/pypi-packages huggingface dataset:
typecorrector 0.2.2
A decorator meant to give type hints about function parameters as well as allow a margin of error
License: MIT
Keywords: types,type hints,type hinting

Type corrector
==============

Important
----------

This project has merged with typesys and will no longer be maintained.
Typesys can be found `on github <https://github.com/fredgj/typesys>`_
or `pypi <http://pypi.python.org/pypi/typesys/>`_ or it can be installed with pip install typesys.

Intro
-----

Type corrector is module that contains the decorator type_corrector.
This decorator lets the user specify what types the 
arguments to a function should have. It's not 100% safe to use as it
might result in a ValueError or TypeError if the user is not careful enough.
The motivation behing this module was to find a way that makes it easier
for the programmer to see what types the arguments should be, and at 
the same time allow some margin of error.
I'm not sure if this is a good idea, or if it's a good approach. It was
mostly developed for fun while playing around with decorators.

Installation
------------

pip install typecorrector


Usage
-----
First import type_corrector from the typecorrector module:

.. code:: python

    from typecorrector import type_corrector

Then you can decorate your functions with type_corrector

.. code:: python

    @type_corrector(int, int)
    def add(x,y):
        return x+y

    
    @type_corrector(float, float)
    def div(x,y):
        return x/y
       

A call to add(1,'2') will cast '2' to an int, since that is what we
specified as the type of the second paramater in the decorator.
We can also call div as div('10', '3'), and div will return 3.3333333333333335
as expected.

This decorator also works with \*args and \*\*kwargs

.. code:: python

    @type_corrector(int)
    def mult(*numbers):
        result = 1
        for num in numbers:
            result *= num
        return result


    @type_corrector(int)
    def kw_mult(**kwargs):
        first = kwargs.get('first')
        second = kwargs.get('second')
        third = kwargs.get('third')
        return first * second * third


This allows us to call the functions like this:

- mult('2', '3', '4') 
- kw_mult(first='2', second='3', third='4')

When looking at the function definitions of add, mult and kw_mult we can easily
see that the arguments are supposed to be integers.
By decorating the functions like this it should be a clear
hint what types we want the parameters to be passed in as, even though it 
allows some margin of error.


Known issues
------------
When calling help on a decorated function the parameters are not shown
correctly, instead it will just say <function name>(\*args, \*\*kwargs)
Also, when using inspect to get the argument specification with
inspect.getargspec or getting the source code from inspect.getsourcelines
it will fail.
Thanks to the functools.wraps decorator the docstring of a wrapped function
will still be shown correctly.
digicert_client 1.1.5
DigiCert, Inc. web API client library
License: MIT

digicert_client
---------------

This package facilitates programmatic access to the DigiCert, Inc. web APIs for DigiCert customers.
Currently supported actions include:

* Ordering of certificates
* Checking on order status
* Retrieving approved certificates

Customers must enable API access for their DigiCert account and generate an API key in order to use this package.
Contact `DigiCert Customer Support`_ to get started.

.. _DigiCert Customer Support: https://www.digicert.com/support/
custom-user-profiles 1.2.0
Create custom-user profiles easily
License: MIT

Quick start
-------------------


Add to ``INSTALLED_APPS`` setting

::

    INSTALLED_APPS = (
        # ...
        'custom_user',
        'custom_user_profiles
    )


Set `AUTH_USER_MODEL` setting

::

    AUTH_USER_MODEL = 'custom_user_profiles.CustomUser'


the `CustomUser` inherit from `AbstractEmailUser` model from [django-custom-user](https://github.com/jcugat/django-custom-user)

If you want to create your own custom user, extend `custom_user_profiles.models.AbstractCustomUser`.

::

    from custom_user_profiles.models import AbstractCustomUser

    class CustomUser(AbstractCustomUser):    
        # ...


Create your profile models

::

    from custom_user_profiles.models import Profile

    class Buyer(Profile):
        # ...

    class Seller(Profile):
        # ...


Usage
----------


::

    @login_required
    def view(request):
        profile = request.user.profile
        if request.user.is_seller:
            # ...


Also ``AbstractCustomUser`` provides a **chainable** ``QuerySet`` manager:

::

    from django.contrib.auth import get_user_model
    User = get_user_model()

    User.queryset.seller() # get all users with 'seller' profile
    User.queryset.buyer() # get all users with 'buyer' profile
    User.queryset.something() # raises django.core.exceptions.FieldError


| ``objects`` manager is still available and inherit from django's `BaseUserManager`
django-key-auth 1.2.1
Key based authentication for Django
License: MIT

django-key-auth
========================

Basic Usage
---------------


::

    @key_required()
    def view(request):
        key = request.key
        ...


Features
-------------


- Authentication per view.
- Authentication middleware.
- Authentication backend.
- Django's Permissions and Groups integrated.
- Per key black and white-lists based on client's IP address.
django-easy-response 1.0.1
Return HTTP responses in a easier way
License: MIT

=====================================
Django Simple Response
=====================================


Basic usage 
-----------


*settings.py*

:: 

    MIDDLEWARE_CLASSES = (
        ...
        # last on the list
        django_simple_response.middleware.SimpleResponseMiddleware,
    )


*views.py*

:: 

    def view(request):
        # return HTTP response with status code 200 (default)
        return

    def another_view(request):
        # return HTTP response with content and status code 401 
        return 401, 'Not authorized'

    def yet_another_view(request):
        # return JSON/JSONP response with content and default status code
        return {'foo': 'bar'}


In a nutshell, you can either return:

1. an object, which will be serialized into the response's content.
2. a tuple, which first element defines the status code and the second the content of the response.