Skip to main content

Python wrapper for TextractorCLI

Project description

textractor-py

Python wrapper for TextractorCLI.

textractor-py provides a simple Python interface for attaching to a running Visual Novel process with TextractorCLI and receiving extracted text directly from Python.

Currently supports Windows only and no future linux build planned for now.

Features

  • Attach to a running process by PID
  • Listen for text from specific hooks
  • Automatic architecture detection (x86/x64)
  • Bundles TextractorCLI binaries
  • Simple generator-based API

Installation

pip install textractor-py

Quick Start

from textractor_py import Textractor

tex = Textractor()

tex.attach(2764) #PID of a VN process

print("attached, listening...")

for line in tex.listen(
    hook="HW-4*14", #optional
    pid=2764
):
    print(line)

Example output:

(2764, "HW-4*14", "こんにちは")
(2764, "HW-4*14", "世界")

API

Textractor()

Creates a Textractor instance.

tex = Textractor()

attach(pid)

Attach Textractor to a running process.

tex.attach(2764)

detach(pid)

Detach Textractor from a process.

tex.detach(2764)

listen(...)

Listen for extracted text.

Example:

for line in tex.listen(
    hook="HW-4*14",
    pid=2764
):
    print(line)

Returns tuples of:

(pid, hook, text)

Requirements

  • Windows
  • Python 3.10+
  • A running target process

Notes

This package is a Python wrapper around TextractorCLI and is intended primarily for visual novel text extraction, translation tooling, language learning tools, and related automation.

License

GPL-2.0 License

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

textractor_py-0.1.0.tar.gz (20.6 MB view details)

Uploaded Source

Built Distribution

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

textractor_py-0.1.0-py3-none-any.whl (21.5 MB view details)

Uploaded Python 3

File details

Details for the file textractor_py-0.1.0.tar.gz.

File metadata

  • Download URL: textractor_py-0.1.0.tar.gz
  • Upload date:
  • Size: 20.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for textractor_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b88fc511ec008d428230d4d0f8c1f04b8b1097dfbec709f0047712c9eb9df030
MD5 93c98b177b835f796d2beaf22c3f37c0
BLAKE2b-256 433c510a9817266a049a0aaa76c4ff42a1a32c9342bf5772b51a407feb6ff1cb

See more details on using hashes here.

File details

Details for the file textractor_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: textractor_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for textractor_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5b5ecf9c5bab61d2c6b62f35b530daee797640404affff2b5178b7a2ed21084
MD5 fe4ce690b718c1b4d3fecc8ebaaf6bf7
BLAKE2b-256 ad46f24a946d8bec1d28e8fcb6b2f8a4bb3e68d76a6320e1e937f23bb5ffc9a5

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