Skip to main content

User Registration

A framework-agnostic and database-agnostic user registration package for Python applications.

user-registration provides the domain and application layer for registering users while keeping framework and persistence concerns outside the core package.

Features

  • Python 3.12+
  • Typed Python API
  • Framework independent
  • Database independent
  • Configurable registration behavior
  • Username validation
  • Email validation
  • Extensible validation registry
  • Password policy integration via password-validator-s
  • Argon2 password hashing
  • Repository abstraction
  • Custom repository implementations
  • Registration hooks
  • Duplicate-user detection
  • FastAPI adapter
  • SQLAlchemy adapter
  • Unit and integration tests
  • Static type checking with mypy
  • Linting and formatting with Ruff

Core flow

            RegistrationRequest
                 |
                 v
            RegistrationService
 +--------------------------------+
  |      |          |         |
  v      v          v         v
fields validation password repository
                   policy
                     |
                     v
                  hashing
                     |
                     v
                    User

Architecture

The core package does not depend on FastAPI, Django, Flask, SQLAlchemy, PostgreSQL, MongoDB, or any other infrastructure technology.

                       Application
                            |
                            v
                  +--------------------+
                  | RegistrationService|
                  +---------+----------+
                            |
          +-----------------+------------------+
          |                 |                  |
          v                 v                  v
   ValidationRegistry  PasswordHasher   UserRepository
                            |
                            v
                         Argon2

Basic usage

from user_registration import (
    Argon2Hasher,
    PasswordValidatorAdapter,
    RegistrationConfig,
    RegistrationRequest,
    RegistrationService,
)

service = RegistrationService(
    repository=repository,
    password_hasher=Argon2Hasher(),
    password_validator=PasswordValidatorAdapter(),
    config=RegistrationConfig(),
)

result = service.register(
    RegistrationRequest(
        username="shuvo",
        email="shuvo@example.com",
        password="StrongPassword123!",
    )
)

if result.success:
    print(result.user_id)
else:
    print(result.status, result.errors)

The application supplies the repository implementation.

Explicitly out of scope

The core does not implement login, JWT, OAuth/OIDC, sessions, MFA, RBAC, password reset, email delivery, ORM models, database connections, or HTTP routing.

Development

.venv/bin/python -m pytest -v
.venv/bin/python -m mypy src
.venv/bin/python -m ruff check src tests
.venv/bin/python -m ruff format --check src tests
.venv/bin/python -m build

License

MIT

Visit https://github.com/ShamimurRahmanShuvo/user_registration/tree/main/docs, for more details

Release files for user-registration 0.1.1

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

Source distribution (sdist)

Source distribution for user-registration 0.1.1
File Size Uploaded
user_registration-0.1.1.tar.gz 27.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for user-registration 0.1.1
File Interpreter ABI Platform
user_registration-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / user_registration-0.1.1.tar.gz

Download URL user_registration-0.1.1.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4feb424437d12e6157e6dccaea0c87acfa459e3beb3b0135c0d89a4470ade3fb
BLAKE2b-256 checksum
How to use checksums
17a084edda52864932b97177c097d7bf26ab5b333e8dd70dc28d1b9a888d1327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / user_registration-0.1.1-py3-none-any.whl

Download URL user_registration-0.1.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e8de1e17b27ec78bc0fdc369dcc820860e30f30e4211a37ca9a4388113ce330
BLAKE2b-256 checksum
How to use checksums
1dcf5ca436e05efa7ec78fba01810f458c9e66f4305f93c0012c136db8e0bf10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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