Skip to main content

Python tools for Sutton SignWriting core functionality.

Project description

sutton-signwriting-core

Source Code on GitHub Docs Gitter

Spec DOI

PyPI PyPI - Downloads CI

sutton-signwriting-core is a Python library that supports general processing of SignWriting text

This library supports both Formal SignWriting in ASCII (FSW) and SignWriting in Unicode (SWU) character sets, , along with the associated query languages and style string. See draft-slevinski-formal-signwriting for detailed specification.

Author: Steve Slevinski
Channel: YouTube
Support: Patreon
Donate: sutton-signwriting.io

Useful Links


Installation

pip install sutton-signwriting-core

Usage

from sutton_signwriting_core import (
    fsw_is_type, fsw_parse_symbol,
    fsw_to_coord, key_to_id
)

# FSW is type
fsw_is_type('S10000', 'hand')
True

# FSW parse symbol
fsw_parse_symbol('S10000500x500-C')
{'symbol': 'S10000', 'coord': [500, 500], 'style': '-C'}

# FSW to coord
fsw_to_coord('500x500')
[500, 500]

# FSW symbol key to 16-bit ID
key_to_id('S10000')
1

All functions are fully typed, validated, and documented with Python-style docstrings (Google format). Run help(swu_to_fsw) for details.


Development

Development Steps

# 1. Clone the repo
git clone https://github.com/sutton-signwriting/core-py.git
cd core-py

# 2. Install Poetry (if you don’t have it)
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"

# 3. Create the virtual environment and install deps
poetry install

# 4. Activate the environment (Poetry 2+)
poetry env activate
#   (copy and execute the returned command)

# 5. Run the test suite
pytest -v

# 6. Code coverage and HTML report
pytest --cov
pytest -v --cov=sutton_signwriting_core --cov-report=html
pytest --cov=sutton_signwriting_core --cov-report=xml

# 7. Lint / format / type-check
black .
ruff check .
mypy src

# 8. Update Version string
pyproject.toml:version = "1.0.0"
src/sutton_signwriting_core/__init__.py:__version__ = "1.0.0"
sphinx-docs/source/conf.py:release = "1.0.0"
sphinx-docs/source/conf.py:version = "1.0"

# 9. Create HTML documentation
cd sphinx-docs
sphinx-build -b html -a -E source/ ../docs/

# 10. Build distributions
poetry build

# 11. Publish to pypi
poetry publish

# 12. Git commit, push, and tag
git commit -m "message"
git push origin main
git tag v1.0.0 && git push --tags

License

MIT – see LICENSE for details.

Maintained by Steve Slevinski – Slevinski@signwriting.org


SignWriting Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sutton_signwriting_core-1.1.2.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sutton_signwriting_core-1.1.2-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file sutton_signwriting_core-1.1.2.tar.gz.

File metadata

  • Download URL: sutton_signwriting_core-1.1.2.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for sutton_signwriting_core-1.1.2.tar.gz
Algorithm Hash digest
SHA256 615fc77108695b972c15548e63311b9a79b36d75b1c0d41cfa0bacdf3b6de53b
MD5 cdc9486b50997054ce5953192cc86473
BLAKE2b-256 ed43f3ad1d0993feca1f8c1f2f865a704e2f53302b7c32b198bd8dcfb0b2d98b

See more details on using hashes here.

File details

Details for the file sutton_signwriting_core-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: sutton_signwriting_core-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for sutton_signwriting_core-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 078376499dfc1a41ee7bcfcf3d7299543c16e80a229e14aab7fd4df33549c01a
MD5 5af3e59d9993906d5e01cbe1dc7ea6d4
BLAKE2b-256 bf7fa980c375c87b57762b11f1c3337517b7092bac5d7690c44f578cc00959bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page