file-system-py


Namefile-system-py JSON
Version 0.0.11 PyPI version JSON
download
home_pagehttps://github.com/jeff-hykin/file-system-py
SummaryAll-in-one file manipulation
upload_time2023-05-16 16:47:23
maintainer
docs_urlNone
authorJeff Hykin
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # What is this?

An work-in-progress library for file manipulation in python. <br>
(E.g. I was tired of copy-pasting my giant tool into each project)

# How do I use this?

`pip install file-system-py`


```python
import file_system_py as FS


*folders, name, extension = FS.path_pieces("/this/is/a/filepath.txt")
# folder[0] == '/' for absolute paths

FS.remove("./a folder")
FS.remove("./a file")
# 1. no error if they dont exist
# 2. doesnt care if file or folder

FS.extname("./thing/thing.stuff.blah.py")
# returns ".py"

# different ways to list
FS.list_paths_in("./thing/things")
FS.list_basenames_in("./thing/things")
FS.list_file_paths_in("./thing/things")
FS.list_folder_paths_in("./thing/things")
# returns [] when path doesnt exist or is a file

# much faster iterative versions
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)


# 
# full api
# 
FS.walk_up_until(file_to_find, start_path=get_cwd())
FS.ensure_is_folder(path, force=True)
FS.ensure_is_file(path, force=True)
FS.make_relative_path(to=, coming_from=get_cwd())
FS.make_absolute_path(to, coming_from=get_cwd())
FS.move(item, to=, new_name=, force=True)
FS.copy(item, to=, new_name=, force=True)
FS.write(data, to=, force=True)
FS.is_folder(path)
FS.is_file(path)
FS.read(filepath)
FS.remove(path)
FS.exists(path)
FS.ls(path=".")
FS.list_paths_in(path)
FS.list_basenames_in(path)
FS.list_file_paths_in(path)
FS.list_folder_paths_in(path)
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)
FS.glob(path)
FS.touch(path)
FS.touch_dir(path)
FS.parent_folder(path)
FS.basename(path)
FS.name(path)
FS.extname(path)
FS.path_pieces(path)
FS.join(*paths)
FS.is_absolute_path(path)
FS.is_relative_path(path)
FS.get_cwd()
FS.local_path(*paths)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jeff-hykin/file-system-py",
    "name": "file-system-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Jeff Hykin",
    "author_email": "jeff.hykin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/d4/ae85ebdb99595deac4feed647c0b7cb6aae7573c3ca3bb4d707d646133ba/file_system_py-0.0.11.tar.gz",
    "platform": null,
    "description": "# What is this?\n\nAn work-in-progress library for file manipulation in python. <br>\n(E.g. I was tired of copy-pasting my giant tool into each project)\n\n# How do I use this?\n\n`pip install file-system-py`\n\n\n```python\nimport file_system_py as FS\n\n\n*folders, name, extension = FS.path_pieces(\"/this/is/a/filepath.txt\")\n# folder[0] == '/' for absolute paths\n\nFS.remove(\"./a folder\")\nFS.remove(\"./a file\")\n# 1. no error if they dont exist\n# 2. doesnt care if file or folder\n\nFS.extname(\"./thing/thing.stuff.blah.py\")\n# returns \".py\"\n\n# different ways to list\nFS.list_paths_in(\"./thing/things\")\nFS.list_basenames_in(\"./thing/things\")\nFS.list_file_paths_in(\"./thing/things\")\nFS.list_folder_paths_in(\"./thing/things\")\n# returns [] when path doesnt exist or is a file\n\n# much faster iterative versions\nFS.iterate_paths_in(path)\nFS.iterate_basenames_in(path)\nFS.iterate_file_paths_in(path)\nFS.iterate_folder_paths_in(path)\n\n\n# \n# full api\n# \nFS.walk_up_until(file_to_find, start_path=get_cwd())\nFS.ensure_is_folder(path, force=True)\nFS.ensure_is_file(path, force=True)\nFS.make_relative_path(to=, coming_from=get_cwd())\nFS.make_absolute_path(to, coming_from=get_cwd())\nFS.move(item, to=, new_name=, force=True)\nFS.copy(item, to=, new_name=, force=True)\nFS.write(data, to=, force=True)\nFS.is_folder(path)\nFS.is_file(path)\nFS.read(filepath)\nFS.remove(path)\nFS.exists(path)\nFS.ls(path=\".\")\nFS.list_paths_in(path)\nFS.list_basenames_in(path)\nFS.list_file_paths_in(path)\nFS.list_folder_paths_in(path)\nFS.iterate_paths_in(path)\nFS.iterate_basenames_in(path)\nFS.iterate_file_paths_in(path)\nFS.iterate_folder_paths_in(path)\nFS.glob(path)\nFS.touch(path)\nFS.touch_dir(path)\nFS.parent_folder(path)\nFS.basename(path)\nFS.name(path)\nFS.extname(path)\nFS.path_pieces(path)\nFS.join(*paths)\nFS.is_absolute_path(path)\nFS.is_relative_path(path)\nFS.get_cwd()\nFS.local_path(*paths)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "All-in-one file manipulation",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/jeff-hykin/file-system-py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "143ac0e33a68b5efd6d23b1c77b7d6b2539f0e4316813b8b21e2cd67859196f9",
                "md5": "8b8e37e9ad894be9473dfeda8a8ffa3c",
                "sha256": "dc29c6e9993174eddc781936fa1c937e6599de080c314c4de22460cb5c4a4276"
            },
            "downloads": -1,
            "filename": "file_system_py-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b8e37e9ad894be9473dfeda8a8ffa3c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5142,
            "upload_time": "2023-05-16T16:47:21",
            "upload_time_iso_8601": "2023-05-16T16:47:21.810713Z",
            "url": "https://files.pythonhosted.org/packages/14/3a/c0e33a68b5efd6d23b1c77b7d6b2539f0e4316813b8b21e2cd67859196f9/file_system_py-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ded4ae85ebdb99595deac4feed647c0b7cb6aae7573c3ca3bb4d707d646133ba",
                "md5": "7b3f10400e53aa2d807dc93539a93983",
                "sha256": "8c47c1ce53c2aaf158b8b26879568b166cc10640b08769b111787241c9845212"
            },
            "downloads": -1,
            "filename": "file_system_py-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "7b3f10400e53aa2d807dc93539a93983",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5028,
            "upload_time": "2023-05-16T16:47:23",
            "upload_time_iso_8601": "2023-05-16T16:47:23.533138Z",
            "url": "https://files.pythonhosted.org/packages/de/d4/ae85ebdb99595deac4feed647c0b7cb6aae7573c3ca3bb4d707d646133ba/file_system_py-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-16 16:47:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jeff-hykin",
    "github_project": "file-system-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "file-system-py"
}
        
Elapsed time: 0.21179s