Skip to main content

Installation

Get started with RBAC Algorithm in less than 5 minutes.

Choose Your Language

Requirements

  • Python 3.8 or higher (tested on Python 3.13)
  • pip
  • Git (for cloning repository)

Installation Steps

1. Clone the Repository

git clone https://github.com/yourusername/rbac-algorithm.git
cd rbac-algorithm
# Create virtual environment
python -m venv venv

# Activate it
# On Windows:
venv\Scripts\activate

# On Linux/Mac:
source venv/bin/activate

3. Install Dependencies

# Install in development mode
pip install -e .

# Or install dependencies manually
pip install dataclasses-json typing-extensions

4. Verify Installation

from rbac import RBAC

# Initialize RBAC
rbac = RBAC()
print("RBAC Algorithm successfully installed!")
print(f"Storage: {type(rbac.storage).__name__}")

Run Examples

# Run basic usage example
python examples/basic_usage.py

# Run ABAC example
python examples/abac_example.py

Development Installation

If you want to contribute or customize the library:

Clone the Repository

git clone https://github.com/your-org/rbac-algorithm.git
cd rbac-algorithm

Install Dependencies

# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

Storage Backends

By default, RBAC Algorithm uses in-memory storage. For production, you'll want a persistent storage backend:

PostgreSQL

pip install rbac-algorithm[postgres]

MongoDB

pip install rbac-algorithm[mongodb]

Redis

pip install rbac-algorithm[redis]

MySQL

pip install rbac-algorithm[mysql]

See Custom Storage Guide for details.

Docker

Run RBAC Algorithm in a container:

docker pull rbac-algorithm/rbac-algorithm:latest

docker run -p 8080:8080 rbac-algorithm/rbac-algorithm:latest

Troubleshooting

Python: Module Not Found

# Ensure pip is up to date
pip install --upgrade pip

# Install with verbose output
pip install -v rbac-algorithm

Node.js: Permission Errors

# Use npx or install globally with sudo
sudo npm install -g rbac-algorithm

Version Conflicts

# Check installed version
pip show rbac-algorithm # Python
npm list rbac-algorithm # Node.js

Next Steps

RBAC Algorithm

Ready to Implement Enterprise-Grade Access Control?

Get started with RBAC Algorithm in minutes with our comprehensive documentation and examples.