# Dependencies for user-scanner: Core Requirements and Optional Extras Explained

> Discover user-scanner dependencies. Learn about essential Python packages like httpx, socksio, and rich, plus optional extras for advanced features.

- Repository: [Kaif/user-scanner](https://github.com/kaifcodec/user-scanner)
- Tags: deep-dive
- Published: 2026-08-30

---

**The `user-scanner` CLI requires five core Python packages—`httpx[http2]`, `socksio`, `colorama`, `curl_cffi`, and `rich`—for asynchronous networking, proxy support, and terminal output, alongside optional extras for PDF reporting and MCP server functionality.**

The `user-scanner` repository by **kaifcodec** is a pure-Python tool designed for asynchronous user enumeration and web scanning. Understanding the dependencies for user-scanner ensures proper environment configuration and reveals which optional features require additional packages beyond the core runtime.

## Core Dependencies for user-scanner

All mandatory dependencies are pinned in **[`requirements.txt`](https://github.com/kaifcodec/user-scanner/blob/main/requirements.txt)** and the **`dependencies`** array of **[`pyproject.toml`](https://github.com/kaifcodec/user-scanner/blob/main/pyproject.toml)**. These five packages power the networking, proxy handling, and CLI presentation layers.

- **httpx[http2]** (`>=0.27,<0.29`): The asynchronous HTTP client driving all web requests. In [`user_scanner/core/orchestrator.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/orchestrator.py), the `make_request` function relies on this library for concurrent HTTP/2 connections.

- **socksio** (`>=1.0,<2`): Provides SOCKS proxy support integrated via the `get_proxy` function in the same orchestrator module.

- **colorama** (`>=0.4,<1`): Enables cross-platform ANSI color handling for terminal output, ensuring consistent display of category headings across Windows and Unix systems.

- **curl_cffi** (`>=0.7,<1`): A CFFI-backed libcurl wrapper used in [`user_scanner/core/impersonate.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/impersonate.py) for sites requiring browser impersonation and advanced TLS fingerprinting.

- **rich** (`>=13.0.0`): Supplies progress bars, formatted console output, and styled logging throughout the scanning engine.

## Optional Dependency Extras

`user-scanner` declares three optional groups under `[project.optional-dependencies]` in [`pyproject.toml`](https://github.com/kaifcodec/user-scanner/blob/main/pyproject.toml) to enable extended functionality without bloating the core install.

### PDF Generation (pdf)

Install with `pip install "user-scanner[pdf]"`. This extra includes:

- **reportlab** (`>=4.0.0`): PDF generation engine
- **pillow** (`>=10.0.0`): Image processing for embedded graphics
- **svglib** (`>=1.5.0`): SVG conversion utilities

These enable the `generate_pdf` function in [`user_scanner/core/pdf_generator.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/pdf_generator.py).

### MCP Server (mcp)

Requires **mcp** (`>=1.2.0,<2`) to run the micro-service server implementation found in [`user_scanner/mcp/server.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/mcp/server.py). Install via `pip install "user-scanner[mcp]"`.

### Development Tools (dev)

Includes **pytest**, **pytest-cov**, **pytest-anyio**, and **anyio[trio]** for running the test suite in the `tests/` directory. Install with `pip install -e ".[dev]"` for editable development installs.

## Installation and Usage Examples

Install the core package from source:

```bash
git clone https://github.com/kaifcodec/user-scanner.git
cd user-scanner
pip install -r requirements.txt

```

Install with PDF support:

```bash
pip install "user-scanner[pdf]"

```

Basic Python usage utilizing the core dependencies:

```python
from user_scanner.core.orchestrator import run_user_full
from user_scanner.core.helpers import ScanConfig

config = ScanConfig(username="example_user")
results = run_user_full("example_user", config)

for r in results:
    print(r)  # Rich-styled output requires the rich dependency

```

Generate PDF reports (requires the `pdf` extra):

```python
from user_scanner.core.pdf_generator import generate_pdf

generate_pdf(results, output_path="report.pdf")

```

## How Dependencies Are Used in Source Files

Specific modules isolate imports to optimize performance and prevent loading unused packages:

- **[`user_scanner/core/orchestrator.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/orchestrator.py)**: Imports `httpx` for the `make_request` coroutine and uses `socksio` for proxy routing via `get_proxy`. This file represents the central networking engine.

- **[`user_scanner/core/impersonate.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/impersonate.py)**: Conditionally imports `curl_cffi` for sites blocking standard HTTP clients, handling advanced browser impersonation.

- **[`user_scanner/core/pdf_generator.py`](https://github.com/kaifcodec/user-scanner/blob/main/user_scanner/core/pdf_generator.py)**: Imports `reportlab` and `pillow` only when the `pdf` extra is installed, compiling scan results into formatted documents.

## Summary

- **Five core packages** are mandatory: `httpx[http2]`, `socksio`, `colorama`, `curl_cffi`, and `rich`
- **Three optional extras** extend capabilities: `pdf` for report generation, `mcp` for micro-service server functionality, and `dev` for testing
- Version constraints in [`pyproject.toml`](https://github.com/kaifcodec/user-scanner/blob/main/pyproject.toml) and [`requirements.txt`](https://github.com/kaifcodec/user-scanner/blob/main/requirements.txt) prevent breaking changes from upstream updates
- Heavy dependencies like `reportlab` are isolated in specific modules (e.g., [`pdf_generator.py`](https://github.com/kaifcodec/user-scanner/blob/main/pdf_generator.py)) to keep the core tool lightweight

## Frequently Asked Questions

### What is the minimum Python version for user-scanner dependencies?

The use of `httpx>=0.27` and modern asynchronous syntax in [`orchestrator.py`](https://github.com/kaifcodec/user-scanner/blob/main/orchestrator.py) requires Python 3.8 or higher. The `rich` library further enforces compatibility with recent Python releases.

### Can I run user-scanner without installing curl_cffi?

No, `curl_cffi` is a mandatory dependency listed in [`requirements.txt`](https://github.com/kaifcodec/user-scanner/blob/main/requirements.txt). While `httpx` handles standard requests, the [`impersonate.py`](https://github.com/kaifcodec/user-scanner/blob/main/impersonate.py) module requires `curl_cffi` for sites with advanced bot protection mechanisms.

### Why are strict version upper bounds enforced on core dependencies?

Constraints like `<0.29` for `httpx` and `<2` for `socksio` prevent breaking changes from future major version updates. According to the [`pyproject.toml`](https://github.com/kaifcodec/user-scanner/blob/main/pyproject.toml) specification, these bounds ensure the scanning engine remains compatible with tested API surfaces.

### How do I install dependencies for contributing to the project?

Clone the repository and install with the `dev` extra: `pip install -e ".[dev]"`. This installs **pytest**, **pytest-cov**, and **anyio** necessary for running the test suite located in the `tests/` directory.