Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish_testpypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish to TestPyPI
on:
push:
branches:
- testpypi
- main-testpypi

permissions:
contents: read
Expand Down
55 changes: 32 additions & 23 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ main, main-testpypi ]

jobs:
pytest:
filter:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.filter.outputs.src }}
steps:
- name: Filter changes
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
src:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'

pytest:
needs: filter
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]

python-version: ["3.11","3.12","3.13","3.14"]
steps:
- uses: actions/checkout@v4

if: needs.filter.outputs.run_tests == 'true'
- uses: actions/setup-python@v5
if: needs.filter.outputs.run_tests == 'true'
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: pip install uv

- name: UV Env
- name: Install UV and Run Tests
if: needs.filter.outputs.run_tests == 'true'
run: |
pip install uv
uv venv
source .venv/bin/activate
uv sync
uv run pytest -q

- name: No Tests Required
if: needs.filter.outputs.run_tests == 'false'
run: |
uv venv
source .venv/bin/activate

- name: Install deps
run: uv pip install -r pyproject.toml

- name: Install project
run: uv pip install -e .
echo "No Tests Required, skipping tests."

- name: Run tests
run: uv run pytest -q
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# Screenshot to Text (S2T)

A crossplatform CLI utility to extract text from a screenshot. Run it, select an area on your screen and the text will be copied to your clipboard.
A crossplatform CLI utility to extract text from a screenshot.

Run it, select an area on your screen and the text will be copied to your clipboard.

It relies on readily existing external tools for screenshotting, OCR, and clipboard management.

Built as a good enough solution until someone builds a cross platform super fast native rust application that does the same thing better :sweat_smile:

## Status

![Ubuntu (X11)](https://img.shields.io/badge/Linux%20(X11)-passing-success) ![Ubuntu 15.04 (Wayland)](https://img.shields.io/badge/Linux%20(Wayland)-passing-success) ![macOS](https://img.shields.io/badge/macOS-passing-success)

<details>
<summary> Testing Details</summary>

| Platform | Tested On | Status
|-|-|-|
| Linux (X11) | Native Ubuntu 24.04 (X11) |![Status](https://img.shields.io/badge/passing-success) |
| Linux (Wayland) | Quickemu Ubuntu 25.04 (Wayland)|![Status](https://img.shields.io/badge/passing-success) |
| macOS | Quickemu macOS Sequoia |![Status](https://img.shields.io/badge/passing-success) |

</details>

## Watch it in Action

![Demo](/media/screenshot-to-text-demo.gif)
![Demo](https://raw.githubusercontent.com/Alphan-Aksoyoglu/screenshot-to-text/d17bb4e974e6a2d5d069a38471703a21b6863fdb/media/screenshot-to-text-demo.gif)

## Dependencies

Expand Down Expand Up @@ -36,13 +53,7 @@ You will need to have one of the supported tools for each category installed on

`brew install tesseract`

## Tests

| Platform | Tested On |
| ----------------| -----------------------------------------------------------------------------------------------|
| Linux (X11) | ![Ubuntu (X11)](https://img.shields.io/badge/Ubuntu%2024.04%20(X11)-passing-success) |
| Linux (Wayland) | ![Ubuntu 15.04 (Wayland)](https://img.shields.io/badge/Ubuntu%2025.04%20(Wayland)-passing-success) |
| macOS Sequoia | ![macOS Sequoia](https://img.shields.io/badge/macOS%20Sequoia-passing-success) |

## Installation and Configuration (First Use)

Expand Down Expand Up @@ -72,7 +83,7 @@ It will create a `config.toml` file in your user configuration directory.

## Usage

To take a screenshot and extract text, run:
To take a screenshot and extract text to clipboard, run:

```bash
s2t run
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requires-python = ">=3.11"
description= "Cross platform screenshot to text CLI"
readme = "README.md"
authors = [{name="Alphan Aksoyoglu", email="alphanbe@gmail.com"}]
keywords = ["screenshot", "ocr", "clipboard", "screenshot to text"]
dependencies = [
"opencv-python-headless>=4.13.0.92",
"platformdirs>=4.5.1",
Expand All @@ -18,6 +19,22 @@ dependencies = [
"tomli-w>=1.2.0",
"typer>=0.22.0",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
]

license = "MIT"
license-files = ["LICEN[CS]E*"]
Expand All @@ -26,6 +43,10 @@ license-files = ["LICEN[CS]E*"]
screenshot-to-text="screenshot_to_text.cli:app"
s2t="screenshot_to_text.cli:app"

[project.urls]
Repository = "https://github.com/Alphan-Aksoyoglu/screenshot-to-text.git"
Issues = "https://github.com/Alphan-Aksoyoglu/screenshot-to-text/issues"

[tool.setuptools.packages.find]
where=["src"]
[tool.setuptools.package-data]
Expand Down