A Python package which gives IUPAC names of chemical compounds, classifies them and more.
Project description
Carbonpy
A module which names straight/branched chain organic compounds, suggests conversions from one type to another, etc.
Usage-
Naming compounds-
Instantiate the class Namer()
, which takes a string which contains the hydrocarbon (condensed form) and then call it with a method named analyser()
to get the IUPAC name of the compound.
Example:
a = Namer('CH~CH')
a.analyser()
>>> Ethyne
Due to limitations in expressing a hydrocarbon easily, we have selected this path
Single bond:- -
Double bond:- =
Triple bond:- ~
Branches:- -([compound] (more branches...))([another branch from same carbon])- and so on
(Branches support coming soon)
You can also get the molecular formula of the compound:
compound = Namer('CH~C-C~C-CH=C=C=CH2')
compound.molecular_formula()
>>> C₈H₄
Example- 2-Methylpropane would be expressed as (once branches are supported):
a = Namer('CH3-CH(CH3)-CH3').analyser()
>>> 2-Methylpropane
Will support naming with functional groups in the future.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file carbonpy-0.52.tar.gz
.
File metadata
- Download URL: carbonpy-0.52.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9594369c6b2bfb2bb2d717e0eda3eaddee1f3a170a103da8f7b1ffcbffbcf5ab |
|
MD5 | 8b8b8ecb277ad9b916de41a185b2c222 |
|
BLAKE2b-256 | 660a62e5a14fe84267fb7c674be0ffffb9d71c20bed8c815a6769fb17d119940 |
File details
Details for the file carbonpy-0.52-py3-none-any.whl
.
File metadata
- Download URL: carbonpy-0.52-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fffc6b798a1f92bfe722c7cfd6ba38fe88202977ac05fd238e2c48a9bf3fa0a0 |
|
MD5 | 6acdde74890caa02f445066820a8b61b |
|
BLAKE2b-256 | 71aaf7d52a0be5db6b0c74391b8c543db1b0761ac3a4aae20e5609f5f3978817 |