| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
FileTreeCreator, web sitesi veya dosya sistemi dokümantasyonu için belirtilen dizinden başlayarak tüm alt dizin ve dosyaları özyinelemeli olarak tarayan Python aracıdır.
Dosya ve klasör yapısını JSON formatında dışa aktarır, her dosya için boyut, tarih, göreli yol ve tam URL bilgilerini toplar.
Web sitesi dokümantasyonu ve otomasyonu amacıyla eksiksiz dosya ağacı oluşturmak için tasarlanmıştır.
last_modify: 2025-07-20
from FileTreeCreator import FileTreeCreatorimport os
from pathlib import Path
from FileTreeCreator import FileTreeCreator
# Temel parametrelerle kullanım
base_dir = Path(os.getcwd())
output_dir = Path(os.path.join(base_dir, "output"))
output_file = Path("file_tree.json")
# FileTreeCreator'ı çalıştır
creator = FileTreeCreator(
base_dir=base_dir,
output_dir=output_dir,
output_file=output_file
)from pathlib import Path
from FileTreeCreator import FileTreeCreator
# Belirli klasör ve dosyaları hariç tutarak kullanım
base_dir = Path("/path/to/your/website")
passDirs = ["node_modules", ".git", "__pycache__", "venv"]
passFiles = [".DS_Store", "*.log", "*.tmp"]
output_dir = Path("./output")
output_file = Path("website_tree.json")
creator = FileTreeCreator(
base_dir=base_dir,
output_dir=output_dir,
output_file=output_file,
passDirs=passDirs,
passFiles=passFiles
)import os
from pathlib import Path
from FileTreeCreator import FileTreeCreator
# Proje için özelleştirilmiş kullanım
project_root = Path(os.getcwd())
exclude_dirs = ["dist", "build", "node_modules", ".git"]
exclude_files = ["*.pyc", "*.log", ".env"]
output_location = Path(project_root / "docs" / "file_structure")
output_filename = Path("project_structure.json")
# Dosya ağacını oluştur
FileTreeCreator(
base_dir=project_root,
output_dir=output_location,
output_file=output_filename,
passDirs=exclude_dirs,
passFiles=exclude_files
)
print(f"Dosya ağacı başarıyla oluşturuldu: {output_location / output_filename}")Ana FileTreeCreator sınıfı constructor'ı.
Parametreler:
Tek bir dosyanın bilgilerini tutar.
Özellikler:
Bir dizinin bilgilerini tutar.
Özellikler:
{
"name": "root_folder",
"url": "root",
"size": 0,
"date": "2025-07-20",
"relative_path": "",
"full_url": "https://example.com/root",
"folder": [
{
"name": "subfolder",
"url": "subfolder",
"size": 0,
"date": "2025-07-20",
"relative_path": "subfolder",
"full_url": "https://example.com/subfolder",
"folder": [...],
"files": [
{
"name": "example.txt",
"url": "subfolder/example.txt",
"size": 1024,
"date": "2025-07-20",
"relative_path": "subfolder/example.txt",
"full_url": "https://example.com/subfolder/example.txt"
}
]
}
],
"files": [...]
}# FileTreeCreator.py dosyasında BASE_URL değişkenini düzenleyin
BASE_URL = "https://yourdomain.com"# Yaygın hariç tutma örnekleri
exclude_dirs = [
"node_modules", # Node.js bağımlılıkları
".git", # Git repository
"__pycache__", # Python cache
".vscode", # VS Code ayarları
"dist", # Build çıktıları
"build" # Build dizini
]
exclude_files = [
".DS_Store", # macOS sistem dosyası
"*.log", # Log dosyaları
"*.tmp", # Geçici dosyalar
".env", # Environment değişkenleri
"*.pyc" # Python compiled dosyalar
]# Web sitesi dosya yapısını dokümante etmek için
website_creator = FileTreeCreator(
base_dir=Path("/var/www/html"),
output_dir=Path("./docs"),
output_file=Path("website_structure.json"),
passDirs=["logs", "cache", "tmp"],
passFiles=["*.log", "*.cache"]
)# Kod projesi analizi için
project_analyzer = FileTreeCreator(
base_dir=Path("./my_project"),
output_dir=Path("./analysis"),
output_file=Path("project_tree.json"),
passDirs=[".git", "node_modules", "__pycache__"],
passFiles=["*.pyc", "*.log", ".env"]
)MIT Lisansı (https://opensource.org/licenses/MIT)
Bu yazılım, herhangi bir garanti olmaksızın "olduğu gibi" sağlanmaktadır. Kullanım riski kullanıcıya aittir. Production ortamlarında kullanımdan önce test edilmesi önerilir.
Connected :
- website/py
- Github/Mefamex/python-code-snippets
| Back | FazBrowse Home | New Git URL |