Skip to content
forked from unioslo/pybofh

Python version of bofh (BrukerOrganisering for Hvermansen), Cerebrum front-end

License

Notifications You must be signed in to change notification settings

leondutoit/pybofh

 
 

Repository files navigation

pybofh

pybofh is an interactive XMLRPC client for a Cerebrum.modules.bofhd server. If you don't know what Cerebrum is, you probably don't want this.

Install

We recommend that you use virtualenv to install pybofh.

python setup.py install

Use

pybofh --help
python -m bofh --help

Documentation

You'll have to build the pybofh documentation yourself (for now).

python setup.py build_sphinx
cd build/sphinx/html
python3 -m http.server

Then go to http://localhost:8000/.

For other documentation formats, see docs/README.md and docs/Makefile.

Module usage

import bofh
from getpass import getuser, getpass

# Get a client by connecting to bofhd
url = 'https://example.org:8000'
cacert = '/path/to/ca.pem'
client = bofh.connect(url=url, cert=cacert)

# You'll need to authenticate to access restricted commands
client.login(getuser(), getpass())

# Call commands on the client object
try:
    # formatted output
    client.user.info('foo')

    # structured output
    client.run_command('user_info', 'foo')
finally:
    client.logout()

About

Python version of bofh (BrukerOrganisering for Hvermansen), Cerebrum front-end

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%