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 5095c20..a01c6d6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# Encoderize +[](https://codecov.io/gh/DrWheelicus/encoderize) [](https://badge.fury.io/py/encoderize) [](https://pepy.tech/project/encoderize) -[](https://codecov.io/gh/DrWheelicus/encoderize) -[](https://badge.fury.io/py/encoderize) -[](https://pepy.tech/project/encoderize) +
A Python package for generating various visual representations of text in SVG format. +
## Installation @@ -20,17 +22,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 +41,86 @@ 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]" -``` - -Run tests: -```bash -pytest -``` +If neither `--dark` nor `--light` is specified, both versions will be generated. -## Available Visualizations +## Example Visualizations -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 +*WIP* ## 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 - -## 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 - -## Dependencies +Each visualization function in `encoderize/visualizers.py` accepts optional parameters to customize the appearance (e.g., colors, sizes, spacing, dimensions). -- svgwrite: For SVG file generation -- pillow: For image processing -- treepoem: For barcode generation +See the function docstrings within `encoderize/visualizers.py` for detailed parameter information. -## 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