Skip to content

Python Low Level API

Dmitry Romanov edited this page Nov 20, 2015 · 12 revisions

Low Level Python API

Low level python API allows one to works with CCDB entities through python objects. So the code looks like this:

 # read directory
    directory = provider.get_directory("/test/test_vars")
    print(directory.name)           # Name of this directory
    print(directory.path)           # Full path

    for table in directory.type_tables:
        print(table.path)
        print(" ".join([column.name for column in table.columns]))
    
    table = provider.get_type_table("/test/test_vars/test_table2")

The main readout example file can be found at:
$CCDB_HOME/python/example_llapi_readout.py

The data model (where you can see class fields and read comments) is at $CCDB_HOME/python/ccdb/model.py

The API functions are collected in provider class. You can see them here: $CCDB_HOME/python/ccdb/provider.py

(Links follow to GitHub pages of the files)