Skip to main content

Minumtium

A minimal blogging library.

What can I use it for?

The purpose of minumtium is to be embedded inside simple projects like landing pages or personal portfolio pages where it is not needed to have a lot of features. The objective is to:

  • Provide a simple way to add and list posts inside a page
  • Provide a summary of the most recent posts
  • Provide (very) basic user management

It is not meant to provide a full-fledged blogging platform. Features like comments, profiles, view counters, social-network integrations and even configuration files are out of scope.

Why minimal?

The idea behind minumtium is that it should do the bare minimum: provide you the code to create posts, as well as provide a way to control who can post. That's it:

  • There are no user profiles, it accepts whatever value you pass as an author
  • There is no UI, you have to create your own or use a library that provides it
  • There are no endpoints, but there are implementations for fastapi

It is just a library that creates and lists blog posts, you can add other features by using external libraries, like building lego (a very minimal lego, though).

Why embedable?

Minumtium has been created so that it can be a library inside a bigger project. By default, it won't even provide you a UI or even REST API endpoints. The user should encapsulate minumtium inside its own code and integrate it inside its project. It is expected that you implement your own authentication adapters to allow it to integrate to your auth system and so on.

Why extensible?

Being so bare minimal would mean that minumtium is almost useless, as it is quite simple to implement its core functionality. Minumtium has been built from ground up to be extensible with custom adapters and extension libraries. Those can:

  • Provide you alternative authentication methods
  • Provide integration with different databases
  • Provide you API endpoints using libraries like Flask or FastAPI
  • Provide you Front-End endpoints using Jinja or Mako rendering

Usage

Install it using pip, or you favorite venv manager:

# Using pip
pip install minumtium
# Using pipenv
pipenv install minumtium
# Using poetry
poetry install minumtium

Always interact with the service by providing its dependencies:

from modules.posts import PostRepository, PostService
from minumtium.infra.implementations.sqlalchemy_database import SqlAlchemyAdapter

db_adapter = SqlAlchemyAdapter({'engine': 'sqlite_memory'}, 'posts')
post_repository = PostRepository(db_adapter)
post_service = PostService(post_repository)

summary = post_service.get_latest_posts_summary(count=10)

Extensions and Adapters

You may not want to write a bunch of code, and for that reason you will very likely want to use plugins. Here are some of the standard plugins:

You can refer to their repositories for more information on how to use them.

Integrating with other things

There are two things you will want to integrate:

  • The posts service at minumtium.modules.posts.PostService
  • The idm service at minumtium.modules.idm.IdmService

Integrating those services mean you will need to inject a few dependencies into them:

  • The posts service depends on the PostRepository.
  • The PostRepository depends on a DatabaseAdapter implementation.

Having a dependency injection system definitely helps out. You can take a look at the FastAPI Plugin code that is very simple and shows how this integration can be done.

Creating your own adapters

Adding support for other kinds of databases or authentication methods will consist on implementing the adapter interfaces:

  • minumtium.infra.database.adapter.DatabaseAdapter
  • minumtium.infra.authentication.adapter.AuthenticationAdapter

Those custom adapters are provided as dependencies when creating the services and the repositories.

Creating your own application

Applications are the actual implementation of something usable. An example is the Fast API REST API application. Applications are supposed to provide you a way to actually use minumtium without having to reinvent the wheel.

Applications are provided as extension libraries, that will encapsulate minumtium something like FastAPI, for example. It is up to the user to register the minumtium client inside your main client so that you have all of its routes available.

You can create your own application and distribute it as a library. Those extension libraries are supposed to wrap minumtium into something else.

Rationale

I have created this while working on my personal portfolio page. It was supposed to be much more minimal, like a single python file. As I started developing it I have decided to use it to practice both TDD and layered architectures. It is mostly a crud, so it was a good exercise and it is easy to read the source code.

Maybe it will not be so minimal as I wanted, but I learned some nice stuff along the way 😁.

Metadata

Release files for minumtium 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minumtium 1.1.0
File Size Uploaded Provenance Actions
minumtium-1.1.0.tar.gz 10.8 kB Without provenance Details for minumtium-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for minumtium 1.1.0
File Interpreter ABI Platform Actions
minumtium-1.1.0-py3-none-any.whl Python 3 none any Details for minumtium-1.1.0-py3-none-any.whl

Total release size: 21.0 kB

Release files / minumtium-1.1.0.tar.gz

Download URL minumtium-1.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5007b1b8eb233977b0c7a43aafeca98b96a2f6e5e284201029af9f745f94fb07
BLAKE2b-256 checksum
How to use checksums
88ef6b78a839409652344250012f71bd459437295ebd3c20d6c5b66a5e5d5aef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / minumtium-1.1.0-py3-none-any.whl

Download URL minumtium-1.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
319df44ba1517427a7777bf9710022de29a7f56c9b0067a57a7bc4950356a639
BLAKE2b-256 checksum
How to use checksums
af948ef74bcb0faa81303d7ddf7e54df4fc15f35897659545bc96b5ee0796b2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Security for minumtium 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page