Merge pull request 'develop' (#8) from develop into main
Run VectorLoader Script / Explore-Gitea-Actions (push) Successful in 14s Details
Gitea Actions For Tree-Structurer / Explore-Gitea-Actions (push) Successful in 24s Details

Reviewed-on: #8
This commit is contained in:
Falko Victor Habel 2025-01-30 10:40:51 +00:00
commit b4f284eddf
11 changed files with 38 additions and 16 deletions

View File

@ -1,4 +1,4 @@
# Tree-Structurer
# prodir
This is a Python package designed to display directory structures in a tree-like format. This tool provides an easy-to-read overview of the directory hierarchy, making it easier for developers to navigate complex project structures.
@ -7,7 +7,7 @@ This is a Python package designed to display directory structures in a tree-like
To install `tree_structurer`, you can use pip:
```bash
pip install git+https://gitea.fabelous.app/Fabel/Tree-Structurer.git
pip install git+https://gitea.fabelous.app/Fabel/prodir.git
```
@ -18,13 +18,19 @@ You can run `tree_structurer` from the command line. By default, it will analyze
To display the directory structure of the current directory:
```bash
python -m tree_structurer
python -m prodir
```
or
```bash
prodir
```
To display the directory structure of a specific directory:
```bash
python -m tree_structurer /path/to/directory
python -m prodir /path/to/directory
```
#### Options
@ -34,12 +40,12 @@ python -m tree_structurer /path/to/directory
Example:
```bash
python -m tree_structurer /path/to/directory -v
python -m prodir /path/to/directory -v
```
#### Important Files and Folders Ignored
By default, `tree_structurer` ignores files and folders that start with `_` or `.`. However, it does include the following exceptions:
By default, `prodir` ignores files and folders that start with `_` or `.`. However, it does include the following exceptions:
- `__init__.py` and `__main__.py` files: These are considered important and will be included in the output.
- Special folders like `build`, `.git`, `node_modules`, etc.: These are also ignored to keep the output focused on the essential parts of the directory structure.

View File

@ -1,4 +1,4 @@
from tree_structurer import create_tree_structurer, get_structure
from prodir import create_tree_structurer, get_structure
create_tree_structurer()
for file in get_structure():

10
pyproject.toml Normal file
View File

@ -0,0 +1,10 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "prodir"
version = "0.0.6"
description = "A module for analyzing directory structures"
scripts = {prodir = "prodir.__main__:main"}
dependencies = []

View File

@ -1,4 +1,4 @@
from setuptools import setup, Extension
from setuptools import setup, Extension, find_packages
import platform
extra_compile_args = []
@ -11,17 +11,23 @@ else:
extra_compile_args.append('-std=c++17')
tree_structurer_module = Extension(
'tree_structurer._tree_structurer',
sources=['tree_structurer/cpp/bindings.cpp', 'tree_structurer/cpp/tree_structurer.cpp'],
include_dirs=['tree_structurer/cpp'],
'prodir._tree_structurer', # Remove 'src.' from the module name
sources=['src/prodir/cpp/bindings.cpp', 'src/prodir/cpp/tree_structurer.cpp'],
include_dirs=['src/prodir/tree_structurer/cpp'],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
setup(
name='tree_structurer',
name='prodir',
version='0.0.6',
description='A module for analyzing directory structures',
ext_modules=[tree_structurer_module],
packages=['tree_structurer'],
packages=find_packages(where="src"),
package_dir={"": "src"},
entry_points={
"console_scripts": [
"prodir=prodir.__main__:main",
],
},
)

1
src/prodir/__init__.py Normal file
View File

@ -0,0 +1 @@
from prodir._tree_structurer import create_tree_structurer, get_structure

View File

@ -1,7 +1,7 @@
import os
import sys
import argparse
from tree_structurer import create_tree_structurer, get_structure
from prodir import create_tree_structurer, get_structure
def main():
parser = argparse.ArgumentParser(description='Display directory structure in a tree-like format')

View File

@ -1,6 +1,6 @@
import pytest
from pathlib import Path
from tree_structurer import create_tree_structurer, get_structure
from prodir import create_tree_structurer, get_structure
def test_basic_structure(temp_directory):
"""Test that the basic directory structure is correctly represented."""

View File

@ -1 +0,0 @@
from tree_structurer._tree_structurer import create_tree_structurer, get_structure