Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snehalbaghel/badgrclient

A python library for Badgr APIs
https://github.com/snehalbaghel/badgrclient

Last synced: about 2 months ago
JSON representation

A python library for Badgr APIs

Awesome Lists containing this project

README

        

# Quickstart

**badgrclient** is a python library for [Badgr](https://github.com/concentricsky/badgr-server) APIs

#### Installation

```bash
pip install badgrclient
```

### Docs

https://badgrclient.readthedocs.io/

#### Usage

Instantiate a client

```python
from badgrclient import BadgrClient

client = BadgrClient('username', 'password', 'client_id')
```

Fetch your entities with the client or by giving an entityId.

```python
>>> my_issuers = client.fetch_issuer()
[Issuer(7fde21f03a30dfg), Issuer(de21ce2d52df0)]

>>> baby_badger = client.fetch_badgeclass('')[0]
BadgeClass()
```

Use member functions to perform actions on the entity

```python
>>> baby_badger.issue('[email protected]')
Assertion()
```

Or directly import a model and get going

```python
>>> from badgrclient import Assertion
>>> janes_assertion = Assertion(client, eid='')
Assertion()

>>> janes_assertion.revoke('Revocation Reason')
```