Skip to main content

ipyketcher

How to use

from ipyketcher import KetcherEditor

editor = KetcherEditor(
    initial_molecule="OCC",
    return_formats=["smiles", "molfile"],
)

editor

You can now draw a structure, and access the currently drawn molecule in smiles or molfile format via editor.smiles or editor.molfile.

Other supported formats are: 'rxn', 'ket', 'smarts', 'cml', 'sdf', 'cdxml', 'cdx', 'inchi', 'inchi_key'. Set the format you want synchronized back to Python using the return_formats parameter, and observe the output via the corresponding attribute on the KetcherEditor instance.

Installation

pip install ipyketcher

or with uv:

uv add ipyketcher

Development

We recommend using uv for development. It will automatically manage virtual environments and dependencies for you.

uv run jupyter lab example.ipynb

Alternatively, create and manage your own virtual environment:

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
jupyter lab example.ipynb

The widget front-end code bundles it's JavaScript dependencies. After setting up Python, make sure to install these dependencies locally:

npm install

While developing, you can run the following in a separate terminal to automatically rebuild JavaScript as you make changes:

npm run dev

Open example.ipynb in JupyterLab, VS Code, or your favorite editor to start developing. Changes made in js/ will be reflected in the notebook.

Creating a new release:

  1. Bump the version in pyproject.toml.
  2. Create a new git tag with the version.
  3. Build and upload the package to PyPI:
npm build
hatch build
hatch publish -u __token__ -a pypi-<your-token>

Hot reloading

Set anywidget hot reloading on windows:

set ANYWIDGET_HMR=1

Resources

Metadata

Release files for ipyketcher 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipyketcher 0.1.0
File Size Uploaded Provenance Actions
ipyketcher-0.1.0.tar.gz 33.9 MB Without provenance Details for ipyketcher-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ipyketcher 0.1.0
File Interpreter ABI Platform Actions
ipyketcher-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for ipyketcher-0.1.0-py2.py3-none-any.whl

Total release size: 49.6 MB

Release files / ipyketcher-0.1.0.tar.gz

Download URL ipyketcher-0.1.0.tar.gz
Size 33.9 MB
Tags Source
SHA-256 checksum
How to use checksums
c7875c9d3cbc97feab4e39751ceb8f3a4baac27e7bac2878a45abee6fd0f41e9
BLAKE2b-256 checksum
How to use checksums
65cb82a3214ca99fc08c30d92a75e3430febfe22ff16f23686a5e74046439fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / ipyketcher-0.1.0-py2.py3-none-any.whl

Download URL ipyketcher-0.1.0-py2.py3-none-any.whl
Size 15.7 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7db485bbaa49212b400a009c4a5ecb865a745fb1b15693018ba1e2e6f0466153
BLAKE2b-256 checksum
How to use checksums
023f13cc551e4192a22530f8b0df3e565a1fb090a47b49c5142d6be408219673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for ipyketcher 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page