Crates.io | periodic-table-rs |
lib.rs | periodic-table-rs |
version | 0.1.2 |
source | src |
created_at | 2022-12-19 01:38:56.864615 |
updated_at | 2022-12-24 00:28:03.992331 |
description | A chemistry library written in Rust. |
homepage | https://github.com/eliaxelang007/Periodic-Table-Rs |
repository | https://github.com/eliaxelang007/Periodic-Table-Rs |
max_upload_size | |
id | 740694 |
size | 1,818,228 |
This is a Rust library for chemistry.
Here's some sample code that shows how you can get the atomic mass, boiling point, and density of hydrogen.
/* Note: These snippets are untested */
use periodic_table_rs::HYDROGEN;
fn main() {
println!("{}", HYDROGEN.atomic_mass);
println!("{}", HYDROGEN.boiling_point);
println!("{}", HYDROGEN.density);
}
/* Or, you can do this. */
use periodic_table_rs::{Element, PERIODIC_TABLE};
fn main() {
const HYDROGEN: Element = PERIODIC_TABLE[0];
println!("{}", HYDROGEN.atomic_mass);
println!("{}", HYDROGEN.boiling_point);
println!("{}", HYDROGEN.density);
}
The documentation for this project is in its crates.io page. Here's a quick link to it.
The element data in this library primarily came from PubChem with some of its missing fields filled in by the data from the Royal Society of Chemistry.
The combined and parsed element data from both these sources is in this json file and you can use it in your own projects if all you need is the raw element data :D