DBS3 Client

raw JSON →
4.0.19 verified Fri May 01 auth: no python

Client library for the DBS3 (Data Bookkeeping Service) API, used in CMS (Compact Muon Solenoid) data management. Version 4.0.19 interacts with DBS3 server instances to query dataset, file, and block metadata. Release cadence is irregular.

pip install dbs3-client
error ImportError: No module named dbs.apis.dbsClient
cause Package not installed or installed as a different name (dbs-client vs dbs3-client).
fix
Run 'pip install dbs3-client' or 'pip install dbs-client' and ensure the environment is correct.
error 'DbsApi' object has no attribute 'listDatasets'
cause Wrong URL or authentication; also some API methods require specific parameters.
fix
Verify URL, authentication, and method signature. Use 'api.listDatasets(dataset=...)' with correct key and value.
deprecated The package dbs3-client is deprecated in favor of dbs-client (merged repo). New versions may break imports.
fix Transition to dbs-client and update imports to dbs.apis.dbsClient as this remains the same.
breaking API URL must include trailing slash or specific path; missing path causes HTTP 400.
fix Use full URL with '/dbs/prod/global/DBSReader' as in quickstart.
gotcha Many methods return lists of dictionaries; assume empty list on error (no exception raised for empty results).
fix Check if the returned list is empty before accessing elements.

Creates a DbsApi instance and fetches datasets matching a pattern.

from dbs.apis.dbsClient import DbsApi
api = DbsApi(url='https://cmsweb.cern.ch/dbs/prod/global/DBSReader')
datasets = api.listDatasets(dataset='/Muon/Run2016B-23Sep2016-v1/MINIAOD')
print(datasets)