Skip to main content

pyisyntax

A Python library for working with pathology images in the iSyntax file format, powered by libisyntax.

Installation

$ pip install pyisyntax

Usage

Read and display a region of the WSI via Pillow.

from isyntax import ISyntax
import PIL.Image

with ISyntax.open("my_file.isyntax") as isyntax:
    # Read pixels from the specified region into a numpy array
    pixels = isyntax.read_region(500, 500, 400, 200, level=4)
    # Convert numpy array into a PIL image
    pil_image = PIL.Image.fromarray(pixels)
    # Show the image
    pil_image.show()

Extract and save the associated macro image.

from isyntax import ISyntax

with ISyntax.open("my_file.isyntax") as isyntax:
    # The macro image will be returned as compressed JPEG data.
    jpeg_data = isyntax.read_macro_image_jpeg()
    # This JPEG data can be written directly to a file.
    with open("macro_image.jpg", "wb") as f:
        f.write(jpeg_data)
    # Alternatively, you could decompress the data using Pillow:
    # pil_image = PIL.Image.open(io.BytesIO(jpeg_data), formats=["JPEG"])

Development

Dependency management

To set up a development environment from the lock file:

  1. Ensure that you have uv installed.
  2. Create the virtual environment:
    $ uv sync --frozen
    

To modify pyisyntax project dependencies:

  1. Edit dependencies in pyproject.toml.
  2. Update the lock file using uv:
    $ uv lock
    

Cutting a new release

  1. Ensure that tests are passing and everything is ready for release.
  2. Create and push a Git tag:
    $ git tag v0.1.6
    $ git push --tags
    
  3. Download the artifacts from GitHub Actions, which will include the source distribution tarball and binary wheels.
  4. Create a new release on GitHub from the tagged commit and upload the packages as attachments to the release.
  5. Also upload the packages to PyPI using Twine:
    $ uv run twine upload pyisyntax-*.tar.gz pyisyntax-*.whl
    
  6. Bump the version number in pyproject.toml and create a commit, signalling the start of development on the next version.

These files should also be added to a GitHub release.

Release files for pyisyntax 0.1.7

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

Source distribution (sdist)

Source distribution for pyisyntax 0.1.7
File Size Uploaded
pyisyntax-0.1.7.tar.gz 259.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyisyntax 0.1.7
File
pyisyntax-0.1.7-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
pyisyntax-0.1.7-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pyisyntax-0.1.7-cp310-abi3-macosx_10_9_x86_64.whl CPython 3.10 abi3 macOS 10.9+ x86-64 Details

Total release size: 1.9 MB

Release files / pyisyntax-0.1.7.tar.gz

Download URL pyisyntax-0.1.7.tar.gz
Size 259.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f6a9054825ec780e14e9e487b49714402266111e514e2890d0693d4890d009d6
BLAKE2b-256 checksum
How to use checksums
6ef913a892859feb280e31c120d86ff1021a92931f52a29a820733c5c0027038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / pyisyntax-0.1.7-cp310-abi3-win_amd64.whl

Download URL pyisyntax-0.1.7-cp310-abi3-win_amd64.whl
Size 93.7 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
63a485108a277a7f4e1e55da1abfcc8333b77258e1ae97f69f9a98bf1f08d6bf
BLAKE2b-256 checksum
How to use checksums
a6e487feeea23b02ae8530a0963e983e51fbdf2bc07f7e8c52caa5dfdc17e4e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 643.3 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
0e837dbb19faa95b5b461f4f2a2620aa1bfc1befc6354d00519f557bdebc99a3
BLAKE2b-256 checksum
How to use checksums
5dcbcf8576423ec63bebaddc9cbb21f7bfab7dfac9a4ab2cc3caeab9b4ec4876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL pyisyntax-0.1.7-cp310-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 619.1 kB
Tags CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c3e0e5848069b37e37c236853beb744098f3c63751ff11bc4e46482aca41d820
BLAKE2b-256 checksum
How to use checksums
0d251aba5858e4e74f874d50c565f12262a8efd211667620e8bfd2f35c385620
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / pyisyntax-0.1.7-cp310-abi3-macosx_11_0_arm64.whl

Download URL pyisyntax-0.1.7-cp310-abi3-macosx_11_0_arm64.whl
Size 147.3 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
75ae31bebecc179fdb6c79787d0a572684e6c9e5ccd5fc5fd430a399d5e0c8cb
BLAKE2b-256 checksum
How to use checksums
b264c5a1c87d0cb1164fc45395ce3d0dfda886ffdcd44e6ffa2c91d5b57205d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / pyisyntax-0.1.7-cp310-abi3-macosx_10_9_x86_64.whl

Download URL pyisyntax-0.1.7-cp310-abi3-macosx_10_9_x86_64.whl
Size 159.0 kB
Tags CPython 3.10 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3569c34dfc05d032c27588b42b8570238ba848017c3768dbb617605cf7f3a8e9
BLAKE2b-256 checksum
How to use checksums
d2bcf4c65fbe9d868244326c7c3fb72d7e6bf69eab5af39d8b3cd0b88de1280d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

6 release files

0.1.6

6 release files

0.1.5

5 release files

0.1.4

5 release files

0.1.3

5 release files

0.1.2

5 release files

0.1.1

5 release files

0.1.0

13 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