Skip to main content

Knitwork

latest release

Refactor of FragmentKnitwork

Installation

Knitwork is published to PyPI as xchem-knitwork (the Python package is still imported as knitwork):

pip install xchem-knitwork

For development, install from a clone of the repository:

git clone https://github.com/xchem/Knitwork
cd Knitwork
pip install --user -e .

Testing

Tests use uv and the dev dependency group:

uv run --only-group dev pytest

Releasing

Releases are made by pushing a semantic version tag (with no v prefix), e.g. 1.2.0 or 1.2.0-rc.1. The package version is taken from the tag. The release workflow then publishes: -

  • The Python package to PyPI (using PyPI Trusted Publishing)
  • A Docker image to Docker Hub (as xchem/knitwork:<tag>)

Configuration

The configure command can be used to set variables that the package will use when running commands:

e.g.

python -m knitwork configure GRAPH_LOCATION XXXXX
python -m knitwork configure GRAPH_USERNAME XXXXX
python -m knitwork configure GRAPH_PASSWORD XXXXX

Running Fragment Knitwork

Run the following steps to generate merges from ligands in an SDF.

Fragmentation

To run the Fragment process which looks for subnodes and synthons for a given set of fragments/molecules in an SDF and groups them into pairs:

python -m knitwork fragment INPUT_SDF

This will generate pickled pandas dataframes, along with caches and other outputs in fragment_output by default:

  • molecules.pkl.gz: pickled dataframe of input molecules
  • molecules.sdf: SDF of input molecules
  • pairs.pkl.gz: pickled dataframe of output pairs

For more options see:

python -m knitwork fragment --help

Pure Knitting

To query the graph database for "pure" merges matching fragment pairs in the fragment_output folder by default:

python -m knitwork pure-merge

This will generate pickled pandas dataframes, along with caches and other outputs in knitwork_output by default:

  • pure_merges.pkl.gz: pickled dataframe of merges
  • pure_merges.sdf: SDF of merges

Impure Knitting

To query the graph database for "impure" merges matching fragment pairs in the fragment_output folder by default:

python -m knitwork impure-merge

This will generate pickled pandas dataframes, along with caches and other outputs in knitwork_output by default:

  • impure_merges.pkl.gz: pickled dataframe of merges
  • impure_merges.sdf: SDF of merges

Metadata

Release files for xchem-knitwork 1.2.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 xchem-knitwork 1.2.0
File Size Uploaded
xchem_knitwork-1.2.0.tar.gz 87.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xchem-knitwork 1.2.0
File Interpreter ABI Platform
xchem_knitwork-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 100.7 kB

Release files / xchem_knitwork-1.2.0.tar.gz

Download URL xchem_knitwork-1.2.0.tar.gz
Size 87.0 kB
Tags Source
SHA-256 checksum
How to use checksums
318f77bc2dd2f46e56ab09322e1608691510f6ca51009b91d4f28b723c9831c7
BLAKE2b-256 checksum
How to use checksums
fc6df3990e888a8b2c800e4de9a646ff96c9e28fe7e6f9eb4b05da7c74557430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / xchem_knitwork-1.2.0-py3-none-any.whl

Download URL xchem_knitwork-1.2.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73e2ca94eb33f52ef56ec0c769d92e67367a182c1dc3d349426e84782bf1c756
BLAKE2b-256 checksum
How to use checksums
df9ff942a15251564803d550bb160cb1e042c06705eb0c763730c32f5018252a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

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