Skip to main content

python3 version of mol2chemfig

Project description

mol2chemfigPy3

PyPI Downloads OS python

This is NOT an official version of mol2chemfig for python 3.

mol2chemfigPy3 is a translation from py2 to py3 based on old mol2chemfig version 1.5.

Install

install from PyPi

$ pip install -U mol2chemfigPy3

Usage

Use in command line

Attention: to render the colours on Windows platform, run it in modern terminals, e.g. Windows Terminal.

mol2chemfig and python -m mol2chemfigPy3 are equivalent.

1. getting version

$ mol2chemfig --version

2. getting help

$ mol2chemfig -h

3. some examples

3.1 converting SMILES
$ mol2chemfig -zw -i direct "C1=CC=C(C=C1)O"

it will give you

\chemfig{OH-[:180,,1]=_[:240]-[:180]=_[:120]-[:60]=_(-[:300])}
3.2 writing to an output file
$ mol2chemfig -zw -i direct "C1=CC=C(C=C1)O" > phenol-smi-terse.tex

it will write result to file phenol-smi-terse.tex

3.3 searching PubChem database
$ mol2chemfig -zw -i pubchem 996
3.4 reading from a file
$ mol2chemfig -zw peniciling.mol

Use as a python package (new add in to this python 3 version)

This is not included in the original Py2 version of mol2chemfig.

mol2chemfigPy3.mol2chemfig(content: str, *args: str, rotate: float = 0.0, aromatic: bool = True, marker: Optional[str] = None, name: Optional[str] = None, relative_angle: bool = False, show_carbon: bool = False, show_methyl: bool = False, inline: bool = False)

e. g.

from mol2chemfigPy3 import mol2chemfig

mol2chemfig('996')  # search the PubChem database

mol2chemfig('C1=CC=C(C=C1)O')  # transfer InChI/SMILES to chemfig

mol2chemfig('./methanol.smi')  # from a file

Document

See official document mol2chemfig-doc.pdf (uwaterloo.ca)

License

MIT license

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

mol2chemfigPy3-1.5.3.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

mol2chemfigPy3-1.5.3-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file mol2chemfigPy3-1.5.3.tar.gz.

File metadata

  • Download URL: mol2chemfigPy3-1.5.3.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mol2chemfigPy3-1.5.3.tar.gz
Algorithm Hash digest
SHA256 38bcf8e0bfdf0f6ca1b45c4fbfbc0638a24f5a8184a96af7b55aa495b82889f2
MD5 b6a019aac0154b6f2d96c9d8c4c229df
BLAKE2b-256 7f7d649d7a0acd77f934fd7971eec0b3494ab462e301e131b09d6e7cba746c23

See more details on using hashes here.

File details

Details for the file mol2chemfigPy3-1.5.3-py3-none-any.whl.

File metadata

  • Download URL: mol2chemfigPy3-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mol2chemfigPy3-1.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7b416a264c9216d36f529e2dba11129315c53ce4c9b2c4eff5dc2331cd886c8e
MD5 0229b05803e00dff973a270fb8b03432
BLAKE2b-256 f100498708abd4b092682d9af24620583a8d1b69d4ad861ad358abfdb95cee0b

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