Some of the most common design patterns implemented in Python.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
mvc Code formatting (black) Aug 3, 2018
.codeclimate.yml Update config files Apr 10, 2018
.gitignore
.python-version
.pyup.yml
.travis.yml
LICENSE
README.md Update dependencies Feb 11, 2019
__init__.py
abstract_factory.py Code formatting (black) Aug 3, 2018
adapter.py
borg.py
bridge.py Code formatting (black) Aug 3, 2018
builder.py
chain_of_responsability.py Code formatting (black) Aug 3, 2018
closure.py
codecov.yml
command.py
composite.py
decorator.py
facade.py
factory_method.py
flyweight.py Lint all files with black Apr 10, 2018
interpreter.py
iterator.py Code formatting (black) Aug 3, 2018
mediator.py Code formatting (black) Aug 3, 2018
memento.py
null_object.py
object_pool.py Code formatting (black) Aug 3, 2018
observer.py Lint all files with black Apr 10, 2018
poetry.lock
prototype.py
prototype_class_decorator.py
proxy.py
pyproject.toml
singleton.py Code formatting (black) Aug 3, 2018
state.py
strategy.py
template_method.py
test_design_patterns.py
visitor.py

README.md

design-patterns

License: MIT Build Status Python 3 Code style: black

Some of the most common design patterns implemented in Python.

Installation

This project uses pyenv and pyenv-virtualenv to manage the Python virtual environment, and poetry to manage the project dependencies.

If you don't have python 3.x.x, you have to install it. For example, I'm using 3.7.2.

pyenv install 3.7.2

Create a virtual environment and activate it.

pyenv virtualenv 3.7.2 design_patterns
pyenv activate design_patterns

Install all the dependencies from the poetry.lock file.

poetry install

Tests

If you want you can run all tests with:

poetry run pytest

You can also test the MVC pattern with:

cd mvc
poetry run python model_view_controller.py