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.3

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.3
File Size Uploaded
user_registration-0.1.3.tar.gz 30.3 kB Details

Built distribution (wheel)

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

Total release size: 49.0 kB

Release files / user_registration-0.1.3.tar.gz

Download URL user_registration-0.1.3.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2aad73112b13981cc9f1020d386c8b43359c76477bd55b399f25dc42a32c62c0
BLAKE2b-256 checksum
How to use checksums
79bf151dc57158b9444cead0c02037c60690538cab9e1b5126db6eda0c50ea57
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.3-py3-none-any.whl

Download URL user_registration-0.1.3-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90002715bb25647b2fe99f60718a3b1961507854fd5cdcc13efd0affc9ecef86
BLAKE2b-256 checksum
How to use checksums
fbacada976e0d7875df08591d5f872256f5e5d51ba9997a96ccd0a7ea3e95954
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.3 This release

2 release files

0.1.2

2 release files

0.1.1

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