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.3.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.3.0
File Size Uploaded Provenance Actions
xchem_knitwork-1.3.0.tar.gz 87.5 kB With provenance Details for xchem_knitwork-1.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 101.9 kB

Release files / xchem_knitwork-1.3.0.tar.gz

Download URL xchem_knitwork-1.3.0.tar.gz
Size 87.5 kB
Tags Source
SHA-256 checksum
How to use checksums
238176046791ec55f8b2a29e71b66fccb659e66614583bd1cceb285493f21c60
BLAKE2b-256 checksum
How to use checksums
1849f61641f396ea9157428efc3b3b97acbfb2e1f89444115af83aef3efe66e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

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

Download URL xchem_knitwork-1.3.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27f7f3d7e628e871bbca91646faa7c11f6d78121406516d9c10d9706423b8133
BLAKE2b-256 checksum
How to use checksums
6616c7ef42a78f4270ca73a38dc877a19de04f9e9f04358bf9489ae5a1e0beed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for xchem-knitwork 1.3.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xchem_knitwork-1.3.0.tar.gz

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 Nov 30, 2026.

Transparency log

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.

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