Skip to main content

A lightweight package with the periodic table of the elements

Project description

License Codecov Azure

Overview

Element is an extremely lightweight package that defines the elements of the periodic table and allows them to be accessed by symbol, name, atomic number, or mass. It has zero dependencies outside of the Python Standard Library.

Warning

Ele is still in early development (0.x releases). The API may change unexpectedly.

Usage

Ele only supports a few modes of use. You can retrieve an element from the symbol, the name, the atomic number, or the mass (in amu):

import ele
na = ele.element_from_symbol("Na")
na = ele.element_from_name("sodium")
na = ele.element_from_atomic_number(11)
na = ele.element_from_mass(22.990)

The mass is rounded to a single decimal before comparison. If you wish to retrieve the element with the mass closest to the specified value you may use the exact=False keyword.

Each Element has four attributes which can be accessed (as demonstrated below for na):

na.name
na.symbol
na.atomic_number
na.mass

The elements can also be accessed by symbol as follows:

import ele
na = ele.Elements.Na

Installation

Install via pip:

pip install ele

or conda:

conda install -c conda-forge ele

Installation from source is also an option:

git clone git@github.com/rsdefever/ele.git
cd ele
pip install .

Data Sources

Complete details of the sources are provided here

Credits

Development of Ele was supported by the National Science Foundation under grant NSF Grant Number 1835874. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ele-0.2.0.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

ele-0.2.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page