The Simple, Lightweight User Group Services (SLUGS) library provides a simple web service that serves user/group membership data over a basic REST interface.
>>> import requests
>>> requests.get('http://127.0.0.1:8080/slugs').json()
{u'users': [u'Jane', u'John'], u'groups': [u'Male', u'Female', u'Human']}
>>> requests.get('http://127.0.0.1:8080/slugs/users').json()
{u'users': [u'Jane', u'John']}
>>> requests.get('http://127.0.0.1:8080/slugs/users/John').status_code
200
>>> requests.get('http://127.0.0.1:8080/slugs/users/John/groups').json()
{u'groups': [u'Male', u'Human']}
>>> requests.get('http://127.0.0.1:8080/slugs/users/John/groups/Male').status_code
200
SLUGS is built using CherryPy, a well established object-oriented web framework for Python. To run SLUGS, simply install the library and then:
$ slugs -c /path/to/config/file
For more information on SLUGS, check out the project Documentation.
You can install SLUGS via pip
:
$ pip install slugs
For more information, see Installation.
The SLUGS community has various forums and resources you can use: