A port of the R package rmsfact by Dirk Edelbuettel.
Display a randomly selected quote about Richard M. Stallman based on the collection in the 'GNU Octave' function 'fact()' which was aggregated by Jordi Gutiérrez Hermoso based on the (now defunct) site stallmanfacts.com (which is accessible only via http://archive.org).
uv pip install rmsfactOr with pip:
pip install rmsfactThe package exports a single function rmsfact() which returns a single randomly-chosen "fact" as
a str.
import rmsfact
rmsfact.rmsfact()You can also run python -m rmsfact from a shell.
This project uses uv for dependency management and building.
Clone the repository:
git clone https://github.com/lewinfox/rmsfact.git
cd rmsfactInstall uv if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | shSet up the development environment:
make install_devThis will create a virtual environment, install dependencies, and set up the package for development.
To add a new fact you can edit rmsfact/data/rmsfact.txt.
echo "A new fact" >> rmsfact/data/rmsfact.txtThe Makefile provides several useful targets:
make install_dev: Set up development environment with uvmake test: Run unit tests with pytestmake build: Build the package (creates source and wheel distributions)make clean: Remove build artifactsmake format: Format code with ruffmake check: Run linter checks
You can build the package with:
make buildThis project uses GitHub Actions to automatically publish to PyPI when you create a new GitHub release.
You need to configure PyPI's Trusted Publishers feature (one-time setup):
- Go to PyPI and log in to your account
- Navigate to your project's settings (or create the project first if it doesn't exist)
- Go to the "Publishing" section
- Add a new publisher with these settings:
- PyPI Project Name:
rmsfact - Owner:
lewinfox(your GitHub username) - Repository name:
rmsfact - Workflow name:
publish.yml - Environment name: (leave blank)
- PyPI Project Name:
Once trusted publishing is configured, simply create a new GitHub release:
- Update the version in pyproject.toml
- Commit and push your changes
- Create a new release on GitHub with a tag matching the version (e.g.,
v0.5.0) - The GitHub Action will automatically build and publish to PyPI
You can also manually publish with:
make upload