Skip to main content

High-performance UFO/GLIF parser for Python written in Rust

Reason this release was yanked:

Fatal build error

Project description

ufo-gleaner

PyPI - Version PyPI - Python Version

High-performance UFO/GLIF parser for Python written in Rust

Usage

Install

Install with pip:

python -m pip install ufo-gleaner

Quickstart

Parse all .glif files in one go as a dictionary mapping glyph names to their attributes:

from ufo_gleaner import UfoGleaner, FileProvider

provider = FileProvider("/path/to/myfont.ufo")
gleaner = UfoGleaner(provider)

glyphs = gleaner.glean()
print(glyphs["A"]["width"])

Custom Providers

UfoGleaner can be used with any Python object that implements a read(path: str) -> bytes method, where path is relative to the UFO root. This lets you from both .ufo directories and .ufoz ZIP archives, for example:

import zipfile
from ufo_gleaner import UfoGleaner

class UfozProvider:
    def __init__(self, root):
        self.zipfile = zipfile.ZipFile(root, "r")
    
    def read(self, path: str) -> bytes:
        return self.zipfile.read(path)

provider = UfozProvider("/path/to/myfont.ufoz")
gleaner = UfoGleaner(provider)

glyphs = gleaner.glean()

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

ufo_gleaner-0.1.1.tar.gz (27.4 kB view details)

Uploaded Source

Built Distributions

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

ufo_gleaner-0.1.1-py3-none-macosx_11_0_arm64.whl (3.8 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

ufo_gleaner-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (383.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file ufo_gleaner-0.1.1.tar.gz.

File metadata

  • Download URL: ufo_gleaner-0.1.1.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for ufo_gleaner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f851615bb04d9affc7fbbdcc256eefddf3a23e59191eb310240fe13ea94a7620
MD5 e7fd02771c832c6eddc9d1095594e680
BLAKE2b-256 e6ef077cdf2a1315eaa8fb361474009a84d4e21ebe3e658fee86e8bac484c87a

See more details on using hashes here.

File details

Details for the file ufo_gleaner-0.1.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ufo_gleaner-0.1.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a4eab466602063065d3112d74d1c1497a7ad2205daa0885bb9a55a100b2b674
MD5 2fad3d617c41fb00e88565a493761986
BLAKE2b-256 e48bf36436569886d0ea2851083efc7ab1e526e7c45bd2e6d3a42b8483e49d42

See more details on using hashes here.

File details

Details for the file ufo_gleaner-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ufo_gleaner-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2454e547059d427665efcfd80ca0d150a273c99d47e7a7406ec2debc0068f71
MD5 00a0ca948c5b0eb1c8d1bc946d39592f
BLAKE2b-256 e4b95fefa3d755c8930c31c4ecded3ba050acc33f53cd0e32cb146dc0b524cd6

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