From bbadc758c3b8bb6a519b273dcd802e51be912027 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:19:55 -0400 Subject: [PATCH 01/24] chore: rename project to Encoderize for package upload Updates project name from Name Visualizer to Encoderize. This change reflects a broader scope of functionality, encompassing various encoding methods for generating visual representations of text. Updates documentation, CLI entry point, package name, tests, and setup configuration to reflect the new name. Also bumps the minimum Python version to 3.8. --- README.md | 6 +++--- {name_visualizer => encoderize}/__init__.py | 10 +++------- {name_visualizer => encoderize}/cli.py | 2 +- {name_visualizer => encoderize}/visualizers.py | 2 +- pyproject.toml | 3 +++ pytest.ini | 2 +- requirements.txt | 3 ++- setup.py | 5 +++-- tests/test_cli.py | 4 ++-- tests/test_visualizers.py | 4 ++-- 10 files changed, 21 insertions(+), 20 deletions(-) rename {name_visualizer => encoderize}/__init__.py (92%) rename {name_visualizer => encoderize}/cli.py (97%) rename {name_visualizer => encoderize}/visualizers.py (99%) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index 3e5bce0..ae1faae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Name Visualizer +# Encoderize A Python package for generating various visual representations of text in SVG format. @@ -31,7 +31,7 @@ Generates SVG visualizations of text using various encoding methods: ## Usage ```bash -name-visualizer --text "HELLO" --output-dir output +encoderize --text "HELLO" --output-dir output ``` Options: @@ -67,7 +67,7 @@ pytest ## Requirements -- Python 3.6 or higher +- Python 3.8 or higher - svgwrite - treepoem diff --git a/name_visualizer/__init__.py b/encoderize/__init__.py similarity index 92% rename from name_visualizer/__init__.py rename to encoderize/__init__.py index 50dacfc..afdb230 100644 --- a/name_visualizer/__init__.py +++ b/encoderize/__init__.py @@ -18,6 +18,8 @@ Each visualization function takes text input and generates an SVG file. """ +__version__ = "0.1.0" + from .visualizers import ( generate_binary_stripe, generate_morse_code_band, @@ -42,10 +44,4 @@ 'generate_waveform_stripe', 'generate_chevron_stripe', 'generate_braille_stripe' -] - -""" -Name Visualizer package for generating various visual representations of text. -""" - -__version__ = "0.1.0" \ No newline at end of file +] \ No newline at end of file diff --git a/name_visualizer/cli.py b/encoderize/cli.py similarity index 97% rename from name_visualizer/cli.py rename to encoderize/cli.py index f7174e0..78991c7 100644 --- a/name_visualizer/cli.py +++ b/encoderize/cli.py @@ -1,5 +1,5 @@ """ -Command-line interface for the name_visualizer package. +Command-line interface for the encoderize package. """ import os diff --git a/name_visualizer/visualizers.py b/encoderize/visualizers.py similarity index 99% rename from name_visualizer/visualizers.py rename to encoderize/visualizers.py index 4388aa8..fb45f98 100644 --- a/name_visualizer/visualizers.py +++ b/encoderize/visualizers.py @@ -1,5 +1,5 @@ """ -Visualization functions for the name_visualizer module. +Visualization functions for the encoderize module. This module contains all the visualization functions that generate SVG representations of text using various encoding methods. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d6222a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=79.0.1", "wheel"] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/pytest.ini b/pytest.ini index a44939c..52c816f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -17,7 +17,7 @@ addopts = --verbose --tb=short --showlocals - --cov=name_visualizer + --cov=encoderize --cov-report=term-missing --cov-report=html --no-cov-on-fail diff --git a/requirements.txt b/requirements.txt index d3fcece..6ae87c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ treepoem pytest pytest-mock pytest-cov -pytest-asyncio \ No newline at end of file +pytest-asyncio +pkginfo diff --git a/setup.py b/setup.py index 4b334a1..2631ff0 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ setup( name="encoderize", version="0.1.0", + keywords="encoderize, encoder, barcode, svg, visualizer", packages=find_packages(), install_requires=[ "svgwrite", @@ -17,12 +18,12 @@ url="https://github.com/DrWheelicus/encoderize", classifiers=[ "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], + license="MIT", entry_points={ 'console_scripts': [ - 'name-visualizer=name_visualizer.cli:main', + 'encoderize=encoderize.cli:main', ], }, ) \ No newline at end of file diff --git a/tests/test_cli.py b/tests/test_cli.py index 50ed737..cd43f27 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,5 @@ """ -Tests for the command-line interface of name_visualizer. +Tests for the command-line interface of encoderize. """ import os @@ -7,7 +7,7 @@ import unittest import pytest from unittest.mock import patch -from name_visualizer.cli import main +from encoderize.cli import main class TestCLI(unittest.TestCase): def setUp(self): diff --git a/tests/test_visualizers.py b/tests/test_visualizers.py index 622e9b1..8c0aa7b 100644 --- a/tests/test_visualizers.py +++ b/tests/test_visualizers.py @@ -1,5 +1,5 @@ """ -Tests for the visualization functions in name_visualizer. +Tests for the visualization functions in encoderize. """ import os @@ -7,7 +7,7 @@ import unittest import pytest import svgwrite -from name_visualizer import ( +from encoderize import ( generate_binary_stripe, generate_morse_code_band, generate_circuit_trace_silhouette, From 43999b1fae1d6baa3603c746bcb96bf52f0740af Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:31:06 -0400 Subject: [PATCH 02/24] feat: add issue and pull request templates --- .github/workflows/ISSUE_TEMPLATE.md | 30 ++++++++++++++++++ .github/workflows/PULL_REQUEST_TEMPLATE.md | 37 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/ISSUE_TEMPLATE.md create mode 100644 .github/workflows/PULL_REQUEST_TEMPLATE.md diff --git a/.github/workflows/ISSUE_TEMPLATE.md b/.github/workflows/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..9c26666 --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE.md @@ -0,0 +1,30 @@ +## What type of issue is this? +- [ ] Bug report +- [ ] Feature request +- [ ] Question +- [ ] Other (please describe below) + +## Description +_A clear and concise description of what the issue is or what you are requesting._ + +## Steps to Reproduce (for bugs) +1. +2. +3. + +## Expected Behavior +_What did you expect to happen?_ + +## Actual Behavior (for bugs) +_What actually happened?_ + +## Screenshots or Logs (if applicable) +_Add screenshots, error messages, or logs to help explain your problem._ + +## Additional Context +_Add any other context about the problem or request here._ + +## Environment (please complete the following information if relevant) +- OS: [e.g. Windows, Mac, Linux] +- Python version: [e.g. 3.10] +- Other dependencies: diff --git a/.github/workflows/PULL_REQUEST_TEMPLATE.md b/.github/workflows/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..3801fce --- /dev/null +++ b/.github/workflows/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,37 @@ +# Pull Request Template + +## Description + + +Fixes #(issue) + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation update +- [ ] Refactor +- [ ] Other (please describe): + +## Checklist +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules + +## How Has This Been Tested? + + +- [ ] Test A +- [ ] Test B + +## Screenshots (if applicable) + + +## Additional Context + From 1ca3b7ab16f31fec3d68f8fb1aa4e853f07c6945 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:32:42 -0400 Subject: [PATCH 03/24] chore: remove issue and pull request templates from GitHub workflows Moves issue and PR templates out of workflows The issue and pull request templates are not workflow specific and should reside in the root .github directory. This change moves them to the appropriate location. --- .github/{workflows => }/ISSUE_TEMPLATE.md | 0 .github/{workflows => }/PULL_REQUEST_TEMPLATE.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/ISSUE_TEMPLATE.md (100%) rename .github/{workflows => }/PULL_REQUEST_TEMPLATE.md (100%) diff --git a/.github/workflows/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from .github/workflows/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/.github/workflows/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/workflows/PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md From e94521b7305673075f2b1a04e7daa3b4f8ca70a7 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:38:37 -0400 Subject: [PATCH 04/24] chore: update GitHub Actions workflow Renames the workflow to "Python Encoderize" and adds a step to upload coverage reports to Codecov. This enhances the CI process by integrating coverage tracking. --- .github/workflows/python-app.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 35ae49b..b87128c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application +name: Python Encoderize on: push: @@ -40,3 +40,8 @@ jobs: - name: Test with pytest run: | pytest + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: coverage.xml From 0716fe023286f878e24a060ededab59c4c6780c6 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:49:35 -0400 Subject: [PATCH 05/24] chore: enhance GitHub Actions workflow for Python CI Adds support for multiple Python versions (3.9, 3.10, 3.11) using a matrix strategy. Updates the setup step to cache pip dependencies and includes coverage report generation with pytest. This improves the CI process by ensuring compatibility across different Python versions and integrating coverage tracking. Enhances Python CI workflow Adds support for multiple Python versions (3.9, 3.10, 3.11) using a matrix strategy. Caches pip dependencies to speed up the CI process. Includes coverage report generation with pytest and uploads to Codecov. This improves CI by ensuring compatibility across different Python versions and integrating coverage tracking. --- .github/workflows/python-app.yml | 44 ++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b87128c..f55f9bb 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,35 +1,47 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - name: Python Encoderize on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["**"] permissions: contents: read jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache pip + uses: actions/cache@v3 with: - python-version: "3.10" + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | + sudo apt-get update sudo apt-get install -y ghostscript python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install -e . + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -37,11 +49,17 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Test with pytest and generate coverage run: | - pytest - + pytest --cov=. + + - name: Generate coverage report + run: | + pytest --cov=. + coverage xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: file: coverage.xml + continue-on-error: true From 01fe1b8508fb00196439099785b467ce6d32dc76 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 17:58:34 -0400 Subject: [PATCH 06/24] chore: update GitHub Actions workflow to allow all branch pushes to trigger it --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f55f9bb..8a7af2d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -2,7 +2,7 @@ name: Python Encoderize on: push: - branches: ["main"] + branches: ["**"] pull_request: branches: ["**"] From 07bd91910d9b800f5dfc52f7a3ba6feadd69c750 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 18:03:01 -0400 Subject: [PATCH 07/24] docs: update README to include badges for Codecov, PyPI, and downloads --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ae1faae..528fbbb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Encoderize +[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/branch/main/graph/badge.svg)](https://codecov.io/gh/DrWheelicus/encoderize) +[![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) +[![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) + A Python package for generating various visual representations of text in SVG format. ## Installation From 545c5b611881fedb760907cc897921ebc0bd4d12 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 18:14:43 -0400 Subject: [PATCH 08/24] chore: update GitHub Actions workflow to use Codecov v5 and improve coverage report handling Changes the Codecov action version to v5 and updates the upload step to include the necessary token and slug for better integration. This enhances the coverage reporting process in the CI workflow. --- .github/workflows/python-app.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 8a7af2d..0464d75 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -48,18 +48,14 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Test with pytest and generate coverage - run: | - pytest --cov=. - - name: Generate coverage report + - name: Test with pytest and generate coverage run: | pytest --cov=. coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 with: - file: coverage.xml - continue-on-error: true + token: ${{ secrets.CODECOV_TOKEN }} + slug: DrWheelicus/encoderize From 6821f4f9e8c87e291a9145f14de84cb7aa1db85a Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 18:20:25 -0400 Subject: [PATCH 09/24] docs: update Codecov badge in README to include token for improved tracking --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 528fbbb..bdc3f34 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Encoderize -[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/branch/main/graph/badge.svg)](https://codecov.io/gh/DrWheelicus/encoderize) +[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) [![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) [![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) From ad987d8122082291ed8952cf93becbc380c5db7c Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 19:17:38 -0400 Subject: [PATCH 10/24] chore: update Python version matrix in GitHub Actions workflow Adds Python 3.8 to the matrix of supported versions in the CI workflow, ensuring compatibility with an earlier version of Python. --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0464d75..207295d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 From d1bb96910bd3b4c47cb7a53483dbea738e94c93f Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 19:23:47 -0400 Subject: [PATCH 11/24] chore: update setuptools version constraints in pyproject.toml Modifies the setuptools requirement to specify version constraints based on Python version, ensuring compatibility with Python 3.8. --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6222a9..96a2808 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ [build-system] -requires = ["setuptools>=79.0.1", "wheel"] +requires = [ + "setuptools<=75.3.2; python_version == '3.8'", + "setuptools>=79.0.1; python_version > '3.8'", + "wheel" +] build-backend = "setuptools.build_meta" \ No newline at end of file From 6a066a43ce06c27194a5ed7be1b74056d0ae4ef3 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 19:27:46 -0400 Subject: [PATCH 12/24] Restricts push branch and adds license classifier Restricts the push branch to main in the GitHub Actions workflow to prevent accidental deployments from other branches. Adds "License :: OSI Approved :: MIT License" classifier to setup.py to clarify the project's licensing. --- .github/workflows/python-app.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 207295d..fd10095 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -2,7 +2,7 @@ name: Python Encoderize on: push: - branches: ["**"] + branches: ["main"] pull_request: branches: ["**"] diff --git a/setup.py b/setup.py index 2631ff0..2fd5468 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,7 @@ url="https://github.com/DrWheelicus/encoderize", classifiers=[ "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], license="MIT", From 583eabb49f5345fd7660a4847b64f15fa1039076 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 19:29:50 -0400 Subject: [PATCH 13/24] chore: update Python version matrix in GitHub Actions workflow to include 3.12 and 3.13 Expands the supported Python versions in the CI workflow to include 3.12 and 3.13, ensuring compatibility with the latest Python releases. --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index fd10095..c30f702 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 From 1b93a3e84ee349207c6c67d1ae8d250d728fde38 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:21:04 -0400 Subject: [PATCH 14/24] chore: update dependencies in requirements.txt and GitHub Actions workflow --- .github/workflows/python-app.yml | 4 ++-- requirements.txt | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c30f702..d7b1ef7 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,12 +21,12 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff --git a/requirements.txt b/requirements.txt index 6ae87c6..fada7db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,10 @@ -setuptools -svgwrite -pillow -treepoem -pytest -pytest-mock -pytest-cov -pytest-asyncio -pkginfo +build>=1.2.2.post1 +coverage>=7.8.0 +docutils>=0.21.2 +keyring>=25.6.0 +pillow>=11.2.1 +pytest>=8.3.5 +setuptools>=78.1.1 +svgwrite>=1.4.3 +treepoem>=3.27.1 +twine>=6.1.0 From ef8a564030395eb74a50619011fc6f17b54e7aaf Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:25:44 -0400 Subject: [PATCH 15/24] chore: adjust coverage dependency versions in requirements.txt for Python compatibility Updates the coverage package requirements to specify different versions based on the Python version, ensuring compatibility with Python 3.8 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fada7db..e3cd222 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ build>=1.2.2.post1 -coverage>=7.8.0 +coverage>=7.6.1; python_version == "3.8" +coverage>=7.8.0; python_version >= "3.9" docutils>=0.21.2 keyring>=25.6.0 pillow>=11.2.1 From 65e1fc63e31261cec61abc96ded5f2f81f37b11b Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:28:17 -0400 Subject: [PATCH 16/24] chore: adjust docutils dependency versions in requirements.txt for Python compatibility Modifies the docutils package requirements to specify different versions based on the Python version, ensuring compatibility with Python 3.8 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e3cd222..50d0289 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ build>=1.2.2.post1 coverage>=7.6.1; python_version == "3.8" coverage>=7.8.0; python_version >= "3.9" -docutils>=0.21.2 +docutils>=0.20.1; python_version == "3.8" +docutils>=0.21.2; python_version >= "3.9" keyring>=25.6.0 pillow>=11.2.1 pytest>=8.3.5 From d27f9dbfc1d449a17c014d8652da9268ba4f43a9 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:30:11 -0400 Subject: [PATCH 17/24] chore: adjust keyring dependency versions in requirements.txt for Python compatibility Modifies the keyring package requirements to specify different versions based on the Python version, ensuring compatibility with Python 3.8 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 50d0289..1348ad5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,8 @@ coverage>=7.6.1; python_version == "3.8" coverage>=7.8.0; python_version >= "3.9" docutils>=0.20.1; python_version == "3.8" docutils>=0.21.2; python_version >= "3.9" -keyring>=25.6.0 +keyring>=25.5.0; python_version == "3.8" +keyring>=25.6.0; python_version >= "3.9" pillow>=11.2.1 pytest>=8.3.5 setuptools>=78.1.1 From a9d5152189cad3849e8cd314974563279db512db Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:32:08 -0400 Subject: [PATCH 18/24] chore: adjust pillow dependency versions in requirements.txt for Python compatibility Modifies the pillow package requirements to specify different versions based on the Python version, ensuring compatibility with Python 3.8 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1348ad5..10e8ae9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,8 @@ docutils>=0.20.1; python_version == "3.8" docutils>=0.21.2; python_version >= "3.9" keyring>=25.5.0; python_version == "3.8" keyring>=25.6.0; python_version >= "3.9" -pillow>=11.2.1 +pillow>=10.4.0; python_version == "3.8" +pillow>=11.2.1; python_version >= "3.9" pytest>=8.3.5 setuptools>=78.1.1 svgwrite>=1.4.3 From 7a0bbb9f56b51bc29bc98e8d45aba44bb1ab650d Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:38:23 -0400 Subject: [PATCH 19/24] chore: add linting and testing job to CI Adds a new job to the CI workflow that runs flake8 to lint the code. Also adds a version constraint for setuptools to ensure compatibility with Python 3.8 --- .github/workflows/python-app.yml | 4 ++++ requirements.txt | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index d7b1ef7..ce979c6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -42,6 +42,10 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install -e . + lint_and_test: + runs-on: ubuntu-latest + needs: build + steps: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/requirements.txt b/requirements.txt index 10e8ae9..d95c0bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,8 @@ keyring>=25.6.0; python_version >= "3.9" pillow>=10.4.0; python_version == "3.8" pillow>=11.2.1; python_version >= "3.9" pytest>=8.3.5 -setuptools>=78.1.1 +setuptools<=75.3.2; python_version == "3.8" +setuptools>=78.1.1; python_version >= "3.9" svgwrite>=1.4.3 treepoem>=3.27.1 twine>=6.1.0 From b525e9d00c9b87e077bfcc2148d4801b26796cea Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 20:40:22 -0400 Subject: [PATCH 20/24] chore: adjust treepoem dependency versions in requirements.txt for Python compatibility Modifies the treepoem package requirements to specify different versions based on the Python version, ensuring compatibility with Python 3.8 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d95c0bf..1976fb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,5 +11,6 @@ pytest>=8.3.5 setuptools<=75.3.2; python_version == "3.8" setuptools>=78.1.1; python_version >= "3.9" svgwrite>=1.4.3 -treepoem>=3.27.1 +treepoem>=3.24.0; python_version == "3.8" +treepoem>=3.27.1; python_version >= "3.9" twine>=6.1.0 From 3b87e77ea9cd93161c326cbe01a8348836d61e5f Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 23:10:59 -0400 Subject: [PATCH 21/24] chore: reorganize CI workflow for improved linting and testing Refactors the GitHub Actions workflow to enhance the linting and testing process. This includes setting up Python, installing dependencies, and running flake8 for linting and pytest for testing with coverage reporting. The changes ensure a more structured and efficient CI pipeline. --- .github/workflows/python-app.yml | 42 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ce979c6..893ee0f 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -46,20 +46,34 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - uses: actions/checkout@v4 - - name: Test with pytest and generate coverage - run: | - pytest --cov=. - coverage xml + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y ghostscript + python -m pip install --upgrade pip + pip install flake8 pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e . + + - name: Lint with flake8 + run: | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Test with pytest and generate coverage + run: | + pytest --cov=. + coverage xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: token: ${{ secrets.CODECOV_TOKEN }} - slug: DrWheelicus/encoderize + slug: DrWheelicus/encoderize \ No newline at end of file From eb0174f09822994cc00eb759a57274b570d27ca3 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Sat, 26 Apr 2025 23:15:56 -0400 Subject: [PATCH 22/24] chore: update Python version in CI workflow to 3.13 Changes the Python version in the GitHub Actions workflow from '3.x' to '3.13' to ensure the CI pipeline uses the latest stable release. --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 893ee0f..948e93d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -51,7 +51,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.13' - name: Install dependencies run: | From b96adfd3bd6efe08d6eede4d8dc110689ba6992f Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Wed, 30 Apr 2025 19:43:17 -0400 Subject: [PATCH 23/24] chore: add CONTRIBUTING.md and update README for clarity and structure Introduces a new CONTRIBUTING.md file to guide users on reporting bugs, suggesting enhancements, and submitting pull requests. Updates the README.md to improve formatting, enhance feature descriptions, and clarify usage instructions, including example visualizations and options for generating outputs. --- CONTRIBUTING.md | 48 +++++++++++++ README.md | 183 ++++++++++++++++++++---------------------------- 2 files changed, 123 insertions(+), 108 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3f18628 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# Contributing to Encoderize + +First off, thank you for considering contributing to Encoderize! It's people like you that make Encoderize such a great tool. + +## How Can I Contribute? + +### Reporting Bugs + +This section guides you through submitting a bug report for Encoderize. + +- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/DrWheelicus/encoderize/issues). +- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/DrWheelicus/encoderize/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for Encoderize, including completely new features and minor improvements to existing functionality. + +- **Perform a cursory search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- If you cannot find an existing issue that describes your enhancement, [open a new issue](https://github.com/DrWheelicus/encoderize/issues/new). +- Provide a **clear and descriptive title** and include as many details as possible about the enhancement, explaining **why** it would be useful. + +### Pull Requests + +1. Fork the repository and create your branch from `main`. +2. If you've added code that should be tested, add tests. +3. Ensure the test suite passes (`pytest`). +4. Make sure your code lints (`flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics`). +5. Issue that pull request! + +## Style Guides + +### Git Commit Messages + +- Use the present tense ("Add feature" not "Added feature"). +- Use the imperative mood ("Move cursor to..." not "Moves cursor to..."). +- Limit the first line to 72 characters or less. +- Reference issues and pull requests liberally after the first line. +- Consider using [Conventional Commits](https://www.conventionalcommits.org/) for structured commit messages (e.g., `feat: Add new visualization type`). + +### Python Style Guide + +- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/). +- Use `black` for code formatting. +- Use `flake8` for linting. + +## Any questions? + +Feel free to reach out if you have questions about contributing. \ No newline at end of file diff --git a/README.md b/README.md index bdc3f34..90600f7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ -# Encoderize +

+Encoderize +

-[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) -[![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) -[![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) +
+ [![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) + [![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) + [![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) +
+

A Python package for generating various visual representations of text in SVG format. +

## Installation @@ -20,17 +26,18 @@ pip install -e . ## Features -Generates SVG visualizations of text using various encoding methods: -- Binary Stripe -- Morse Code Band -- Circuit Trace Silhouette -- Dot Grid Steganography -- Semaphore Flags -- A1Z26 Numeric Stripe -- Code128 Barcode -- Waveform Stripe -- Chevron Stripe -- Braille Stripe +Generates SVG visualizations of text using 10 distinct encoding methods: + +1. **Binary Stripe**: Binary bar code representation +2. **Morse Code Band**: Dots and dashes visualization +3. **Circuit Trace Silhouette**: Circuit board-like pattern (5x7 grid per character) +4. **Dot Grid Steganography**: Grid with highlighted letters +5. **Semaphore Flags**: Flag position visualization +6. **A1Z26 Numeric Stripe**: Numeric representation of letters (A=1, Z=26) +7. **Code128 Barcode**: Standard Code128 barcode format +8. **Waveform Stripe**: Waveform visualization based on character ASCII values +9. **Chevron Stripe**: Chevron pattern based on binary representation +10. **Braille Stripe**: Visual representation of Braille characters ## Usage @@ -38,130 +45,90 @@ Generates SVG visualizations of text using various encoding methods: encoderize --text "HELLO" --output-dir output ``` -Options: -- `--text`, `-t`: Text to visualize (required) -- `--output-dir`, `-o`: Output directory (default: 'output') -- `--dark`: Generate dark mode versions -- `--light`: Generate light mode versions +**Options:** -## Development +* `--text`, `-t`: Text to visualize (required) +* `--output-dir`, `-o`: Output directory (default: 'output') +* `--dark`: Generate dark mode versions (white on black) +* `--light`: Generate light mode versions (black on white) -Install development dependencies: -```bash -pip install -e ".[dev]" -``` +If neither `--dark` nor `--light` is specified, both versions will be generated. -Run tests: -```bash -pytest -``` +## Example Visualizations -## Available Visualizations +*(Placeholder: Consider adding a few small example SVG outputs here for common words like "TEST" or "HELLO" in different encodings.)* -1. **Binary Stripe** - Binary bar code representation -2. **Morse Code Band** - Dots and dashes visualization -3. **Circuit Trace Silhouette** - Circuit board-like pattern -4. **Dot Grid Steganography** - Grid with highlighted letters -5. **Semaphore Flags** - Flag position visualization -6. **A1Z26 Numeric Stripe** - Numeric representation of letters -7. **Code128 Barcode** - Standard barcode format -8. **Waveform Stripe** - Waveform visualization -9. **Chevron Stripe** - Chevron pattern visualization -10. **Braille Stripe** - Braille representation - -## Requirements - -- Python 3.8 or higher -- svgwrite -- treepoem +* Binary Stripe (Light): `output/HELLO/light/binary_stripe_HELLO.svg` +* Morse Code Band (Dark): `output/HELLO/dark/morse_code_band_HELLO.svg` +* Circuit Trace (Light): `output/HELLO/light/circuit_trace_silhouette_HELLO.svg` ## Output Structure -For input text "example", the output structure will be: +For input text like `"HELLO"`, the output structure will be: ``` output/ -└── example/ +└── HELLO/ ├── light/ - │ ├── binary_stripe_example.svg - │ ├── morse_code_band_example.svg - │ └── ... + │ ├── binary_stripe_HELLO.svg + │ ├── morse_code_band_HELLO.svg + │ ├── circuit_trace_silhouette_HELLO.svg + │ ├── dot_grid_steganography_HELLO.svg + │ ├── semaphore_flags_HELLO.svg + │ ├── a1z26_stripe_HELLO.svg + │ ├── code128_barcode_HELLO.svg + │ ├── waveform_stripe_HELLO.svg + │ ├── chevron_stripe_HELLO.svg + │ └── braille_stripe_HELLO.svg └── dark/ - ├── binary_stripe_example.svg - ├── morse_code_band_example.svg - └── ... + ├── binary_stripe_HELLO.svg + ├── morse_code_band_HELLO.svg + └── ... (and so on for all 10 types) ``` ## Customization -Each visualization function accepts various parameters to customize the appearance: - -- Colors -- Sizes -- Spacing -- Dimensions - -See the function docstrings for detailed parameter information. - -## License - -MIT License +Each visualization function in `encoderize/visualizers.py` accepts optional parameters to customize the appearance (e.g., colors, sizes, spacing, dimensions). -## Features - -The tool generates 10 different visual encodings for any input text: - -1. **Binary Pulse Stripe**: Converts text to binary and creates a visual stripe pattern -2. **Morse Code Band**: Creates a visual representation of Morse code -3. **Circuit Trace Silhouette**: Generates a 5x7 circuit-like pattern -4. **Steganographic Dot-Grid Pattern**: Creates a grid with highlighted dots representing letters -5. **Semaphore Flags**: Visual representation of semaphore flag positions -6. **A1Z26 Numeric Stripe**: Converts letters to their position in the alphabet -7. **Code128 Barcode**: Generates a standard barcode -8. **Waveform Stripe**: Creates a waveform pattern based on character values -9. **Chevron Stripe**: Binary-based chevron pattern -10. **Braille Stripe**: Visual representation of Braille characters +See the function docstrings within `encoderize/visualizers.py` for detailed parameter information. -## Dependencies - -- svgwrite: For SVG file generation -- pillow: For image processing -- treepoem: For barcode generation - -## Output Structure +## Development -For input text "example", the output structure will be: +Install development dependencies: +```bash +pip install -e ".[dev]" +``` +Run tests: +```bash +pytest ``` -output_example/ -├── light/ -│ ├── binary_stripe_example.svg -│ ├── morse_code_band_example.svg -│ └── ... -└── dark/ - ├── binary_stripe_example.svg - ├── morse_code_band_example.svg - └── ... + +Run linters (e.g., flake8, black): +```bash +# Example using flake8 +flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +# Example using black +black . --check ``` -## Customization +## Requirements -The script includes various parameters that can be modified to adjust the visual appearance of the encodings, such as: +* Python 3.8 or higher +* `svgwrite` +* `treepoem` (and its dependency Ghostscript for barcode generation) -- Colors -- Sizes -- Spacing -- Dimensions +## License -To modify these parameters, edit the corresponding function parameters in `encoding-names.py`. +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. -## Contact +## Contributing -For questions or feedback, please contact me at [haydenpmac@gmail.com](mailto:haydenpmac@gmail.com) +Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for details on how to report bugs, suggest features, and submit pull requests. -## Contributing +## Contact -Contributions are welcome! Please open an issue or submit a pull request. +For questions or feedback, please contact Hayden MacDonald at [haydenpmac@gmail.com](mailto:haydenpmac@gmail.com). ## Contributors From 76c65e501266d80e798e279df989630aa2a06905 Mon Sep 17 00:00:00 2001 From: Hayden MacIntyre Date: Wed, 30 Apr 2025 19:47:12 -0400 Subject: [PATCH 24/24] chore: simplify README layout by removing unnecessary div tags --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 90600f7..dd22070 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@ + +[![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) [![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) [![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) +

Encoderize

-
- [![codecov](https://codecov.io/gh/DrWheelicus/encoderize/graph/badge.svg?token=QPQMGU1G01)](https://codecov.io/gh/DrWheelicus/encoderize) - [![PyPI](https://badge.fury.io/py/encoderize.svg)](https://badge.fury.io/py/encoderize) - [![Downloads](https://pepy.tech/badge/encoderize)](https://pepy.tech/project/encoderize) -
-

A Python package for generating various visual representations of text in SVG format.