diff --git a/.github/workflows/publish_testpypi.yaml b/.github/workflows/publish_testpypi.yaml index 3ddd72d..4f0a8d2 100644 --- a/.github/workflows/publish_testpypi.yaml +++ b/.github/workflows/publish_testpypi.yaml @@ -3,7 +3,7 @@ name: Publish to TestPyPI on: push: branches: - - testpypi + - main-testpypi permissions: contents: read diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 42b5c3d..916e0bd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 798b7ef..47e2018 100644 --- a/README.md +++ b/README.md @@ -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) + +
+ Testing Details + +| 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) | + +
+ ## 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 @@ -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) @@ -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 diff --git a/pyproject.toml b/pyproject.toml index c069b85..ab04020 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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*"] @@ -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] diff --git a/src/screenshot_to_text/__version__.py b/src/screenshot_to_text/__version__.py index 3dc1f76..485f44a 100644 --- a/src/screenshot_to_text/__version__.py +++ b/src/screenshot_to_text/__version__.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.1"