Skip to main content

Scriber 2.0: build intelligent code packs from one or more project paths.

Project description

ProjectScriber Logo
ProjectScriber Name

License Latest Version PyPI Version

An intelligent tool to map, analyze, and compile project source code into a single, context-optimized text file for Large Language Models (LLMs). Version 2.0 brings advanced dependency graph analysis, strict whitelist-based file inclusion, zero-dependency lightweight execution, and progress tracking!


📖 Table of Contents


🤔 Why ProjectScriber 2.0?

When working with Large Language Models, providing the full context of a codebase is crucial for getting accurate analysis, documentation, or refactoring suggestions. However, blindly pasting an entire project wastes tokens and introduces noise.

ProjectScriber 2.0 automates context building using a Whitelist-First philosophy and an Intelligent Scoring Engine. It analyzes your codebase's dependency graph (e.g., Python imports), determines which files are most relevant to the code you're working on, and bundles them into a single, clean markdown file, strictly respecting your token budgets and file-type configurations.

📁 Your Codebase → 📦 ProjectScriber 2.0 → 📋 LLM-Ready Context


✨ Key Features

Feature Description
🌳 Smart Project Mapping Generates a clear and intuitive tree view of your project's structure.
⚡ Native Rust Acceleration Accelerates heavy I/O and directory scanning natively via a high-performance Rust backend.
🛡️ Whitelist Philosophy By default, only recognized code and support files are included. Binary and lock files are automatically ignored.
🧠 Intelligent Scoring Engine Analyzes import graphs and file proximity to prioritize code modules that are directly related to your provided seed files.
💰 Token Budgets Set a hard limit on --max-tokens. Scriber will fit the most relevant files within your budget to save API costs.
📊 Live Progress & Stats Built-in zero-dependency progress spinner and detailed statistics summary at the end of the run.

🚀 Quick Start

  1. Install Scriber:

    pip install project-scriber
    
  2. Navigate to your project's root and initialize config:

    scriber --init
    

    (This appends a [tool.scriber] block to your pyproject.toml. Use --force to overwrite it.)

  3. Pack your context! Just point it to a file, folder, or let it scan the whole project:

    scriber src/main.py --output context.md
    
  4. Review your stats:

    Scriber build completed.
    ----------------------------------------
     Code files included:    15
     Support files included: 4
     Files omitted/skipped:  2
     Estimated tokens:       12500
    ----------------------------------------
    Scriber pack written to: context.md
    

💾 Installation

ProjectScriber distributes pre-compiled binary wheels for Linux, macOS, and Windows. A simple pip command is all you need:

pip install project-scriber

Or if you use uv:

uv pip install project-scriber

[!NOTE] If a pre-compiled wheel is not available for your platform/architecture, the package will automatically build from source, which requires a Rust compiler toolchain (Rust 1.70+) installed on your machine.


🖥️ Command-Line Usage

Basic Commands

  • Scan the current directory:
    scriber .
    
  • Scan a specific file and its dependencies:
    scriber src/my_module.py
    
  • Interactive Setup: Create/Append a default configuration in pyproject.toml (use --force to overwrite it).
    scriber --init
    

CLI Options

Option Description
paths Project file/folder paths used as seeds. Defaults to current directory ..
--config [path] Path to pyproject.toml. Its parent directory becomes the project root.
--path-base [base] Base for relative paths: project (default) or cwd.
--format [md, txt] Output format. Defaults to md (Markdown).
--output [file] Output file path. Use - for stdout.
--dry-run Show pack summary without writing the output file.
--open Open the generated file in the default editor.
--validate-config Validate the [tool.scriber] configuration and exit.
--only-tree Render only the scored tree/map, without any file contents.
--[no-]modules Enable/Disable automatic related module selection (dependency graph scanning).
--[no-]support Enable/Disable support files (like .env.example, .github/workflows).
--support-content Override support file content policy (full, auto, tree_only).
--max-files Maximum number of files in the pack.
--max-tokens Approximate token budget using char-based estimation. 0 disables budget.
--min-score Minimum relevance score (0-100) for non-seed files to be included.
--init Append a default [tool.scriber] config to pyproject.toml and exit.
--force Force overwrite of the config block when used with --init.
--version Show program's version number and exit.

⚙️ Configuration

ProjectScriber 2.0 configures itself through the standard pyproject.toml using the [tool.scriber] table. Generate the default block using:

scriber --init

Example pyproject.toml

[!NOTE] This is a minimal example. Run scriber --init to generate the full default configuration.

[tool.scriber]
format = "md"
max_tokens = 0        # 0 means unlimited
max_files = 0         # 0 means unlimited
only_tree = false     # If true, file contents are omitted
allow_external_paths = false

[tool.scriber.modules]
enabled = true
content_min_score = 50

[tool.scriber.tokens]
estimator = "chars"
chars_per_token = 4

[tool.scriber.code_files]
# Only files matching these are considered "Code"
patterns = [
    "**/*.py",
    "**/*.js",
    "**/*.ts",
    "**/*.tsx"
]

[tool.scriber.support_files]
enabled = true
# Only files matching these are considered "Support"
patterns = [
    "pyproject.toml",
    "Dockerfile",
    "**/*.svg"
]

[tool.scriber.support_files.content]
default = "auto"
auto_max_bytes = 10000
full = [
    "pyproject.toml",
    "requirements.txt",
    "README.md"
]
tree_only = [
    "**/*.svg"
]

[tool.scriber.hard_ignore]
# Folders ignored entirely during the initial scan
patterns = [
    ".git/**",
    "__pycache__/**",
    "node_modules/**",
    ".venv/**"
]

Whitelist Policy

ProjectScriber 2.0 uses a strict whitelist approach:

  1. Files must match either a code_pattern or a support_pattern to be considered.
  2. Unrecognized extensions and binary files are automatically excluded, keeping your LLM context safe from binary garbage.
  3. Lock files are included in the tree by default, but their contents are omitted to save tokens.
  4. Support files can be marked as tree_only (e.g., **/*.svg), meaning they'll show up in the project map but their contents won't be read.

🤝 Contributing & Development

Contributions are welcome!

Development Setup

  1. Clone the Repository:

    git clone https://github.com/SunneV/ProjectScriber.git
    cd ProjectScriber
    
  2. Install Dependencies & Compile Extension (using uv is recommended):

    uv sync --all-extras
    

    (This synchronizes the virtual environment and compiles the native Rust extension automatically!)

  3. Run Tests:

    uv run pytest
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

project_scriber-2.0.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

project_scriber-2.0.0-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

project_scriber-2.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

project_scriber-2.0.0-cp310-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file project_scriber-2.0.0.tar.gz.

File metadata

  • Download URL: project_scriber-2.0.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for project_scriber-2.0.0.tar.gz
Algorithm Hash digest
SHA256 404f3bbebf3fc6801b1f68249fd8460081865cf0429d5926807b501f90d26c82
MD5 c6be9081e16d5ca547bd084eeafb21db
BLAKE2b-256 0846eb36910e145cc0b5e9193f5b98831d544b9c42a8a35a28597a2685e1388e

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_scriber-2.0.0.tar.gz:

Publisher: release.yml on SunneV/ProjectScriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file project_scriber-2.0.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for project_scriber-2.0.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a05643c85c87bb27164e8ea87043be3a2f33b755c7794def150ccf54bd0ba4b6
MD5 13f17e30a16e62287b4179fc010dc0fc
BLAKE2b-256 1d015fd20910f339ff07821f8875d04aeec4515014c2c0256ba87dae0406cec0

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_scriber-2.0.0-cp310-abi3-win_amd64.whl:

Publisher: release.yml on SunneV/ProjectScriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file project_scriber-2.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for project_scriber-2.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 848e98bc0a93973787cab6abc09c26fde6be26dde2cf7188e5879f5f76721db5
MD5 d017ae4681694b6568e395a237688f28
BLAKE2b-256 437b0f9bcd8b2c31d30709d8cba50920d9c12489a40fb358e048341dab0d4b7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_scriber-2.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on SunneV/ProjectScriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file project_scriber-2.0.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for project_scriber-2.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e7167cf4efe3dcf668e1d763a186677d2e2ca8ab2bd54e7cbcced7d323716bd
MD5 8f07e8807d44cdd559a73ef8afde5a4c
BLAKE2b-256 283f38075b0eb76e45abe7a42ab1adaacab19640f03a8cae74af9de07d0c7f1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_scriber-2.0.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on SunneV/ProjectScriber

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page