Name | pycomfort JSON |
Version |
0.0.15
JSON |
| download |
home_page | |
Summary | Pycomfort - Python helper methods to make life easier |
upload_time | 2023-12-29 16:57:52 |
maintainer | |
docs_url | None |
author | antonkulaga (Anton Kulaga) |
requires_python | |
license | |
keywords |
python
utils
files
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pycomfort
Utility methods for python code
It heavily uses functional approach and pyfunctional library to ease the work with file traversing and other routine tasks.
## files.py
The most important methods are:
* def children(p: Path) -> seq #lists files and subfolders as pyfunctional sequence
* def dirs(p: Path) -> seq #lists subfolders as pyfunctional sequence
* def files(p: Path) -> seq: #lists files as pyfunctional sequence
* def with_ext(p: Path, ext: str) -> seq: # filters files by extension
* def rename_files_with_dictionary(files_or_path: Union[seq, Path], dictionary: dict, test: bool = False): #renames files according to key value pairs mentioned in the dictionary
* def rename_files(files_or_path: Union[seq, Path], has: str, what: str, to: str): rename files that contain a substring
* def rename_not_files(files: seq, not_has: str, what: str, to: str) -> seq: #rename files that do NOT contain a substring
* def replace_in_file(file: Path, what: str, to: str, output: Optional[Path] = None): #replaces string in a file
* def replace_from_dict_in_file(file: Path, replacement: dict, output: Optional[Path] = None, verbose: bool = False) -> Path: # replaces the text in the file based on key-value pairs in the dictionary
* def tprint(p: Path, max_depth: int = -1, prefix: str = "", debug: bool = False, depth: int = 0: #prints the file tree
* def traverse(p: Path, fun: Callable[[Path], bool] = None, max_depth: int = -1, flatten: bool = True, depth: int = 0) -> list # traverses the file system searching for sample
## executables
Executables are in comfort.py. At the moment it is the text replacement functions wrapped to CLI by click library:
* def replace(file: str, what: str, to: str, output: Optional[str]):
* def replace_dict(file: str, dictionary: str, output: Optional[str], verbose: bool = False):
# publishing to pip
You can use publish.sh script
Raw data
{
"_id": null,
"home_page": "",
"name": "pycomfort",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,utils,files",
"author": "antonkulaga (Anton Kulaga)",
"author_email": "<antonkulaga@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/57/12/32b0d5f1586143c9a271f74d46aac496fef9b0865bc1063b54aa8379cb0b/pycomfort-0.0.15.tar.gz",
"platform": null,
"description": "\n# pycomfort\nUtility methods for python code\n\nIt heavily uses functional approach and pyfunctional library to ease the work with file traversing and other routine tasks.\n\n## files.py\n\nThe most important methods are:\n* def children(p: Path) -> seq #lists files and subfolders as pyfunctional sequence\n* def dirs(p: Path) -> seq #lists subfolders as pyfunctional sequence\n* def files(p: Path) -> seq: #lists files as pyfunctional sequence\n* def with_ext(p: Path, ext: str) -> seq: # filters files by extension\n* def rename_files_with_dictionary(files_or_path: Union[seq, Path], dictionary: dict, test: bool = False): #renames files according to key value pairs mentioned in the dictionary\n* def rename_files(files_or_path: Union[seq, Path], has: str, what: str, to: str): rename files that contain a substring\n* def rename_not_files(files: seq, not_has: str, what: str, to: str) -> seq: #rename files that do NOT contain a substring\n* def replace_in_file(file: Path, what: str, to: str, output: Optional[Path] = None): #replaces string in a file\n* def replace_from_dict_in_file(file: Path, replacement: dict, output: Optional[Path] = None, verbose: bool = False) -> Path: # replaces the text in the file based on key-value pairs in the dictionary\n* def tprint(p: Path, max_depth: int = -1, prefix: str = \"\", debug: bool = False, depth: int = 0: #prints the file tree\n* def traverse(p: Path, fun: Callable[[Path], bool] = None, max_depth: int = -1, flatten: bool = True, depth: int = 0) -> list # traverses the file system searching for sample\n\n## executables\n\nExecutables are in comfort.py. At the moment it is the text replacement functions wrapped to CLI by click library:\n* def replace(file: str, what: str, to: str, output: Optional[str]):\n* def replace_dict(file: str, dictionary: str, output: Optional[str], verbose: bool = False):\n\n\n# publishing to pip\n\nYou can use publish.sh script\n",
"bugtrack_url": null,
"license": "",
"summary": "Pycomfort - Python helper methods to make life easier",
"version": "0.0.15",
"project_urls": null,
"split_keywords": [
"python",
"utils",
"files"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12f0f92f7a821e3af10e8692752f4d60cc5a0174ced22fb49f7d9504b6966f30",
"md5": "584fff82832dc35687b2c763c0814e48",
"sha256": "659a9e815099d3b7450b87a806864df2ee74656b20c7b40f028f264eb0909b7a"
},
"downloads": -1,
"filename": "pycomfort-0.0.15-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "584fff82832dc35687b2c763c0814e48",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 10544,
"upload_time": "2023-12-29T16:57:48",
"upload_time_iso_8601": "2023-12-29T16:57:48.954215Z",
"url": "https://files.pythonhosted.org/packages/12/f0/f92f7a821e3af10e8692752f4d60cc5a0174ced22fb49f7d9504b6966f30/pycomfort-0.0.15-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "571232b0d5f1586143c9a271f74d46aac496fef9b0865bc1063b54aa8379cb0b",
"md5": "fad0786d4a5ec4699eba5c371e1ff1f7",
"sha256": "65ed4bd18b25674986a35d10ea66de615675f022e86927326c5343d8d20d14a0"
},
"downloads": -1,
"filename": "pycomfort-0.0.15.tar.gz",
"has_sig": false,
"md5_digest": "fad0786d4a5ec4699eba5c371e1ff1f7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9251,
"upload_time": "2023-12-29T16:57:52",
"upload_time_iso_8601": "2023-12-29T16:57:52.129290Z",
"url": "https://files.pythonhosted.org/packages/57/12/32b0d5f1586143c9a271f74d46aac496fef9b0865bc1063b54aa8379cb0b/pycomfort-0.0.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-29 16:57:52",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pycomfort"
}