Git Product home page Git Product logo

periodictable.jl's Introduction

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

ForTheBadge built-with-science

PeriodicTable.jl

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

Installation

Since PeriodicTable is registered in Julia's General Registry, you can readily install it with

] add PeriodicTable

Usage

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)

A nice interactive visualization of the periodic table, based on PeriodicTable.jl, can be found here.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.