Information on chemical elements and their isotopes
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.
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²"); ```
Search the list of elements
```rust use mendeleev::{Element, Kelvin};
// 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(Kelvin(0.0)) .totalcmp(&e2.meltingpoint().unwrapor(Kelvin(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.
serde
const
or 'static
Display
build.rs
file. All the data is directly in the codeThe data from this crate comes from the following sources:
Density, electron affinity, and ionization energy:
Other properties:
Note that this crate is not maintained by the same authors as the PyPI package.
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.
Licensed under either of
at your option.