Core classes for the periodic table.
The periodic table with attributes for each element.
Note
PeriodicTable is not a singleton class. Use periodictable.element to access the common table.
Element properties such as name, symbol, mass, density, etc.
Isotope properties such as mass, density and neutron scattering factors.
Ion properties such as charge.
Elements are accessed from a periodic table using table[number], table.name or table.symbol where symbol is the two letter symbol. Individual isotopes are accessed using element[isotope]. Individual ions are references using element.ion[charge]. There are presently no properties specific to both ion and isotope.
Helper functions:
Delay loading the element attributes until they are needed.
Return the path to the periodic table data files.
Define external variables for each element in namespace.
Tests for different types of structure components.
Returns the common periodic table.
Return the same item from a different table.
See also
Adding properties for details on extending the periodic table with your own attributes.
Custom tables for details on managing your own periodic table with custom values for the attributes.
Bases: object
Periodic table entry for an individual ion. An ion is associated with an element. In addition to the element properties (symbol, name, atomic number), it has specific ion properties (charge). Properties not specific to the ion (i.e., charge) are retrieved from the associated element.
X-ray scattering properties for the elements.
Bases: object
Periodic table entry for an individual isotope. An isotope is associated with an element. In addition to the element properties (symbol, name, atomic number), it has specific isotope properties (isotope number, nuclear spin, relative abundance). Properties not specific to the isotope (e.g., x-ray scattering factors) are retrieved from the associated element.
Natural abundance.
| Parameters : | isotope : Isotope |
|---|---|
| Returns : | abundance : float | % |
Element density for natural abundance. For isotopes, return the equivalent density assuming identical inter-atomic spacing as the naturally occuring material.
| Parameters : |
|
|---|---|
| Returns : | density : float | g·cm-3 |
Atomic weight.
| Parameters : | isotope : Isotope |
|---|---|
| Returns : |
|
Neutron scattering factors, nuclear_spin and abundance properties for elements and isotopes.
Bases: object
Periodic table entry for an element. An element is a name, symbol and number, plus a set of properties. Individual isotopes can be referenced as element[isotope_number]. Individual ionization states can be referenced by element.ion[charge].
Add an isotope for the element.
| Parameters : |
|
|---|---|
| Returns : | None |
X-ray emission lines for various elements, including Ag, Pd, Rh, Mo, Zn, Cu, Ni, Co, Fe, Mn, Cr and Ti. K_alpha is the average of K_alpha1 and K_alpha2 lines.
X-ray emission lines for various elements, including Ag, Pd, Rh, Mo, Zn, Cu, Ni, Co, Fe, Mn, Cr and Ti. K_alpha is the average of K_alpha1 and K_alpha2 lines.
X-ray emission lines for various elements, including Ag, Pd, Rh, Mo, Zn, Cu, Ni, Co, Fe, Mn, Cr and Ti. K_alpha is the average of K_alpha1 and K_alpha2 lines.
X-ray emission lines for various elements, including Ag, Pd, Rh, Mo, Zn, Cu, Ni, Co, Fe, Mn, Cr and Ti. K_alpha is the average of K_alpha1 and K_alpha2 lines.
covalent radius: average atomic radius when bonded to C, N or O.
covalent radius: average atomic radius when bonded to C, N or O.
covalent radius: average atomic radius when bonded to C, N or O.
Add crystal_structure property to the elements.
Element density for natural abundance. For isotopes, return the equivalent density assuming identical inter-atomic spacing as the naturally occuring material.
| Parameters : |
|
|---|---|
| Returns : | density : float | g·cm-3 |
Estimated interatomic distance from atomic weight and density. The distance between isotopes is assumed to match that between atoms in the natural abundance.
| Parameters : |
|
|---|---|
| Returns : |
|
Interatomic distance is computed using:
with units:
List of all isotopes
Magnetic Form Fators. These values are directly from CrysFML.
Atomic weight.
| Parameters : | isotope : Isotope |
|---|---|
| Returns : |
|
Neutron scattering factors, nuclear_spin and abundance properties for elements and isotopes.
Estimate the number density from atomic weight and density. The density for isotopes is assumed to match that of between atoms in natural abundance.
| Parameters : |
|
|---|---|
| Returns : |
|
X-ray scattering properties for the elements.
Bases: object
Defines the periodic table of the elements with isotopes. Individidual elements are accessed by name, symbol or atomic number. Individual isotopes are addressable by element[mass_number] or elements.isotope(element name), elements.isotope(element symbol).
For example, the following all retrieve iron:
>>> from periodictable import *
>>> print elements[26]
Fe
>>> print elements.Fe
Fe
>>> print elements.symbol('Fe')
Fe
>>> print elements.name('iron')
Fe
>>> print elements.isotope('Fe')
Fe
To get iron-56, use:
>>> print elements[26][56]
56-Fe
>>> print elements.Fe[56]
56-Fe
>>> print elements.isotope('56-Fe')
56-Fe
Deuterium and tritium are defined as ‘D’ and ‘T’. Some neutron properties are available in elements[0].
To show all the elements in the table, use the iterator:
>>> from periodictable import *
>>> for el in elements: # lists the element symbols
... print el.symbol,el.name
n neutron
H hydrogen
He helium
...
Uuh ununhexium
Note
Properties can be added to the elements as needed, including mass, nuclear and X-ray scattering cross sections. See section Adding properties for details.
Lookup the element or isotope in the periodic table. Elements are assumed to be given by the standard element symbols. Isotopes are given by number-symbol, or ‘D’ and ‘T’ for 2-H and 3-H.
| Parameters : |
|
|---|---|
| Returns : | Element |
| Raises : | ValueError if element or isotope is not defined. |
For example, print the element corresponding to ‘58-Ni’.
>>> import periodictable
>>> print periodictable.elements.isotope('58-Ni')
58-Ni
Print a list of elements with the given set of properties.
| Parameters : |
|
|---|---|
| Returns : | None |
For example, print a table of mass and density.
>>> from periodictable import elements
>>> elements.list('symbol','mass','density',
... format="%-2s: %6.2f u %5.2f g/cm^3")
H : 1.01 u 0.07 g/cm^3
He: 4.00 u 0.12 g/cm^3
Li: 6.94 u 0.53 g/cm^3
...
Bk: 247.00 u 14.00 g/cm^3
Lookup an element given its name.
| Parameters : |
|
|---|---|
| Returns : | Element |
| Raises : | ValueError if element does not exist. |
For example, print the element corresponding to ‘iron’:
>>> import periodictable
>>> print periodictable.elements.name('iron')
Fe
Lookup the an element in the periodic table using its symbol. Symbols are included for ‘D’ and ‘T’, deuterium and tritium.
| Parameters : |
|
|---|---|
| Returns : | Element |
| Raises : | ValueError if the element symbol is not defined. |
For example, print the element corresponding to ‘Fe’:
>>> import periodictable
>>> print periodictable.elements.symbol('Fe')
Fe
Delayed loading of an element property table. When any of property is first accessed the loader will be called to load the associated data. The help string starts out as the help string for the loader function. The attribute may be associated with any of Isotope, Ion, or Element. Some properties, such as mass, have both an isotope property for the mass of specific isotopes, as well as an element property for the mass of the collection of isotopes at natural abundance. Set the keyword flags element, isotope and/or ion to specify which of these classes will be assigned specific information on load.
Define external variables for each element in namespace. Elements are defined both by name and by symbol.
This is called from __init__ as:
elements = core.default_table()
__all__ += core.define_elements(elements, globals())
| Parameters : |
|
|---|---|
| Returns : | [string, ...] A sequence listing the names defined. |
Note
This will only work for namespace globals(), not locals()!
Locate the directory for the tables for the named extension.
| Parameters : |
|
|---|---|
| Returns : | string Path to the data. |
Return the default table unless a specific table has been requested.
This is to be used in a context like:
def summary(table=None):
table = core.default_table(table)
...
Search for the same element, isotope or ion from a different table
Return true if value is an element, isotope or ion
Return true if value is an element or ion in natural abundance
Return true if value is an isotope or isotope ion.
Return true if value is a specific ion of an element or isotope