Generates a single text document for a directory
Project description
GET CONTEXT
About
Get Context is a directory context generator designed to provide a structured overview of the contents of a directory and its subdirectories. It generates a single text file that lists the directory structure and the contents of text or program files, while excluding non-human-readable files such as binary or multimedia files. This tool is particularly useful for organizing and reviewing large codebases or data directories. It can also be used to easily pass the contents of a directory to a large language AI model for further analysis.
Installation and Usage
This program is available as the Python package "get_context". If Python is installed on your system, you should be able to run:
pip install get_context
After the package is installed, the program can be run on the command line by typing:
get_context <directory> [file_extensions...]
The program takes the directory as the first argument and can optionally filter files by specified extensions. For example:
get_context . .py .txt
This will generate a text file containing the directory structure and the contents of .py
and .txt
files within the specified directory.
Disclaimer
This program is still in development and is currently buggy. Further testing and implementation is required before it can be used as a fully-fledged, reliable product.
Attributions
This program uses both Python’s built-in libraries and external libraries for various functionalities:
- File and Directory Handling: The program uses Python’s built-in
os
andmimetypes
libraries for file and directory manipulation. - Text Encoding and Decoding: The program uses Python's built-in
codecs
andio
libraries to handle different text encodings. - Pattern Matching: The program uses the external
pathspec
library to handle file exclusion patterns, specifically for interpreting and applying.gitignore
-style patterns.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
File details
Details for the file get_context-0.1.1.tar.gz
.
File metadata
- Download URL: get_context-0.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb8f65b31583649b8452cf40d35046f58723a952ee1fed946b5bfb20c33e43b1 |
|
MD5 | 1e7df59184ba971993c536a6f4e2589b |
|
BLAKE2b-256 | 612ee2a635c59a23a17b75af473c05c20eb05ecbca376821c182065dfa608ebf |
File details
Details for the file get_context-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: get_context-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98b1a3b39d389597bd46b96a8f6d0ac3aa99f7baad60fe4224388c011d91026b |
|
MD5 | bdacac7042284477e9ccf879b9840067 |
|
BLAKE2b-256 | dbb3a3fc13ca188d0608be10e545ee137e409e53eab8058acf430ad6d1c25d3b |