Skip to content

eliaxelang007/Periodic-Table-Rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published