Skip to main content

An API for interacting with the Tahrir database

Project description

Tahrir-API

API for interacting with the Tahrir database. Based on the Tahrir database model written by Ralph Bean. There are two classes that can be used in this module. The first is the TahrirDatabase class located in tahrir_api.dbapi and the second is the database model located in tahrir_api.model. The TahrirDatabase class is a high level way to interact with the database. The model is used for a slightly more low level way of interacting with the database. It allows for custom interactions with the database without having to use the TahrirDatabase class.

Creating a Badge

This is an example of creating a badge via Tahrir-API:

from tahrir_api.dbapi import TahrirDatabase


db = TahrirDatabase('backend://badges:badgesareawesome@localhost/badges')

origin = 'http://foss.rit.edu/badges'
issuer_name = 'FOSS@RIT'
org = 'http://foss.rit.edu'
contact = 'foss@rit.edu'

issuer_id = db.add_issuer(origin, issuer_name, org, contact)

badge_name = 'fossbox'
image = 'http://foss.rit.edu/files/fossboxbadge.png'
desc = 'Welcome to the FOSSBox. A member is you!'
criteria = 'http://foss.rit.edu'

db.add_badge(badge_name, image, desc, criteria, issuer_id)

Awarding a Badge

This is an example of awarding a badge via Tahrir-API:

from tahrir_api.dbapi import TahrirDatabase


db = TahrirDatabase('backend://badges:badgesareawesome@localhost/badges')

badge_id = 'fossbox'
person_email = 'person@email.com'
issued_on = None

db.add_person(person_email)
db.add_assertion(badge_id, person_email, issued_on)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tahrir-api-0.7.2.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

tahrir_api-0.7.2-py2.7.egg (29.8 kB view details)

Uploaded Source

File details

Details for the file tahrir-api-0.7.2.tar.gz.

File metadata

  • Download URL: tahrir-api-0.7.2.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tahrir-api-0.7.2.tar.gz
Algorithm Hash digest
SHA256 1579b7be27315c5ba0671dcb0faf353cb0494028bfeb7c92e8d4e7f1fa3c1c7f
MD5 3b34295a7f060ba78001c7c3e2d238a6
BLAKE2b-256 0ad1e8efcb1324400cdd1b6b9443d8996ac501cfd889ad6b580f0cdb68ea6ee5

See more details on using hashes here.

File details

Details for the file tahrir_api-0.7.2-py2.7.egg.

File metadata

File hashes

Hashes for tahrir_api-0.7.2-py2.7.egg
Algorithm Hash digest
SHA256 7400b60e55c5beb49ac88c56484f0d4d67515e6b5c9fbae061d75e7e7c5a7bc3
MD5 2f9794247a95f9999abc98a0bd65f411
BLAKE2b-256 bc138d535d87182fe5c2ca765db91ce81fca79de93b4f2a68004fa655a5e469a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page