Skip to main content

Library for handling chemical formulas

Project description

Chela

Chela is a Python library to handle chemical formula.

Installation

Use the package manager pip to install Chela

pip install chela

Usage

From bash:

# Check correctness of chemical formula
python3 -m chela -c CHEMICAL_FORMULA

# Transform a csv file with a column containing the formulas
#into a dataframe with atomic symbols as columns and save it as a csv file
python3 -m chela -d FILE.csv NEW_FILE.csv

From python script:

import chela as cl

# check chemical formula with a function
cl.check_formula(CHEMICAL_FORMULA)

import pandas as pd

# check chemical formula with a pandas extensions
pd.DataFrame().chela.check_formula(CHEMICAL_FORMULA)

# Transform a csv file with a column containing the formulas
#into a dataframe with atomic symbols as columns
dataframe = cl.csv_to_dataframe(FILE.csv)

dataframe = pd.DataFrame().chela.csv_to_dataframe(FILE.csv)

# Drop formulas contaning elements with atomic number greater than Z
dataframe = dataframe.chela.drop_heavy_elements(Z)

License

MIT

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

chela-1.0.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

chela-1.0.0-py3-none-any.whl (7.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