semvec/pypi-packages huggingface dataset:
django-graph-auth 0.3.1
django-graph-auth is a Django application which provides simple mutations and queries for managing users with GraphQL.
License: MIT License
Keywords: django graphql api authentication jwt

django-graph-auth
=======================

django-graph-auth is a Django application which provides simple mutations and queries for managing users with GraphQL. It can register users, log in, reset users, and expose `JSON web tokens`_.

Documentation can be found on `GitHub`_.

.. _Django Rest Framework: http://www.django-rest-framework.org/

.. _JSON web tokens: http://getblimp.github.io/django-rest-framework-jwt/

.. _GitHub: https://github.com/morgante/django-graph-auth/blob/master/docs/api.md

Requirements
------------

This has only been tested with:

* Python: 3.5
* Django: 1.10

Setup
-----

Install from **pip**:

.. code-block:: sh

    pip install django-graph-auth

and then add it to your installed apps:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'graph_auth',
        ...
    )

You will also need to edit your base schema to import the mutations and queries, like this:

.. code-block:: python

	import graphene
	from graphene import relay, ObjectType

	import graph_auth.schema

	class Query(graph_auth.schema.Query, ObjectType):
	    node = relay.Node.Field()

	class Mutation(graph_auth.schema.Mutation, ObjectType):
	    pass

	schema = graphene.Schema(query=Query, mutation=Mutation)


Credits
-------

``django-graph-auth`` was created by Morgante Pell (`@morgante
<https://github.com/morgante>`_). It is based on `django-rest-auth`_.

.. _django-rest-auth: https://github.com/Tivix/django-rest-auth


History
=======

Pending
-------

* New release notes go here.

0.3.1 (2016-11-13)
-----------------

* Add installation dependencies. (https://github.com/morgante/django-graph-auth/pull/2)

0.3.0 (2016-10-16)
-----------------

* Add user changing functionality.

0.0.1 (2016-10-10)
-----------------

* Initial release
treeprinter 0.0.2
Python library for easy tree displaying
License: MIT License

Tree printer
============

This library provides a tree printer class for easy tree displaying

## Installation 
``` sh
$ pip install treeprinter
```

## Basic usage

### Printer instance
``` python
from treeprinter import TreePrinter

class Tree(object):
    def __init__(self, tag, children=None):
        self.children = children or []
        self.tag = tag

tree = Tree("animal", [
            Tree("cat"),
            Tree("dog", [Tree("chihuahua"), Tree("dalmatian")]),
            Tree("wolf")])

printer = TreePrinter('children', 'tag')
printer.pprint(tree)
```
```
             animal              
                |                
   ---------------------------   
  |             |             |  
 cat           dog          wolf 
                |                
           ----------            
          |          |           
      chihuahua  dalmatian       
```

### Printer decorator
You could also get the same result by decorating your class like so to implement the \_\_str\_\_ method
``` python
@TreePrinter('children', 'tag')
class Tree(object):
    def __init__(self, tag, children=None):
        self.children = children or []
        self.tag = tag

print(tree)
```


## Extensions
You can extend the library by implementing the base displayer
(see printers/json_printer.py)

``` python
from treeprinter import JsonPrinter

printer = JsonPrinter()
json = {
    "fruits": ["Apple", "Banana", "Pear"],
    "presidents": {
        "France": ["Sarkozy", "Hollande"],
        "USA": ["Trump", "Obama"]
    },
    "star": "Sun"
}
printer.pprint(json)
```

```
                                     {}                     
                                      |                     
                   --------------------------------------   
                  |                         |            |  
            {presidents}                [fruits]       star 
                  |                         |            |  
          ----------------           --------------     Sun 
         |                |         |       |      |        
     [France]           [USA]     Apple  Banana  Pear       
         |                |                                 
     ---------         ------                               
    |         |       |      |                              
 Sarkozy  Hollande  Trump  Obama                            
```