Codewars Kata Python solutions
- python2 - Python 2 katas
- python3 - Python 3 katas
- tests - tests for both language version katas and utils
- utils - simple scripts I wrote to handle the project routines
- Old katas use Python 2, new katas - Python 3
- Requirements:
pip install -r requirements.txt
(virtual environment is strongly suggested)
Utilities and utility tests requires Codewars API key. Store it inside utils/envs.py
:
touch utils/envs.py
echo "ACCESS_KEY='<your_api_key>'" > utils/envs.py
I use pytest
to run test suit. Unfortunately it's impossible to switch to nose
or unittest
because pytest
syntax is heavily used (fixtures, parametrization and so on). Still you can freely write unittest
-style tests if needed - pytest
understands it correctly. Flag --doctest-modules
is also used to analyze doctests (there're few here and there).
For syntax style validation pylint
is used.
Language version will be auto selected according to active virtual environment.
invoke test
invoke syntax
invoke new <slug>
- creates new solution and test files depends on the given kata slug (usesjinja2
and codewars API), for example:invoke new hello-world
will be call codewars API to provide a description and difficulty level for thehello-world
kata (you can check kata's slug in it's url). In case of success -hello_world.py
andtest_hello_world.py
will be created in the corresponding folders (according to active Python version and kata difficulty level).
invoke update
- updates dependencies of Python 2 and Python 3 pyenv virtual environments (codewars2
andcodewars3
).invoke sort
- was used to sort old kata files depends on the language version (uses codewars API andconcurrent.futures
for performance)
All contributions are warmly welcomed! I would love to see better solutions, solutions to missing katas, error fixes, new automation scripts or additional docs. Please, do not hesitate if you consider your skill to be not that good, I'm also not a Senior Developer you know ๐ At least we would have a nice discussion in your pull request! ๐
Feel free to contact me if you have any questions, problems with this repository or suggestions, I would love to help! ๐