The ACCRE Administrative Database provides a source of truth for ACCRE account information describing what resources users and groups should be able to access and with what resource limits, as well as keeping track of certain aspects of the ACCRE infrastructure.

The database submodules primarily consist of a robust client class providing convenience methods to perform queries without having to write SQL, a model providing a definition of the tables used in the administrative database, a SQLAlchemy engine module to provide the connection, and a utility function module.

Database Client

The database client class can be used as follows:

>>> from accre.database import AdminDBClient
>>> client = AdminDBClient()
>>> client.user_info('fe00c00')
    'vunetid': 'fe00c00',
    'user_id': 9100,
    'group': 'fe_accre_lab',
    'email': '',
    'first_name': 'Michael',
    'last_name': 'Hughes',
    'attended_unix': False,
    'attended_cluster': False,
    'attended_slurm': False,
    'active': True,
    'join_date': datetime.datetime(2018, 2, 13, 10, 40, 4, 341421),
    'group_id': 20811

Note that for historical reasons the older name for the client, VandyAdminDBClient, is a reference to the AdminDBClient class and the two may be used interchangably.

As the AdminDBClient class contains many methods, it is broken into multiple submodules and the methods are combined together into a single class by inheriting mixin classes.

Module API Reference

SQLAlchemy based convenience wrappers and classes around ACCRE administrative databases, as well as the model for the administrative database.