Skip to main content

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. For this reason, it is currently unavailable as a pip package.

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 and mimetypes libraries for file and directory manipulation.
  • Text Encoding and Decoding: The program uses Python's built-in codecs and io 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


Download files

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

Source Distribution

get_context-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

get_context-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file get_context-0.1.0.tar.gz.

File metadata

  • Download URL: get_context-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for get_context-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3aefcee36eace11b8ab2cd64d322fe8185d44790381503fc201fa6f02c9d8f6b
MD5 c6337c52e8b02244441d7b099b3c3192
BLAKE2b-256 042bc00ce347034dc7c15af6a2b0ce6ca298b920f0106804a725f526127bf52d

See more details on using hashes here.

File details

Details for the file get_context-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: get_context-0.1.0-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

Hashes for get_context-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 030ed1ee8cc8b1d55eea4505c1c761ac8ab95f4a7be49731e3f21b5bfbcf6084
MD5 45b9b8ca01f8e65dc9ff1e0041652d13
BLAKE2b-256 cd27de4a3e139bd4136f1c926f90be2761b1c842f0e6da6c27d16ac51cda01f8

See more details on using hashes here.

Supported by

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