A Python package for generating and executing tool chains for base conversion-based ciphers.
pip install -e .
- Install command:
pip install -e .
Then start by running the following command:
python -m pallas.main -h
It will give you options and explain how to use the tool!
- Create a virtual environment:
python -m venv venv
source .venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -r requirements.txt
- Install the package in development mode:
pip install -e .
Add all tools to the /tools directory. Please organize into subdirectories as it makes sense. Note the encoder/decoder folders.
All tools should extend the Tool
class. This abstracts a lot of complexity so you can focus on implementing your tool!
Follow these conventions when creating your tool metadata:
name: snake_case. if encoder/decoder, do base_encoder or base_decoder.
description: simple enough
domain_chars: the valid input. For decoders this is particularly important. Define a constant in common/charsets.py and import.
range_chars: the possible output. For decoders, this is typically going to be EXTENDED_ASCII_CHARSET.
separator: if your scheme requires a separator, please add one to your constructor and default to space.
All tools are required to place their core logic in the _process
function with the following header:
def _process(self, input_str: str) -> str
This aligns with the schema of all other tools and is required to ensure the toolchain continues to work.
All tools are expected to have unit tests in the /tests directory. This directory mirrors the /src/pallas
directory in structure. So if your tool is in src/pallas/tools/decoders
directory, your test file should be in the test/tools/decoders
directory for consistency.
You can run invoke test
to check that your tests are passing, and invoke test-coverage
to check the line coverage of your new tool. Ensure that your tool is above 75% coverage or it will fail the CI automation and not get merged in.
Please open a PR to submit your contribution for review. You may receive comments to improve unit test coverage or otherwise.
Run tests using pytest:
invoke test
Run tests with coverage:
invoke test-coverage
Run a specific test file. Example for testing the octal encoder:
pytest tests/tools/encoders/test_octal.py
Clean build artifacts:
invoke clean
## License
MIT License