Utility to prepare files for AI analysis
Project description
aixtract
A simple utility to prepare files for AI analysis by copying them with their directory structure encoded in the filename.
Description
aixtract reads a list of file paths from a .aixtract file and copies each file to a new directory, encoding the original path hierarchy into the filename using double underscores (__).
For example, src/models/user.py becomes src__models__user.py.
This is particularly useful when preparing files to upload to AI assistants that don't support directory structures.
Installation
pip install aixtract
Usage
- Create a
.aixtractfile in your project directory listing the files you want to process:
src/models/user.py
tests/test_user.py
config/settings.json
# Lines starting with # are ignored
- Run the command:
aixtract
The utility will:
- Create a new directory in your Downloads folder named
project_name_YYYYMMDD_HHMMSS - Copy each listed file to this directory, converting path separators to double underscores
- Preserve file permissions and metadata
- Open the target directory automatically (on supported platforms)
Example
If your project structure looks like this:
myproject/
├── .aixtract
├── src/
│ └── models/
│ └── user.py
├── tests/
│ └── test_user.py
└── config/
└── settings.json
And your .aixtract contains:
src/models/user.py
tests/test_user.py
config/settings.json
Running aixtract will create:
/tmp/myproject_20250101_123456/
├── src__models__user.py
├── tests__test_user.py
└── config__settings.json
Error Handling
The utility will:
- Skip files that don't exist with a warning
- Skip empty lines and comments in
.aixtract - Exit with error if
.aixtractfile is not found - Show clear error messages for any issues during copying
Requirements
- Python 3.8 or later
- Works on macOS, Linux, and Windows (directory opening feature supported on macOS and Linux)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aixtract-1.0.0.tar.gz.
File metadata
- Download URL: aixtract-1.0.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a8f6ff73911f39b96209160d89b504e7338274ea340ed1c4ee196ac7a43478a
|
|
| MD5 |
90cc45ee5c54a4df0538182ccf2dc5b3
|
|
| BLAKE2b-256 |
d6633db5e981c03cb9150932eadd496871506800f08ca2966f685476d73f775e
|
File details
Details for the file aixtract-1.0.0-py3-none-any.whl.
File metadata
- Download URL: aixtract-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b35dac7893f572edbd7e981f69044e604842fa2c6798938bc1a1a905cb3e2d
|
|
| MD5 |
9f710033cb2aa0d4242ffe4d83080edc
|
|
| BLAKE2b-256 |
31c0ba2ab51e4c81a76ef767219814f59712994855eb522cbd7c19b5d3bfa0e6
|