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.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 user-registration 0.1.0
File Size Uploaded
user_registration-0.1.0.tar.gz 27.9 kB Details

Built distribution (wheel)

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

Total release size: 46.6 kB

Release files / user_registration-0.1.0.tar.gz

Download URL user_registration-0.1.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4b1434657709ea991f9160403422a62fa0e5cb36c945bc9b1ef22e88154b1013
BLAKE2b-256 checksum
How to use checksums
49180a8836436f727dc39ab2c8ffe0fd7bc33a1d3f8441f9c34a7a17d2c1f5c6
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.0-py3-none-any.whl

Download URL user_registration-0.1.0-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63e31150ca0ddde52d9972fde9673ea10e5e7a5cc12e98c395a0ab8284baf9ae
BLAKE2b-256 checksum
How to use checksums
abf75faabc6d5aa6f657bbe2c7ba80e3477ee4c0d3eb2106b0e43f68553829c2
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

This release

0.1.0 This release

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