Getting started

Elementable comes with standard elements defined, but there are a number of ways to customize the Elements class. Please see Customizing elements for more.

For immediate usage, import Elements. Elements can be retrieved with Elements():

In [1]: import elementable as elm

In [2]: h = elm.Elements(atomic_number=1)

In [3]: print(h)
Element(name='hydrogen', symbol='H', atomic_number=1, mass=1.00782503223, period=1, group=1, covalent_radius=0.31)

Elements() accepts all attributes defined on an Element, including floating point numbers. In the standard formulation, these get rounded to 4 decimal places.

In [4]: elm.Elements(mass=1.0078)
Out[4]: Element(name='hydrogen', symbol='H', atomic_number=1, mass=1.00782503223, period=1, group=1, covalent_radius=0.31)

Each standard element is also available as an attribute.

In [5]: elm.Elements.Na
Out[5]: Element(name='sodium', symbol='Na', atomic_number=11, mass=22.989769282, period=3, group=1, covalent_radius=1.66)

Elements can also be directly retrieved from various registries of attributes. These can return single elements, such as from the atomic number:

In [6]: elm.Elements.registry.atomic_number[1]
Out[6]: Element(name='hydrogen', symbol='H', atomic_number=1, mass=1.00782503223, period=1, group=1, covalent_radius=0.31)

Or multiple elements, such as from the period.

In [7]: elm.Elements.registry.period[1]
Out[7]: 
(Element(name='hydrogen', symbol='H', atomic_number=1, mass=1.00782503223, period=1, group=1, covalent_radius=0.31),
 Element(name='helium', symbol='He', atomic_number=2, mass=4.00260325413, period=1, group=18, covalent_radius=0.28))

Source

The data in the standard package are sourced, with much gratitude, from qcelemental version 0.23.0. Please see the documentation for qcelemental for full details. The covalent radii are obtained from Alvarez 2008.