Skip to main content

pip install reduce-binary (unofficial)

build Actions status codecov

image PyPI - Downloads image image

Install and use reduce with ease in Python.

pip install reduce-binary
import reduce_binary

print(reduce_binary.REDUCE_BIN_PATH)
reduce_binary.run_reduce("-h")  # like subprocess.run(["reduce", "-h"])
reduce_binary.popen_reduce("-h")  # like subprocess.Popen(["reduce", "-h"])

# For no-argument case, pass an empty string
reduce_binary.run_reduce("")  # like subprocess.run(["reduce"])

# Pass a list of arguments
reduce_binary.run_reduce(["-Trim", "input.pdb"])

There exists a wrapper function.

from reduce_binary.helpers import protonate

protonate(
    "input.pdb",
    "output.pdb",
    remove_hydrogen_first=True,
    print_stderr=False,
)

Supported platforms:

  • Linux x86_64
  • MacOS x86_64, arm64 (Intel and Apple Silicon)

[!NOTE] Installing the package does NOT put the binary in $PATH.
Instead, the API will tell you where it is located.

👨‍💻️ Maintenance Notes

Releasing a new version with CI (recommended)

Go to Github Actions and run the Build and Release workflow.

Version rule:

e.g.: 4.14.0.2

  • 4.14 is the reduce version
  • the last digit is the build/API version number

Testing with CI (recommended)

Go to Github Actions and run the Build and Release workflow, with "Dry run" checked.

It will build and test the wheels on all platforms, without releasing them to PyPI.

Running locally

This section describes how it works.

To run it locally, first install the dependencies:

pip install uv --user --break-system-packages
uv tool install wheel
uv tool install build

# Mac
brew install gnu-sed

Build the app at buiid/ (reduce):

# Linux
bash build_reduce_linux.sh v4.14
# Mac (Intel)
MACOSX_DEPLOYMENT_TARGET=10.12 bash build_reduce_mac.sh v4.14
# Mac (Apple Silicon)
MACOSX_DEPLOYMENT_TARGET=11.0 bash build_reduce_mac.sh v4.14

[!NOTE] Linux build uses an old version of ubuntu docker to be compatible with old systems.
It also checks if the glibc dependency is lower than 2.17.
In the future you may need to increase this version in the script.

[!NOTE] The MACOSX_DEPLOYMENT_TARGET is the cmake flag.
https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html

Build the wheel. It copies the python to build_python/, built binary into it, modifies the version number and builds the wheel in build_python/dist/.:

# One of the following
bash build_python.sh 4.14 manylinux_2_17_x86_64.manylinux2014_x86_64
bash build_python.sh 4.14 macosx_10_12_x86_64
bash build_python.sh 4.14 macosx_11_0_arm64

Test the wheel

uv venv
source .venv/bin/activate
uv pip install -r requirements_test.txt
uv pip install build_python/dist/*.whl
pytest

✅ TODO

  • Cross-compile for Linux
  • Windows build
  • CHANGELOG and publish to releases

Metadata

Release files for reduce-binary 4.15.0

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

Built distributions (wheels)

Table of built distributions (wheels) for reduce-binary 4.15.0
File Interpreter ABI Platform
reduce_binary-4.15.0-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3.10 none Linux glibc 2.17+ x86-64 Details
reduce_binary-4.15.0-py310-none-macosx_11_0_arm64.whl Python 3.10 none macOS 11.0+ ARM64 Details
reduce_binary-4.15.0-py310-none-macosx_10_12_x86_64.whl Python 3.10 none macOS 10.12+ x86-64 Details

Total release size: 40.7 MB

Release files / reduce_binary-4.15.0-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL reduce_binary-4.15.0-py310-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 13.6 MB
Tags Linux glibc 2.17+ x86-64 Python 3.10
SHA-256 checksum
How to use checksums
b195e9d88ff30dbc8047b76a0e64a5f159accdca34712cc77f2c899f527293fd
BLAKE2b-256 checksum
How to use checksums
5d18a1bbe86727e02d9536f33fdf3e9f1c868bce6b032cb8cd30dee467e1d3e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.6.16

Release files / reduce_binary-4.15.0-py310-none-macosx_11_0_arm64.whl

Download URL reduce_binary-4.15.0-py310-none-macosx_11_0_arm64.whl
Size 13.6 MB
Tags Python 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3eb6430cef5e3f45b128d3a1bc37e56aaa6e5fc21b7157d542bcdcd16d31f310
BLAKE2b-256 checksum
How to use checksums
0f7ed2c74c83666d12a80b7c6b950c8591a4b14d28f98ec51283a9e6b45197c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.6.16

Release files / reduce_binary-4.15.0-py310-none-macosx_10_12_x86_64.whl

Download URL reduce_binary-4.15.0-py310-none-macosx_10_12_x86_64.whl
Size 13.6 MB
Tags Python 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
1212378e24fc4bdd8bc2493420b9b7be9cd886f83cc34318da4a2477531ac002
BLAKE2b-256 checksum
How to use checksums
57789753eec74d75b33c36921aa30168c24b09d09c95f1ea24f7d11047f15301
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.6.16

Security for reduce-binary 4.15.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.

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