PyLMS
is a utility to cope with my personal difficulty to remember people's names and relationships, to me and between each other.
Py
stands forPython
: because this is a learning and practicing technical project: see Learning with practiceLMS
stands for "Lacune Mémorielle Sociale" (French for "Social Memory Gap"): see How it works
Note
Afaik. I invented the terms for "LMS" and "Lacune Mémorielle Sociale". Maybe the name and/or the problem is real thing, but I didn't search.
When LMS
hits me, the typical questions I ask myself look like:
- "Comment s'appelle le père de Paul?" (What is Paul's father name, already?")
- "Qui est la femme de Remi?" (Who is Remi's wife?)
- "Comment s'appellent les femmes de mon cours d'escalade" (What are the names of the women attending climbing class with me?)
These are basically queries on persons ("Paul", "Remi", "Pierre", "me") and relationships ("père de", "femme de", "femmes de").
Based on this observation, PyLMS
stores persons, their relationships and tags in a database. The database is specific to single person (i.e. "me" is implicit).
- Search queries are kind of telegraphic speech: e.g. "père de Paul", "femme de Remi", "femmes cours d'escalade"
- Persons and relationships are created similarly: eg. "Jacques père de Paul", "Emma femme de Remi"
- Persons can also be created and edited directly: e.g. to add/remove tags, fix a typo, change name, ...
- Persons may be Male or Female, to answer queries such as "sœur de" ("sister of") or "fils de" ("son of")
- Sex is computed from a relationship when it carries the information ("père de" -- "father of" -- does, "enfant de" -- "child of" -- doesn't)
- Otherwise, it can be edited directly.
To successfully help me with LMS, PyLMS
should be accessible anywhere, and in multiple places: from my laptop to my phone, both online and offline.
However, PyLMS
is developed in iterations. For now, it has a command-line interface (CLI) and a (minimal) graphical interface (GUI).
see build, run and develop
$ pylms # list all persons (fist name, last name, sex and id) and their relationships
$ pylms john # search a person (or persons) which first name and/or last name contain 'john'
$ pylms create John Doe # create a person with first name 'John' and last name 'Doe'
$ pylms create John # create a person with first name 'John'
$ pylms link John Doe père de Tony Doe # create a relationship between person matching 'John Doe' and another person matching 'Tony Doe'
$ pylms link John père de Tony # same, only searching with 'John' and 'Tony'
$ pylms delete John # delete the person matching 'John'
$ pylms delete John Doe # delete the person matching 'John Doe'
"père de" is an example of a Relationship alias and is looked up to tell apart the Persons in the linking request. The list of supported relationship alias defined here.
Note
- Search is case-insensitive and accent-sensitive
- When searching, in case of multiple matches, user is asked to select the right person (CLI only)
- When creating a person, there is no duplicate management. Duplicates will have a different id, though.
pylmsgui
PyLMS Gui is minimalistic, a POC for a GUI and Hexagonal Architecture.
It supports the same commands as PyLMS CLI (without the pylms
prefix), but limited to read-only operations (list
and search
) and create
.
Simply write in the input field and hit <Return>
.
Python3
andpip
Tkinter
andTk
to usepylmsgui
(optional otherwise)- on ubuntu, use
sudo apt-get install python3-tk
- on ubuntu, use
make
make build
- see build
- run with:
source .venv/bin/activate pylms
- code formatted with
black
(runmake format
) - unit tested with
unittest
andpytest
(runmake test
) - code quality asserted with SonarCloud (see GitHub Actions workflow)
GNU GENERAL PUBLIC LICENSE (GPL)
As stated before, PyLMS
will be accessible anywhere, in multiple places, and is developed in iterations.
As a consequence, it is a project with superb opportunities to learn:
- I can start with a simple CLI and evolve the project to an auto-scaling SAAS service running in the Cloud, with both a web interface and an Android application.
- I can start with a plain JSON file as a database and evolve to Graph Database and a search service supporting Natural Language requests with AI.
- I can work on both the migrations between each of these steps and keeping them operational concurrently (e.g. the CLI can ultimately become a client to the SAAS service API).
Despite the technical potential, I want to balance it with:
- functional purpose of the tool as the driver and decision maker of technical changes (i.e. no technical change without user value)
- my professional centers of interest and my personal strengths:
- Deepen my knowledge in Python programming and the Python ecosystem (at some point, I prepared for PCPP1 with this project)
- Backend development (I can't deepen into Frontend as much #chooseYourBattles)
- Application and Architecture design
- Software Development best practices
Below, I keep track of this learning plan and its progress.
- comply with the Zen of Python for packages and modules, use
__main__.py
- build best practices:
setuptools
,wheel
(see setup.cfg) - UI development with
tkinter
(PCPP1 certification preparation) (see gui.py) - Testing with
pytest
,unitest
, patching, mocks, fixtures for property testing (see main_test.py) - Testing at scale with Contract Testing, Chaos Testing
- Code Quality:
Black
,SonarCloud
analysis, high test coverage - Change management
- issue tracking with Linear
- issues described as WHY-WHAT-HOW and as small steps of incremental value (sample, other samples)
- code updates with Pull Requests
- Continuous Integration:
GitHub actions
Note
I selected Linear to explore an innovative approach to issue tracking compared to Jira. Unfortunately, it's private. As a workaround, description of Pull Requests reproduces the content of issues.
- Implement a Hexagonal Architecture
- in a monolith: do it in Python, and prove it by adding UI without a change to the core
- in a system