periodic-table-rs

Crates.ioperiodic-table-rs
lib.rsperiodic-table-rs
version0.1.2
sourcesrc
created_at2022-12-19 01:38:56.864615
updated_at2022-12-24 00:28:03.992331
descriptionA chemistry library written in Rust.
homepagehttps://github.com/eliaxelang007/Periodic-Table-Rs
repositoryhttps://github.com/eliaxelang007/Periodic-Table-Rs
max_upload_size
id740694
size1,818,228
Eli (eliaxelang007)

documentation

README

About

This is a Rust library for chemistry.

Installation

Usage

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);
}

Documentation

The documentation for this project is in its crates.io page. Here's a quick link to it.

Additional information

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

Commit count: 14

cargo fmt