This is just a utils library I have to share code with my discord bots. You are free to use it with an MIT license.
To include it in your own project, you should use Github's submodule feature. Below is an example of how to do this.
# In an already existing git repository
git submodule add https://github.com/Ken-Miles/utils utils --recurse-submodules
# and then
git submodule update --init --remote --recursiveTo update the submodule to the latest commit if you already have it added as a submodule
git submodule update --remote --merge --recursiveIf you are attempting to clone a project that uses this as a submodule, you may need to add a flag when you attempt to clone it.
git clone --recurse-submodules <your-repository-url>If you have already cloned the repository without the --recurse-submodules flag, you should be able to initialize and fetch the submodules like so:
git submodule update --init --remote --recursiveTo install the dependencies for this utils library, the project includes both a requirements file and a pyproject.toml file. You can use either method to install the dependencies.
# from your project root
cd utils # cd into the utils directory
pip install -r requirements.txtBelow are just extras/misc installation options.
you may include any combination of the extras, below they are listed for your convenience
docs: documentation dependencies and files
tests: testing dependencies and files
speed: optional speedup dependencies (orjson, etc)
# from your project root
cd utils # cd into the utils directory
pip install .[docs,tests,speed]To run the tests for this utils library, you can use pytest. Make sure you have installed the testing dependencies first (see above).
# from your project root
cd utils # cd into the utils directory
pytest -vs tests