Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bbadc75
chore: rename project to Encoderize for package upload
DrWheelicus Apr 26, 2025
43999b1
feat: add issue and pull request templates
DrWheelicus Apr 26, 2025
1ca3b7a
chore: remove issue and pull request templates from GitHub workflows
DrWheelicus Apr 26, 2025
e94521b
chore: update GitHub Actions workflow
DrWheelicus Apr 26, 2025
0716fe0
chore: enhance GitHub Actions workflow for Python CI
DrWheelicus Apr 26, 2025
01fe1b8
chore: update GitHub Actions workflow to allow all branch pushes to t…
DrWheelicus Apr 26, 2025
07bd919
docs: update README to include badges for Codecov, PyPI, and downloads
DrWheelicus Apr 26, 2025
545c5b6
chore: update GitHub Actions workflow to use Codecov v5 and improve c…
DrWheelicus Apr 26, 2025
6821f4f
docs: update Codecov badge in README to include token for improved tr…
DrWheelicus Apr 26, 2025
ad987d8
chore: update Python version matrix in GitHub Actions workflow
DrWheelicus Apr 26, 2025
d1bb969
chore: update setuptools version constraints in pyproject.toml
DrWheelicus Apr 26, 2025
6a066a4
Restricts push branch and adds license classifier
DrWheelicus Apr 26, 2025
583eabb
chore: update Python version matrix in GitHub Actions workflow to inc…
DrWheelicus Apr 26, 2025
1b93a3e
chore: update dependencies in requirements.txt and GitHub Actions wor…
DrWheelicus Apr 27, 2025
ef8a564
chore: adjust coverage dependency versions in requirements.txt for Py…
DrWheelicus Apr 27, 2025
65e1fc6
chore: adjust docutils dependency versions in requirements.txt for Py…
DrWheelicus Apr 27, 2025
d27f9db
chore: adjust keyring dependency versions in requirements.txt for Pyt…
DrWheelicus Apr 27, 2025
a9d5152
chore: adjust pillow dependency versions in requirements.txt for Pyth…
DrWheelicus Apr 27, 2025
7a0bbb9
chore: add linting and testing job to CI
DrWheelicus Apr 27, 2025
b525e9d
chore: adjust treepoem dependency versions in requirements.txt for Py…
DrWheelicus Apr 27, 2025
3b87e77
chore: reorganize CI workflow for improved linting and testing
DrWheelicus Apr 27, 2025
eb0174f
chore: update Python version in CI workflow to 3.13
DrWheelicus Apr 27, 2025
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
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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:
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Pull Request Template

## Description
<!-- Please include a summary of the change and which issue is fixed. Also include relevant motivation and context. -->

Fixes #(issue)

## Type of Change
<!-- Please delete options that are not relevant. -->
- [ ] 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?
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. -->

- [ ] Test A
- [ ] Test B

## Screenshots (if applicable)
<!-- Please add screenshots to help explain your changes. -->

## Additional Context
<!-- Add any other context or information about the pull request here. -->
79 changes: 58 additions & 21 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,79 @@
# 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:
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.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

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@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v4
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
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
run: |
pytest

lint_and_test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- 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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Name Visualizer
# 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.

Expand Down Expand Up @@ -31,7 +35,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:
Expand Down Expand Up @@ -67,7 +71,7 @@ pytest

## Requirements

- Python 3.6 or higher
- Python 3.8 or higher
- svgwrite
- treepoem

Expand Down
10 changes: 3 additions & 7 deletions name_visualizer/__init__.py → encoderize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
]
2 changes: 1 addition & 1 deletion name_visualizer/cli.py → encoderize/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Command-line interface for the name_visualizer package.
Command-line interface for the encoderize package.
"""

import os
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools<=75.3.2; python_version == '3.8'",
"setuptools>=79.0.1; python_version > '3.8'",
"wheel"
]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 16 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
setuptools
svgwrite
pillow
treepoem
pytest
pytest-mock
pytest-cov
pytest-asyncio
build>=1.2.2.post1
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.5.0; python_version == "3.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<=75.3.2; python_version == "3.8"
setuptools>=78.1.1; python_version >= "3.9"
svgwrite>=1.4.3
treepoem>=3.24.0; python_version == "3.8"
treepoem>=3.27.1; python_version >= "3.9"
twine>=6.1.0
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
setup(
name="encoderize",
version="0.1.0",
keywords="encoderize, encoder, barcode, svg, visualizer",
packages=find_packages(),
install_requires=[
"svgwrite",
Expand All @@ -20,9 +21,10 @@
"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',
],
},
)
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Tests for the command-line interface of name_visualizer.
Tests for the command-line interface of encoderize.
"""

import os
import tempfile
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):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_visualizers.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Tests for the visualization functions in name_visualizer.
Tests for the visualization functions in encoderize.
"""

import os
import tempfile
import unittest
import pytest
import svgwrite
from name_visualizer import (
from encoderize import (
generate_binary_stripe,
generate_morse_code_band,
generate_circuit_trace_silhouette,
Expand Down