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 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

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

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.2.5.tar.gz (27.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for tahrir-api-0.2.5.tar.gz
Algorithm Hash digest
SHA256 411a054972ac6a35c99cfe4e599dd0551da1e2ee3d79eaeebab8c4fd6310c2c6
MD5 417c332e1fbfe1f07e640affdeeebe21
BLAKE2b-256 83aff00ab317153d733f4c4db1822a6dc0fddc9b12a4bcfb654ed4d024227958

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