This is a work-in-progress. I'm using this as an exercise to practice my craft, kick the tires on the Routable API, and get to know the domain/language in the Routable universe.
How I've been working:
- Test-driving (TDD) the implementation of things. Attempting to earn every line of code.
- Working in small increments (DTSTTCPW)
- Using Arlo's Commit Notation for commit messages
- Attempting to avoid primitive obsession by mirroring the domain (e.g. retrieve a list of
Membership
instead ofdict
)
from routable import Client
authentication_token = "XXXXXXXXXXXXX"
client = Client(authentication_token)
# Memberships
print("Here are the memberships in your account:")
memberships = client.memberships.list()
for m in memberships:
print(m)
Get a simple development environment created and activated:
python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
pytest .
mypy .
Calculate cyclometic complexity (via radon
):
# View cyclomatic complexity for all (F)unctions, (C)lasses, and (M)ethods
radon cc --show-complexity routable/
# View cyclomatic complexity that is below a score of "A"
radon cc --show-complexity --min B routable/
Calculate Halstead Metrics (via radon
):
# View on a per-file basis
radon hal routable/
# View on a per-function basis
radon hal --functions routable/
(EXPERIMENTAL) Calculate maintainability index (via radon
):
# View cyclomatic complexity for all (F)unctions, (C)lasses, and (M)ethods
radon mi routable/
Calculate raw metrics (via radon
):
# View metrics for each file (including summary)
radon raw --summary routable/
# View metrics for each file (including summary), excluding tests
radon raw --summary --exclude "**/tests/**" routable/