Periodic Table for Julians! 🔥
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src make Element immutable Sep 16, 2018
test
.codecov.yml PeriodicTable.jl generated files. Mar 14, 2018
.gitignore PeriodicTable.jl generated files. Mar 14, 2018
.travis.yml Removed as per build suggestion for Julia 1.0 Sep 8, 2018
LICENSE.md PeriodicTable.jl generated files. Mar 14, 2018
README.md updated as per comments-part3 Sep 16, 2018
REQUIRE unitful quantities Sep 15, 2018
appveyor.yml PeriodicTable.jl generated files. Mar 14, 2018

README.md

License: MIT Build Status codecov.io GitHub contributors GitHub issues GitHub version

ForTheBadge built-with-science

PeriodicTable.jl

A very simple package for accessing elements in the Periodic Table! 🔥

Installation

Since PeriodicTable is registered in METADATA.jl, you can directly install it like,

julia> using Pkg
julia> Pkg.add("PeriodicTable")

How it works?

PeriodicTable.jl provides a Julia interface to a small database of element properties for all of the elements in the periodic table. In particular PeriodicTable exports a global variable called elements, which is a collection of Element data structures.

julia> using PeriodicTable

julia> elements
Elements(…119 elements…):
H                                                  He
Li Be                               B  C  N  O  F  Ne
Na Mg                               Al Si P  S  Cl Ar
K  Ca Sc Ti V  Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr
Rb Sr Y  Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I  Xe
Cs Ba    Hf Ta W  Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn
Fr Ra    Rf Db Sg Bh Hs Mt Ds Rg Cn Nh Fl Mc Lv Ts Og
Uue                                                   
      La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu    
      Ac Th Pa U  Np Pu Am Cm Bk Cf Es Fm Md No Lr

You can look up elements by name (case-insensitive) via elements["oxygen"], by symbol via elements[:O], or by number via elements[8], for example.

Each element has fields name, appearance, atomic_mass, boil, category, color, density, discovered_by, melt, molar_heat, named_by, number, period, phase, source, spectral_img, summary, symbol, xpos, ypos, shells.

All physical quantities are unitful.

The data is pretty-printed when you look up an element in the Julia REPL. For example:

julia> elements["oxygen"]
Oxygen (O), number 8:
        category: diatomic nonmetal
     atomic mass: 15.999 u
         density: 1.429 g/cm³
   melting point: 54.36 K
   boiling point: 90.188 K
           phase: Gas
          shells: [2, 6]
e⁻-configuration: 122p⁴
         summary: Oxygen is a chemical element with symbol O and atomic number 8. It is a member of the chalcogen group on the periodic table and is a highly reactive nonmetal and oxidizing agent that readily forms compounds (notably oxides) with most elements. By mass, oxygen is the third-most abundant element in the universe, after hydrogen and helium.
   discovered by: Carl Wilhelm Scheele
        named by: Antoine Lavoisier
          source: https://en.wikipedia.org/wiki/Oxygen
  spectral image: https://en.wikipedia.org/wiki/File:Oxygen_spectre.jpg
 

Alternatively, you may want to get a list of elements,

julia> elements[1:4]
4-element Array{PeriodicTable.Element,1}:
 Element(Hydrogen) 
 Element(Helium)   
 Element(Lithium)  
 Element(Beryllium)

Data by

The data used for this package has been pulled up in parts from here. Some information has been (and will be) added over time.

Developed together with

Facing issues? 😱

  • Open a PR with the detailed expaination of the issue
  • Reach me out here