pdg.api module

PDG API top-level class.

class pdg.api.PdgApi(database_url, pedantic=False)[source]

Bases: object

property default_edition

Return the default edition for this database.

doc_data_type_keys(as_text=True)[source]

Get list of data type keys.

The PDG API uses a data type key as part of the PDG Identifier metadata to denote the kind of information described by a given identifier. These data type keys can be used to select desired particle properties in methods such as PdgParticle.properties().

doc_data_type_keys() returns a list of all possible data type key values. When as_text is True (default), the list is returned as a formatted string suitable for printing. Otherwise, a list of dict is returned, where each dict describes a possible key value.

doc_key_value(table_name, column_name, key)[source]

Get documentation on the meaning of key values or flags used in the PDG API.

doc_value_type_keys(as_text=True)[source]

Get list of summary value type keys.

For each summary value, the value type key specifies how this value was derived, e.g. whether it is the result of a weighted average, of a fit, etc.

doc_summary_value_type_keys() returns a list of all possible summary value type key values. When as_text is True (default), the list is returned as a formatted string suitable for printing. Otherwise, a list of dict is returned, where each dict describes a possible key value.

property editions

List of all editions of the Review for which the database has data.

get(pdgid, edition=None)[source]

Return PdgData object for given PDG Identifier.

The get method checks what data the PDG Identifier describes and returns an object of the most appropriate class derived from the PdgData base class. For example, for a PDG Identifier describing a particle, an object of class PdgParticle is returned, while for a branching fraction a PdgBranchingFraction object is returned.

edition can be set to a specific edition, from which the data should later be retrieved.

get_all(data_type_key=None, edition=None)[source]

Return iterator over all PDG Identifiers / quantities. Returns PdgProperties or derived classes.

If data_type_key is set, only quantities of the given type are returned. See doc_data_type_keys() for the list of possible data type codes.

edition can be set to a specific edition, from which data should later be retrieved.

get_particle_by_mcid(mcid, edition=None)[source]

Get particle by its MC ID.

edition can be set to a specific edition, from which data should later be retrieved.

get_particle_by_name(name, case_sensitive=True, edition=None)[source]

Get particle by its name.

case_sensitive can be set False to indicate that the particle name should be considered not case-sensitive.

edition can be set to a specific edition, from which data should later be retrieved.

get_particles(edition=None)[source]

Return iterator over all particles.

edition can be set to a specific edition, from which data should later be retrieved.

info(key)[source]

Return metadata info specified by key.

info_keys()[source]

Return list of all metadata keys.