Skip to main content

A CLI tool to bundle entire projects into a single AI-friendly context file.

Project description

codefile – Python Project Packager

What Is codefile?

codefile is a Python package that scans your project directory and packs everything into a single output file named:

CodeFile

It includes:

  • Project folder structure (tree view)
  • File contents
  • Total size (in MB)
  • UTC creation timestamp

This is useful for:

  • Creating project snapshots
  • Sharing full source code as one file
  • Simple archiving
  • Backup purposes
  • AI context

Installation

If installed from source:

pip install .

installing as a package:

pip install codefile

How To Use

Step 1: Open terminal inside your project folder.

Step 2: Run:

codefile

Step 3: After execution, a new file will appear:

CodeFile

That file contains your full project snapshot.

What Gets Packed?

✔ All regular files in the current directory
✔ Subdirectories
✔ File contents
✔ Directory structure

Automatically ignored:

  • .git folder
  • The generated CodeFile
  • The package script itself
  • Patterns listed in .gitignore (if present) (Basic)

Output File Structure

The generated file contains:

ROOT_NAME <project_name> CREATED_UTC TOTAL_SIZE_MB

START_STRUCTURE FOLDER TREE END_STRUCTURE

FILE_START <relative_path> <file_id> CONTENT FILE_END <relative_path> <file_id>

Technical Details

  • Uses SHA-256 hashing (first 12 characters as ID)
  • Reads files in chunks (memory safe)
  • Skips unreadable or broken files safely
  • Writes output using UTF-8 encoding

Requirements

  • Python 3.8+
  • No external dependencies (uses standard library only)

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

codefile-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

codefile-1.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file codefile-1.0.1.tar.gz.

File metadata

  • Download URL: codefile-1.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codefile-1.0.1.tar.gz
Algorithm Hash digest
SHA256 34ce4cd9c681b307a2405dde9767adbc93a0fcb94287a08edd8f0ace80b2367f
MD5 90a078772ddf596225446fd91f85844f
BLAKE2b-256 3edbbdd7ea572334557bfed6843a3b06db7a7854ce47c0db56d584eb360d9890

See more details on using hashes here.

Provenance

The following attestation bundles were made for codefile-1.0.1.tar.gz:

Publisher: python-publish.yml on anthroberc/codefile

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

File details

Details for the file codefile-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: codefile-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codefile-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b30e4cb0b5b7ddd69e22b97c602ed0a9db0c4747412ee092c139869b978aa0f
MD5 77ab5faaa360f4784fa58fb7afca7f4d
BLAKE2b-256 54f4dd7a3a4af1838dbc5335c1388b82d0e0ce1de1b62b9df83373c0b0202b41

See more details on using hashes here.

Provenance

The following attestation bundles were made for codefile-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on anthroberc/codefile

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