Skip to main content

A simple python wrapper for OPSIN: Open Parser for Systematic IUPAC nomenclature.

Project description

PyOPSIN

This is a Python wrapper for the OPSIN (Open Parser for Systematic IUPAC Nomenclature) package, which allows you to generate SMILES and CML form the standardized IUPAC names for organic molecules. The original OPSIN package was written in Java, but this wrapper allows you to use OPSIN functionality directly from Python.

Installation

To install PyOPSIN, run

pip install pyopsin

Usage

Here's an example of how to use the PyOPSIN to generate SMILES string using the IUPAC name for a molecule:

from pyopsin.pyopsin import PyOpsin

# create an PyOpsin object
opsin = PyOpsin()

# generate the SMILES string from an IUPAC name for a molecule
name = "2,4,6-trinitrotoluene"
smiles = pyopsin.to_smiles(name)

# print the SMILES string
print(smiles)

This should output the following SMILES string:

[N+](=O)([O-])C1=C(C)C(=CC(=C1)[N+](=O)[O-])[N+](=O)[O-]

Here is another example of how to invoke parallel processing to process a list of IUPAC names:

names = ["2,4,6-trinitrotoluene", "cycloheptene"]
smiles = pyopsin.to_smiles(names, num_workers=2)
print(smiles)

This should output the following SMILES strings:

["[N+](=O)([O-])C1=C(C)C(=CC(=C1)[N+](=O)[O-])[N+](=O)[O-]", "C1=CCCCCC1"]

Acknowledgments

The OPSIN Python wrapper is built on top of the OPSIN package, which was developed by the Centre for Molecular Informatics at the University of Cambridge. We would like to thank the developers of OPSIN for creating such a powerful and useful tool.

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

pyopsin-0.2.4.tar.gz (12.2 MB view details)

Uploaded Source

File details

Details for the file pyopsin-0.2.4.tar.gz.

File metadata

  • Download URL: pyopsin-0.2.4.tar.gz
  • Upload date:
  • Size: 12.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pyopsin-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4771789b7ec91391cad1bf6983d80c5382581d659129280e701243e0e03e540f
MD5 5862792c207b9a5e1031536cedae9ec6
BLAKE2b-256 6f4c5b81651b3f46718c5f9b5aa50cf45fdfc6b5ef804849f8f933b498a33bc9

See more details on using hashes here.

Supported by

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