fs-tool-cli 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. fs_tool/__init__.py +9 -0
  2. fs_tool/__main__.py +8 -0
  3. fs_tool/cli.py +305 -0
  4. fs_tool/core/__init__.py +1 -0
  5. fs_tool/core/config.py +117 -0
  6. fs_tool/core/errors.py +88 -0
  7. fs_tool/core/filesystem.py +50 -0
  8. fs_tool/core/hashing.py +49 -0
  9. fs_tool/core/models.py +44 -0
  10. fs_tool/core/py.typed +0 -0
  11. fs_tool/core/traversal.py +225 -0
  12. fs_tool/output/__init__.py +1 -0
  13. fs_tool/output/json.py +142 -0
  14. fs_tool/output/plain.py +58 -0
  15. fs_tool/output/py.typed +0 -0
  16. fs_tool/py.typed +0 -0
  17. fs_tool/safety/__init__.py +1 -0
  18. fs_tool/safety/py.typed +0 -0
  19. fs_tool/safety/validation.py +81 -0
  20. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/.nav.yml +15 -0
  21. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/_static/img/favicon.png +0 -0
  22. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/_static/img/logo.png +0 -0
  23. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/css/custom.css +5 -0
  24. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/develop/contributing.md +142 -0
  25. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/develop/naming_convention.md +46 -0
  26. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/funding/funding.md +55 -0
  27. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/getting-started/install.md +45 -0
  28. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/getting-started/virtual-environment.md +29 -0
  29. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/index.md +77 -0
  30. fs_tool_cli-0.1.2.data/data/share/fs-tool/docs/usage/cli.md +13 -0
  31. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Auslandssemester.docx +0 -0
  32. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Barcelona Sehenswertes.docx +0 -0
  33. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Beruf/Bewerbungen.txt +0 -0
  34. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Der Goldschatz partygame.pdf +0 -0
  35. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Ablauf Freitag Grundschule.docx +0 -0
  36. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Dresdner Christstollen.pdf +0 -0
  37. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Kirschkuchen.pdf +0 -0
  38. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Pelmeni.odt +0 -0
  39. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Projekte/Sauna_Grundriss.odg +0 -0
  40. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Seemeilenbestaetigung.pdf +0 -0
  41. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Freizeit/Tidal Prediction Form.pdf +0 -0
  42. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Reise/Segeln/Dalmatien 2018/2017-08-26_19-18_Sat.gpx +559 -0
  43. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Reise/Segeln/Segeln Ibiza 2024.gpx +41 -0
  44. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Reise/Slowenien/Klettersteige Slowenien.gpx +6602 -0
  45. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Reise-Checkliste.odt +0 -0
  46. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Sauna_Aufriss.odg +0 -0
  47. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Schule/Antrag Sch/303/274lerausweis.docx +0 -0
  48. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Studium/Oberseminare 2009 Helduser.pdf +0 -0
  49. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Tokensystem Z/303/244hneputzen.odt +0 -0
  50. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Urlaub/Der Weg zum SHS.ods +0 -0
  51. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Urlaub/Italien/Klettersteige Italien 2024.kmz +0 -0
  52. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Urlaub/Radtouren/Gittersee-steinbach.gpx +1250 -0
  53. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Urlaub/Radtouren/SingletrailDresdenerHeide.gpx +3087 -0
  54. fs_tool_cli-0.1.2.data/data/share/fs-tool/res/example_filesystem_unstructured/Urlaub/Radtouren/StauseeInDerDresdnerHeide.gpx +1466 -0
  55. fs_tool_cli-0.1.2.dist-info/METADATA +91 -0
  56. fs_tool_cli-0.1.2.dist-info/RECORD +60 -0
  57. fs_tool_cli-0.1.2.dist-info/WHEEL +5 -0
  58. fs_tool_cli-0.1.2.dist-info/entry_points.txt +2 -0
  59. fs_tool_cli-0.1.2.dist-info/licenses/LICENSE +24 -0
  60. fs_tool_cli-0.1.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,46 @@
1
+ # Naming Conventions in Python Projects
2
+
3
+ In Python projects, it's crucial to use consistent naming conventions to ensure code readability and maintainability. The choice between underscores (`_`) and hyphens (`-`) largely depends on the context.
4
+
5
+ ---
6
+
7
+ ## Underscores (`_`) – Snake_case
8
+
9
+ Primarily use underscores **within your Python code** for multi-word names. This is known as `snake_case`.
10
+
11
+ * **Python Package Names (Internal):** The importable name of your Python package (e.g., the folder under `src/`) should use underscores.
12
+ * **Example:** `src/my_python_package` is imported as `import my_python_package`.
13
+ * **Module Names (.py files):** Python file names that are modules should also use underscores.
14
+ * **Example:** `my_module.py`, `data_processing.py`.
15
+ * **Variables, Functions, and Methods:** Within your code, these names should follow `snake_case`.
16
+ * **Example:** `my_variable`, `calculate_total()`, `_private_function()`.
17
+
18
+ ---
19
+
20
+ ## Hyphens (`-`) – Kebab-case
21
+
22
+ Primarily use hyphens **outside of your Python code** for filesystem, URL, and human-readable names. This is often referred to as `kebab-case`.
23
+
24
+ * **PyPI Package Name (Project Name):** The name under which your project is published on PyPI and installed with `pip install` should use hyphens.
25
+ * **Example:** In `pyproject.toml`: `name = "my-python-project"`. Installation: `pip install my-python-project`.
26
+ * **Main Project Folder / Repository Name:** The root folder of your project in the file system.
27
+ * **Example:** `my-python-project/`.
28
+ * **Documentation Folders and Files (MkDocs, ReadTheDocs):** Folders and Markdown files within your documentation.
29
+ * **Example:** `docs/getting-started/installation-guide.md`.
30
+ * **Command-Line Tools / Scripts:** Names for executable scripts you define in your `pyproject.toml` under `[project.scripts]`.
31
+ * **Example:** `my-cli-tool = "my_python_package.cli:main"`.
32
+
33
+ ---
34
+
35
+ ## Summary of Recommendations
36
+
37
+ | Context | Recommended Convention | Example |
38
+ | :---------------------------- | :--------------------- |:---------------------------------|
39
+ | **Internal Python Name** | Underscores (`_`) | `my_python_package` |
40
+ | **PyPI / Project Name** | Hyphens (`-`) | `my-python-package` |
41
+ | **Module Filename** | Underscores (`_`) | `my_module.py` |
42
+ | **Repository/Root Folder** | Hyphens (`-`) | `my-python-project/` |
43
+ | **Docs Folders/Files** | Hyphens (`-`) | `getting-started/cli-usage.md` |
44
+ | **CLI Commands** | Hyphens (`-`) | `my-cli-tool` |
45
+
46
+ Consistently applying these rules significantly improves the clarity and professionalism of your Python project.
@@ -0,0 +1,55 @@
1
+ # 🧡 FUNDING
2
+
3
+ Hey there! If you find this project helpful and would like to support its continued development, here are a few ways you can contribute:
4
+
5
+ -----
6
+
7
+ ## Why Support?
8
+
9
+ Your support helps me dedicate more time and resources to maintaining and improving this project. It allows for:
10
+
11
+ * **Bug fixes and ongoing maintenance:** Ensuring the project remains stable and up-to-date.
12
+ * **New features and enhancements:** Adding exciting new functionalities to make the project even better.
13
+ * **Documentation and support:** Providing clear guides and assistance to users.
14
+
15
+ -----
16
+
17
+ ## How You Can Contribute
18
+
19
+ Here are the ways you can show your support:
20
+
21
+ ### 1\. GitHub Sponsors
22
+
23
+ The easiest and most direct way to support this project is through **GitHub Sponsors**. You can set up a recurring donation or make a one-time contribution.
24
+
25
+ [**Become a Sponsor on GitHub**](https://github.com/sponsors/pamagister)
26
+
27
+
28
+ ### 2\. Paypal
29
+
30
+ If you prefer a simpler, one-time contribution, you can PayPal me! It's a great way to show appreciation.
31
+
32
+ [**Support via PayPal**](https://www.paypal.me/PaulDD)
33
+
34
+
35
+ ### 3\. Cryptocurrency
36
+
37
+ If you're into crypto, you can send a donation to the following addresses:
38
+
39
+ * **Bitcoin (BTC):** bc1q070wj0t29gpnf59rq77uz39ruq5ahg9vhakzpq
40
+
41
+ * **Lightning (ETH):** *coming soon*
42
+
43
+ ### 4\. Spread the Word\!
44
+
45
+ Even if you can't contribute financially, you can still help immensely by:
46
+
47
+ * **Starring the repository:** This helps increase visibility.
48
+ * **Sharing the project:** Let others know about it on social media or in your network.
49
+ * **Contributing code:** Open issues, submit pull requests, or help with documentation.
50
+
51
+ -----
52
+
53
+ ## Thank You\!
54
+
55
+ Every bit of support, no matter how small, is greatly appreciated and helps keep this project going. Thank you for being a part of this journey\!
@@ -0,0 +1,45 @@
1
+ # Installation
2
+
3
+
4
+ ## 🐍 PyPI
5
+
6
+ Install the CLI from [PyPI](https://pypi.org/):
7
+
8
+ ```bash
9
+ pip install fs-tool
10
+ ```
11
+
12
+ The package includes the `docs/` documentation and `res/` sample files under
13
+ `share/fs-tool/` in the active Python environment's data directory.
14
+
15
+ ### Run the CLI
16
+
17
+ ```bash
18
+ fs-tool [OPTIONS] path/to/file
19
+ ```
20
+
21
+ ## 👩🏼‍💻 Run from source
22
+
23
+ ### Clone the repository
24
+
25
+ ```bash
26
+ git clone
27
+ ```
28
+
29
+ ### Navigate to the project directory
30
+
31
+ ```bash
32
+ cd fs-tool
33
+ ```
34
+
35
+ ### Install dependencies
36
+
37
+ ```bash
38
+ uv sync --all-groups
39
+ ```
40
+
41
+ ### Run the CLI from source
42
+
43
+ ```bash
44
+ uv run fs-tool [OPTIONS] path/to/file
45
+ ```
@@ -0,0 +1,29 @@
1
+ # Setup virtual environment
2
+
3
+ ## Create `venv`
4
+
5
+ Creating virtual environment `venv` using [uv](https://docs.astral.sh/uv/):
6
+ ```bash
7
+ uv venv
8
+ ```
9
+
10
+ ## Activate `venv`
11
+
12
+ Activating a Python virtual environment `venv`
13
+ > Note: Replace `.venv` with your Venv folder name if you have chosen a different one.
14
+
15
+ 🔹 Windows (PowerShell)
16
+
17
+ ```bash
18
+ .venv\Scripts\activate.ps1
19
+ ```
20
+
21
+ 🔹 Windows (CMD)
22
+ ```cmd
23
+ .venv\Scripts\activate.bat
24
+ ```
25
+
26
+ 🔹 Linux / macOS (Bash/Zsh)
27
+ ```bash
28
+ source .venv/bin/activate
29
+ ```
@@ -0,0 +1,77 @@
1
+ # Welcome to fs-tool
2
+
3
+ fs-tool is a lightweight, secure and agent-friendly command-line application for analyzing,
4
+ organizing and restructuring local filesystems.
5
+ Its primary purpose is to provide an interface for inspecting directory structures,
6
+ understanding file contents and metadata, identifying duplicates, comparing directory trees,
7
+ and performing file operations.
8
+
9
+ [![Github CI Status](https://github.com/pamagister/fs-tool/actions/workflows/main.yml/badge.svg)](https://github.com/pamagister/fs-tool/actions)
10
+ [![GitHub release](https://img.shields.io/github/v/release/pamagister/fs-tool)](https://github.com/pamagister/fs-tool/releases)
11
+ [![Read the Docs](https://readthedocs.org/projects/fs-tool/badge/?version=stable)](https://fs-tool.readthedocs.io/en/stable/)
12
+ [![License](https://img.shields.io/github/license/pamagister/fs-tool)](https://github.com/pamagister/fs-tool/blob/main/LICENSE)
13
+ [![GitHub issues](https://img.shields.io/github/issues/pamagister/fs-tool)](https://github.com/pamagister/fs-tool/issues)
14
+ [![PyPI](https://img.shields.io/pypi/v/fs-tool)](https://pypi.org/project/fs-tool-cli/)
15
+ [![Downloads](https://pepy.tech/badge/fs-tool)](https://pepy.tech/project/fs-tool-cli/)
16
+
17
+
18
+ ## Project Vision
19
+
20
+ `fs-tool` is a lightweight, secure and agent-friendly command-line application for analyzing, organizing and restructuring local filesystems.
21
+
22
+ Its primary purpose is to provide a reliable interface for inspecting directory structures, understanding file contents and metadata, identifying duplicates, comparing directory trees, and performing controlled file operations.
23
+
24
+ The tool should be useful both for interactive human users and for automated workflows.
25
+
26
+ ## Guiding Principle
27
+
28
+ **The agent makes decisions; fs-tool provides the information and executes filesystem operations safely and deterministically.**
29
+
30
+ The application must remain independent of any particular AI agent, MCP implementation or external automation framework.
31
+
32
+ ## Design Philosophy
33
+
34
+ - Prefer simplicity over unnecessary abstraction.
35
+ - Keep the Python filesystem core independent of the CLI.
36
+ - Use structured JSON output as the primary interface.
37
+ - Provide readable human-oriented output as an alternative.
38
+ - Make filesystem operations predictable, transparent and verifiable.
39
+ - Never silently overwrite or delete user data.
40
+ - Require explicit authorization for potentially risky operations.
41
+ - Favor deterministic results and reproducible inventories.
42
+ - Keep dependencies minimal.
43
+
44
+ ## Future Agentic Workflow
45
+
46
+ The long-term vision is to enable AI agents, especially OpenCode, to organize complex directory structures autonomously under controlled conditions.
47
+
48
+ A typical workflow:
49
+
50
+ 1. Inspect and inventory the existing filesystem.
51
+ 2. Analyze filenames, metadata, file types and contents where appropriate.
52
+ 3. Identify duplicates, inconsistencies and organizational opportunities.
53
+ 4. Propose a target directory structure.
54
+ 5. Generate a concrete restructuring plan.
55
+ 6. Validate the plan and identify potential conflicts.
56
+ 7. Execute approved operations using fs-tool.
57
+ 8. Verify the resulting filesystem against the original inventory and intended changes.
58
+
59
+ The agent is responsible for reasoning, planning and deciding what should happen. The CLI is responsible for executing individual operations safely and reporting their results.
60
+
61
+ ## Development Rules
62
+
63
+ - Python >=3.11, managed with `uv`.
64
+ - Use Typer for the CLI.
65
+ - Use type hints and clear module boundaries.
66
+ - Prefer Python standard-library functionality where practical.
67
+ - Follow PEP 8 and use four spaces for indentation.
68
+ - Keep line length at approximately 100 characters.
69
+ - Write tests for filesystem operations and safety-critical behavior.
70
+ - Document CLI commands and their JSON output schemas.
71
+ - Do not introduce MCP-specific dependencies into the core application.
72
+
73
+ ## Scope
74
+
75
+ The initial implementation focuses exclusively on the filesystem CLI.
76
+
77
+ Agent orchestration, autonomous planning, MCP adapters and advanced LLM integrations are future extensions and must not unnecessarily influence the initial architecture.
@@ -0,0 +1,13 @@
1
+ # Command Line Interface
2
+
3
+ Command line options for fs_tool
4
+
5
+ ```bash
6
+ fs-tool [OPTIONS] <input>
7
+ ```
8
+
9
+ For development from a source checkout, the equivalent module invocation is:
10
+
11
+ ```bash
12
+ python -m fs_tool [OPTIONS] <input>
13
+ ```