Skip to main content

A package to analyze chemical formulas

Project description

chembox

example workflow codecovDocumentation Status

Introduction

chembox is a package for molecular information calculator based on empirical formulas of chemicals in raw text. It is designed to intelligently process text input containing the chemical formula and provide associated information on the inquired molecule. It is able to provide the molar mass, check a formula's validity, and provide a balanced combustion equation if the input is combustible. This tool can be utilized for various educational and research purposes for simple and fast information retrieval.

We are using a dataset that contains established element data properties from this site.

Installation

chembox is developed and tested on Python 3.10. You can install it from PyPi via pip:

$ pip install chembox

Usage

The package includes 4 functions for solving chemistry problems:

  • get_elementsa parser that takes a chemical formula in string format and returns a dictionary that contains the elements and their respective count.

  • is_valid: a checker that returns a boolean indicating whether a given input is chemically reasonable.

  • get_molec_props: a method that takes a chemical formula in string format and returns a dataframe with various useful properties of each element in the formula.

  • get_combustion_equation: a method that takes a text chemical formula that only contains carbon (C) and hydrogen (H) and outputs a balanced equation resulting from combustion.

A detailed example of usage can be found here.

Dataset

In order to be able to perform some of the functions above, a dataset will need to be used that contains various atomic properties of the elements in the periodic table. The data can be found in the Chembox repo here which was sourced from here. Please note that we do not take credit for the dataset, it is merely for use with our functions.

Fitting into the Python ecosystem

A similar package chemsolve is available online that employs a similar string-parsing design and molar mass calculation.

What we do differently:

  • We include a dataframe of the molecule properties to give the user enhanced functionality and insights.

  • chemsolve accepts user-defined reactions. In our package, we include methods for automated combustion equation generation and balancing.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

chembox is licensed under the terms of the MIT license.

Contributors

The contributors of this project are Wilfred Hass, Vikram Grewal, Luke Yang, and Nate Puangpanbut.

Credits

chembox was created with cookiecutter and the py-pkgs-cookiecutter template.

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

chembox-1.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

chembox-1.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file chembox-1.1.0.tar.gz.

File metadata

  • Download URL: chembox-1.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for chembox-1.1.0.tar.gz
Algorithm Hash digest
SHA256 468ee36b87cb727f322a4992bd3ab9ef4b9702c7a1725ae30c4cb92b9e5e4ea0
MD5 3b2c202fd8963fc792eb56c16249cdde
BLAKE2b-256 fe075571568f58a6e5dc5f78b6f4500e4384729124b144635da389bec4b8fa10

See more details on using hashes here.

File details

Details for the file chembox-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: chembox-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for chembox-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f08099bbb2e2d5762d8bf86fd4da507898657956e4993e9d5efc614cce16831
MD5 9c29886b530d3917dced468d7d555005
BLAKE2b-256 dc73bf54bc38192f7eb92d343f5709dfd50328788056fdfdc6f8c9c2cde5ac48

See more details on using hashes here.

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