Skip to content

fact User Guide

python-blueprint Project

For more information on how this was built and deployed, as well as other Python best practices, see python-blueprint.

Info

This user guide is purely an illustrative example that shows off several features of Material for MkDocs and included Markdown extensions1.

Installation

First, install pipx:

python3 -m pip install --user pipx
python3 -m pipx ensurepath

If you installed Python using Microsoft Store, replace py with python3 in the next line.

py -m pip install --user pipx

If you receive

WARNING: The script pipx.exe is installed in `<USER folder>\AppData\Roaming\Python\Python3x\Scripts` which is not on PATH

Go into the mentioned folder and run

pipx ensurepath
brew install pipx
pipx ensurepath

Next, install Poetry:

pipx install poetry

Then install the fact package and its dependencies:

poetry install

Activate the virtual environment created automatically by Poetry:

poetry shell

Quick Start

To use fact within your project, import the factorial function and execute the API like:

from fact.lib import factorial

assert factorial(3) == 6 # (1)!
  1. This assertion will be True

Tip

Within PyCharm, use Tab to auto-complete suggested imports while typing.

Expected Results

Input Output
1 1
2 2
3 6
4 24

  1. See python-blueprint's mkdocs.yml for how to enable these features.