Skip to main content

A tool for detecting project structure and technology stack with the help of GPT.

Project description

PyPI version License: MIT Downloads

ProjectStructoR

ProjectStructoR is a Python tool designed to analyze directories and detect the project structure and technology stack used in the files. It leverages GPT from OpenAI to provide a comprehensive analysis including the count of files, lines of code, and the likely technologies present.

Installation

To install ProjectStructoR, you can use pip:

pip install ProjectStructoR

Usage

As a Python Module

ProjectStructoR can be used as a Python module in your scripts.

Example:

from projectstructor.detector import ProjectStructureDetector

# Initialize the detector with the target directory and your OpenAI API key
detector = ProjectStructureDetector('/path/to/your/project', 'your-openai-api-key')

# Detect the structure of the project
print(detector.detect_structure(ignore_gitignore=True))

# Detect the languages used in the project
print(detector.detect_languages())

# Analyze with GPT and print the JSON result
chat_completion = detector.analyze_with_gpt()
content = chat_completion.choices[0].message.content
result = json.loads(content)
print(json.dumps(result, indent=2))

As a Command Line Tool

Currently, ProjectStructoR is intended to be used as a module in Python scripts. If there's enough interest, command line functionality may be added in future versions.

Output Example

When you run ProjectStructoR, it outputs the structure of the project directory and a report with the detected languages and technologies. Here is an example output:

detected structure: 
project/
|-- main.py
|-- utils/
|   |-- __init__.py
|   |-- helper.py

detected languages and technologies: 
Python files: 3, lines of code: 120
JavaScript files: 1, lines of code: 45

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

License

MIT

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

ProjectStructoR-0.0.8.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

ProjectStructoR-0.0.8-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file ProjectStructoR-0.0.8.tar.gz.

File metadata

  • Download URL: ProjectStructoR-0.0.8.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for ProjectStructoR-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f3f1c2c36c3320da4df844e7742eb3b04bc1beca8961005e8922774a54a28d98
MD5 685ad0db444e18e251343347d2bbd972
BLAKE2b-256 bbe6b8a010febcc830274b1edac846be89e2d7bb10efd996d2bffa8c155e644b

See more details on using hashes here.

File details

Details for the file ProjectStructoR-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for ProjectStructoR-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 06eac9fb410eaa66a1d0dbcbbdf5bc967fdbcfe489a0b1fcc2af0ed59b62f53d
MD5 1ced9f8301f4442668363a3ef65884f9
BLAKE2b-256 1ee11ef94a48b11e2879bccad261838c8206645f7d57c1eeaa320ddefb53f510

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