ALogin Overview

ALogin

Lightweight Python authentication library with SHA-256 hashing and a zero-dependency JSON user store.

Python 3.6+ pip install alogin MIT License
ALogin provides simple, secure account creation and login for Python CLI tools and scripts — no external dependencies required.

Features

Account creation
Register users with email validation and duplicate protection.
Login authentication
Authenticate accounts with hashed password comparison.
SHA-256 hashing
Passwords are never stored or transmitted in plain text.
JSON user database
Flat-file storage with zero external dependencies.

Quickest way to start

bash
pip install alogin
python
from alogin import create_account, login_account
create_account()
login_account()
Continue to Installation →

Installation

Install ALogin from PyPI — no external dependencies needed.

Requirements

Python 3.6 or higher. ALogin only uses modules from the standard library (hashlib, json, getpass).

Install via pip

bash
pip install alogin

Install from source

bash
git clone https://github.com/ADEEP13/alogin.git
cd alogin
pip install -e .

Verify installation

bash
python -c "import alogin; print('ALogin installed successfully')"
Using a virtual environment? Run python -m venv venv && source venv/bin/activate before installing.

Quick start

Create an account and authenticate a user in under ten lines of Python.

Step 1 — create an account

Call create_account(). It prompts for an email and password, hashes the password, and writes the record to users.json.

python
from alogin import create_account

create_account()
# → Enter email: user@example.com
# → Enter password: ********
# → Account created!

Step 2 — log in

Call login_account(). Returns True on success, False otherwise.

python
from alogin import login_account

result = login_account()
if result:
    print("Welcome back!")

Full example

python
from alogin import create_account, login_account

create_account()
authenticated = login_account()
if authenticated:
    print("Access granted.")
else:
    print("Access denied.")

API reference

Full reference for all public functions exported by ALogin.

create_account() → None

Interactively prompts for a new user's email and password. Hashes the password with SHA-256 and writes the record to users.json. Raises a ValueError if the email is already registered.

ParameterTypeDescription
No parameters — prompts via stdin.
python
from alogin import create_account
create_account()  # returns None
login_account() → bool

Prompts for email and password. Hashes the input and compares it against the stored SHA-256 hash. Returns True if credentials match, False otherwise.

ReturnsTypeDescription
resultboolTrue on successful authentication, False on failure.
python
result = login_account()  # returns True or False

Security

How ALogin protects user credentials and what to be aware of in production.

ALogin is designed for educational use and prototyping. For production systems, use a dedicated auth service (e.g. Auth0, Supabase Auth, or Django's auth framework).

Password hashing

All passwords are hashed using SHA-256 via Python's hashlib module before being written to disk. Plain-text passwords are never stored or logged.

Duplicate email protection

Each email address can only be registered once. Attempting to create a second account raises a ValueError before any write occurs.

JSON storage

User records are stored in a local users.json file. Ensure this file is excluded from version control.

.gitignore
users.json

Known limitations

SHA-256 without salting is vulnerable to rainbow table attacks. For stronger security, use bcrypt or argon2 in your own implementation.

Changelog

Full version history for ALogin.

v0.1.2Latest
Fixes
  • Resolved bugs in __init__.py
v0.1.1Improvements
Improvements
  • Exported both create_account() and login_account() from the package
  • Cleaner import style — use from alogin import create_account, login_account
v0.1.0Initial release
Initial authentication system release with:
  • JSON-based user database
  • Login authentication system
  • Password hashing
  • Duplicate email protection

Download stats

Live PyPI download data fetched automatically from pypistats.org — updated daily.

Could not fetch live data. Showing last known values.
Total downloads
All-time on PyPI
Last 30 days
Excluding mirrors
Last 7 days
Excluding mirrors

Daily downloads — last 90 days

Download trend (all versions)

Version distribution

Share of downloads by version over the last 90 days.

Package info

Latest version
0.1.2
Released
Mar 6, 2026
Author
ADEEP AG
Fetching live data…
View interactive charts, country breakdowns, and full history on pepy.tech →