Information on chemical elements and their isotopes

Latest version pipeline status Documentation unsafe forbidden License

Mendeleev

Mendeleev is a crate containing all known chemical elements as an enum and as a list, as well as methods that return some properties for each of them.

Example

Get data on a specific element

```rust use mendeleev::Element;

let element = Element::Si; asserteq!(element.atomicnumber(), 14); asserteq!(element.name(), "Silicon"); asserteq!(format!("{}", element.electronic_configuration()), "[Ne] 3s² 3p²"); ```

Example

Search the list of elements

```rust use mendeleev::Element;

// Find the element with the highest value for a given property let highestmeltingpoint = Element::iter().reduce(|acc, e| { core::cmp::maxby(acc, e, |e1, e2| { e1.meltingpoint() .unwrapor(0.0) .totalcmp(&e2.meltingpoint().unwrapor(0.0)) }) }); asserteq!(highestmelting_point, Some(Element::C));

// Iterate through the elements with no known year of discovery let mut ancientelements = Element::iter() .filter(|e| matches!(e.yeardiscovered(), mendeleev::YearDiscovered::Ancient)); asserteq!(ancientelements.next(), Some(Element::C)); asserteq!(ancientelements.next(), Some(Element::Al));

// Find an element by name let iron = Element::iter().find(|e| e.name().eqignoreasciicase("iron")); asserteq!(iron, Some(Element::Fe));

```

It also contains most of the known isotopes for each element (naturally occurring, synthetic, or theoretical), accessible via a similar API as the elements themselves.

Available data

Elements

Isotopes

Features

The data from this crate comes from the PyPI package mendeleev, and some of it was verified from other sources. The end goal is to port all the data from that package and more, and make it all available as compile-time constants and selectable via feature flags. Note that this crate is not maintained by the same authors as the PyPI package.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under either of

at your option.