# AviTwilTools
**Unified Python Package for Folder and File Management**
AT_tools is a Python package designed to simplify filesystem management. It provides a unified interface to work with folders and multiple file types, offering robust features for creating, reading, writing, moving, copying, and deleting files and folders.
**Author:** Avi Twil
**GitHub:** [https://github.com/avitwil/AT\_tools](https://github.com/avitwil/AT_tools)
---
## Features
### Folder Management (`AviTwilTools.folder`)
* Create and manage nested folders with automatic hierarchy tracking.
* Add, remove, move, or copy folders safely.
* Recursively delete folders and all contents.
* Print folder tree structures for visualization.
* Automatically register all subfolders in the internal mapping.
### File Management (`AviTwilTools.file`)
* Unified interface for multiple file formats:
* `TxtFile` – Plain text (.txt)
* `JsonFile` – JSON (.json)
* `CsvFile` – CSV (.csv)
* `DillFile` – Python serialized objects (.dill)
* `XmlFile` – XML files (.xml)
* `YamlFile` – YAML files (.yml, .yaml)
* `ByteFile` – Binary files (.bin, .exe, .img, .jpg)
* `VarDBFile` – Custom VariableDB files (.db)
* Factory function `file()` automatically returns the correct file type instance based on the file extension.
* Supports `read()`, `write()`, `append()`, `copy()`, `move()`, and `delete()`.
---
## Installation
Install directly from PyPI:
```bash
pip install AviTwilTools
```
---
## Quick Start
### Folder Example
```python
from AviTwilTools import Folder
# Create or access a folder
root = Folder("data")
# Create nested folders automatically
sub = Folder("data/names/avi")
# Add folder manually
root.add(sub)
# Print folder structure
root.print_tree()
# List contents
print(root.list_dir())
```
### File Example
```python
from AviTwilTools import file
# Text file
txt = file("data/names/avi/info.txt")
txt.write("Hello Avi!")
print(txt.read()) # -> Hello Avi!
# JSON file
json_file = file("data/config.json")
json_file.write({"key": "value"})
data = json_file.read()
print(data) # -> {"key": "value"}
# Database append
db_file = file("data/config.db", scope={"x": 1}, data={"a": 10})
db_file.append({"b": 20})
print(db_file.read()) # -> {"a": 10, "b": 20}
```
### Folder + File Example
```python
from AviTwilTools import Folder, file
# Create folder
root = Folder("projects")
root._map_folder() # Automatically map all subfolders
# Create a file inside the folder
f = file("projects/demo/readme.txt")
f.write("This is a demo file.")
print(f.read()) # -> This is a demo file.
```
---
## Documentation
* Folder Management: `Folder` class
* File Management: `file()` factory and all file subclasses (`TxtFile`, `JsonFile`, etc.)
For full API reference, see the source code in [`AT_tools`](https://github.com/avitwil/AT_tools).
---
## Notes
* All file classes ensure the file and parent directories exist.
* Folder operations are hierarchical and automatically track child folders.
* Designed for Python 3.10+.
---
## License
MIT License
Raw data
{
"_id": null,
"home_page": null,
"name": "AviTwilTools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "file, txt, json, csv, yaml, xml, dill, binary, database, VarDB, filesystem, folder, file, file management, folders, files",
"author": null,
"author_email": "Avi Twil <avitwil@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c1/82/53e0d2c95a7f018299bcaac7f7bd00f003faaace149b87efeac626fb5b3e/avitwiltools-1.0.3.tar.gz",
"platform": null,
"description": "\r\n# AviTwilTools\r\n\r\n**Unified Python Package for Folder and File Management**\r\n\r\nAT_tools is a Python package designed to simplify filesystem management. It provides a unified interface to work with folders and multiple file types, offering robust features for creating, reading, writing, moving, copying, and deleting files and folders.\r\n\r\n**Author:** Avi Twil\r\n**GitHub:** [https://github.com/avitwil/AT\\_tools](https://github.com/avitwil/AT_tools)\r\n\r\n---\r\n\r\n## Features\r\n\r\n### Folder Management (`AviTwilTools.folder`)\r\n\r\n* Create and manage nested folders with automatic hierarchy tracking.\r\n* Add, remove, move, or copy folders safely.\r\n* Recursively delete folders and all contents.\r\n* Print folder tree structures for visualization.\r\n* Automatically register all subfolders in the internal mapping.\r\n\r\n### File Management (`AviTwilTools.file`)\r\n\r\n* Unified interface for multiple file formats:\r\n\r\n * `TxtFile` \u2013 Plain text (.txt)\r\n * `JsonFile` \u2013 JSON (.json)\r\n * `CsvFile` \u2013 CSV (.csv)\r\n * `DillFile` \u2013 Python serialized objects (.dill)\r\n * `XmlFile` \u2013 XML files (.xml)\r\n * `YamlFile` \u2013 YAML files (.yml, .yaml)\r\n * `ByteFile` \u2013 Binary files (.bin, .exe, .img, .jpg)\r\n * `VarDBFile` \u2013 Custom VariableDB files (.db)\r\n* Factory function `file()` automatically returns the correct file type instance based on the file extension.\r\n* Supports `read()`, `write()`, `append()`, `copy()`, `move()`, and `delete()`.\r\n\r\n---\r\n\r\n## Installation\r\n\r\nInstall directly from PyPI:\r\n\r\n```bash\r\npip install AviTwilTools\r\n```\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Folder Example\r\n\r\n```python\r\nfrom AviTwilTools import Folder\r\n\r\n# Create or access a folder\r\nroot = Folder(\"data\")\r\n\r\n# Create nested folders automatically\r\nsub = Folder(\"data/names/avi\")\r\n\r\n# Add folder manually\r\nroot.add(sub)\r\n\r\n# Print folder structure\r\nroot.print_tree()\r\n\r\n# List contents\r\nprint(root.list_dir())\r\n```\r\n\r\n### File Example\r\n\r\n```python\r\nfrom AviTwilTools import file\r\n\r\n# Text file\r\ntxt = file(\"data/names/avi/info.txt\")\r\ntxt.write(\"Hello Avi!\")\r\nprint(txt.read()) # -> Hello Avi!\r\n\r\n# JSON file\r\njson_file = file(\"data/config.json\")\r\njson_file.write({\"key\": \"value\"})\r\ndata = json_file.read()\r\nprint(data) # -> {\"key\": \"value\"}\r\n\r\n# Database append\r\ndb_file = file(\"data/config.db\", scope={\"x\": 1}, data={\"a\": 10})\r\ndb_file.append({\"b\": 20})\r\nprint(db_file.read()) # -> {\"a\": 10, \"b\": 20}\r\n```\r\n\r\n### Folder + File Example\r\n\r\n```python\r\nfrom AviTwilTools import Folder, file\r\n\r\n# Create folder\r\nroot = Folder(\"projects\")\r\nroot._map_folder() # Automatically map all subfolders\r\n\r\n# Create a file inside the folder\r\nf = file(\"projects/demo/readme.txt\")\r\nf.write(\"This is a demo file.\")\r\nprint(f.read()) # -> This is a demo file.\r\n```\r\n\r\n---\r\n\r\n## Documentation\r\n\r\n* Folder Management: `Folder` class\r\n* File Management: `file()` factory and all file subclasses (`TxtFile`, `JsonFile`, etc.)\r\n\r\nFor full API reference, see the source code in [`AT_tools`](https://github.com/avitwil/AT_tools).\r\n\r\n---\r\n\r\n## Notes\r\n\r\n* All file classes ensure the file and parent directories exist.\r\n* Folder operations are hierarchical and automatically track child folders.\r\n* Designed for Python 3.10+.\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT License\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Unified Python package for folder and file management",
"version": "1.0.3",
"project_urls": {
"Bug Tracker": "https://github.com/avitwil/AT_tools/issues",
"Homepage": "https://github.com/avitwil/AT_tools",
"Source": "https://github.com/avitwil/AT_tools"
},
"split_keywords": [
"file",
" txt",
" json",
" csv",
" yaml",
" xml",
" dill",
" binary",
" database",
" vardb",
" filesystem",
" folder",
" file",
" file management",
" folders",
" files"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "222ccd6ebcdfdfb89900b405f8b6df7d0dc1042e8fca5bb556431f72cbee682b",
"md5": "7db4d453d1670d15a73c402f78751266",
"sha256": "57ae9389aa828fd3e4d3c158bd32c0e5bd05eae14d38a07dc4928cab3fbeda5a"
},
"downloads": -1,
"filename": "avitwiltools-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7db4d453d1670d15a73c402f78751266",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 14172,
"upload_time": "2025-08-31T15:42:14",
"upload_time_iso_8601": "2025-08-31T15:42:14.137880Z",
"url": "https://files.pythonhosted.org/packages/22/2c/cd6ebcdfdfb89900b405f8b6df7d0dc1042e8fca5bb556431f72cbee682b/avitwiltools-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c18253e0d2c95a7f018299bcaac7f7bd00f003faaace149b87efeac626fb5b3e",
"md5": "796a7b0b41326fe0c83ab6433d0a2716",
"sha256": "8b167ec4015f57a7a2269bc55f93e92aa3291ec19bacf11b35d5a4c7fd646956"
},
"downloads": -1,
"filename": "avitwiltools-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "796a7b0b41326fe0c83ab6433d0a2716",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11762,
"upload_time": "2025-08-31T15:42:15",
"upload_time_iso_8601": "2025-08-31T15:42:15.317175Z",
"url": "https://files.pythonhosted.org/packages/c1/82/53e0d2c95a7f018299bcaac7f7bd00f003faaace149b87efeac626fb5b3e/avitwiltools-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 15:42:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "avitwil",
"github_project": "AT_tools",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "avitwiltools"
}