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)
| File | Size | Uploaded | |
|---|---|---|---|
| user_registration-0.1.1.tar.gz | 27.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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