Skip to main content

Note: This package is deprecated in favor of the Skeleton module within wk-libs (docs).

wknml

PyPI version Supported Python Versions Build Status Documentation Code Style

Python library for working with webKnossos skeleton annotation files (NML).

Installation

wknml requires Python 3.6+

pip install wknml

Documentation

See docs/wknml.md for an API documentation.

Examples

Some examples to get you started. Make sure to also check the examples directory:

# Load an NML file
with open("input.nml", "rb") as f:
    nml = wknml.parse_nml(f)

# Access the most important properties
print(nml.parameters)
print(nml.trees)
print(nml.branchpoints)
print(nml.comments)
print(nml.groups)

# Iterate over all nodes
for tree in nml.trees:
    for node in tree.nodes:
        print(tree, node)

# Write a new NML file to disk
with open("out.nml", "wb") as f:
    wknml.write_nml(f, nml)
# Convert an NML file with unlinked nodes to one with connected trees
python -m examples.fix_unlinked_nml <unlinked>.nml <fixed>.nml

Development

Make sure to install all the required dependencies using Poetry:

pip install poetry
poetry install

Please, format and test your code changes before merging them.

poetry run black wknml tests examples
poetry run pytest tests

PyPi releases are automatically pushed when creating a new Git tag/Github release. Make sure to bump the package version number manually:

poetry version <patch, minor, major>

If necessary, rebuild the documentation and commit to repository:

poetry run pydoc-markdown -m wknml -m wknml.nml_generation -m wknml.nml_utils --render-toc > docs/wknml.md

License

MIT License

Metadata

Release files for wknml 1.1.3

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

Source distribution (sdist)

Source distribution for wknml 1.1.3
File Size Uploaded Provenance
wknml-1.1.3.tar.gz 12.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wknml 1.1.3
File Interpreter ABI Platform
wknml-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.3 kB

Release files / wknml-1.1.3.tar.gz

Download URL wknml-1.1.3.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f0ea56dc3d134148ab1a057b3e724cae6e3ebbf5abc3644aa7dd00c8062e511a
BLAKE2b-256 checksum
How to use checksums
fe00ba3ffdf743a1d6ea13a41c24b33c948439545612e39bc64763548f9a737d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1025-azure

Release files / wknml-1.1.3-py3-none-any.whl

Download URL wknml-1.1.3-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b81213138b48a9ac09900209e0df90e1ac0525528d4f8892c4f3b086e6381091
BLAKE2b-256 checksum
How to use checksums
c0398b2ff0d9deeb77d84ac575ddb606db51564577733290b1383b6c9971e097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.18 Linux/6.5.0-1025-azure

Security for wknml 1.1.3

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