{"id":35039477,"url":"https://github.com/xapple/autopaths","last_synced_at":"2025-12-27T08:11:18.795Z","repository":{"id":57412908,"uuid":"167192149","full_name":"xapple/autopaths","owner":"xapple","description":"autopaths is a python package for dealing with file paths and automation.","archived":false,"fork":false,"pushed_at":"2022-10-18T05:06:15.000Z","size":449,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T08:16:38.922Z","etag":null,"topics":["filepath","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xapple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-23T13:57:57.000Z","updated_at":"2023-04-06T01:44:34.000Z","dependencies_parsed_at":"2022-08-29T15:30:53.939Z","dependency_job_id":null,"html_url":"https://github.com/xapple/autopaths","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/xapple/autopaths","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xapple%2Fautopaths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xapple%2Fautopaths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xapple%2Fautopaths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xapple%2Fautopaths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xapple","download_url":"https://codeload.github.com/xapple/autopaths/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xapple%2Fautopaths/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28075900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filepath","python"],"created_at":"2025-12-27T08:11:16.669Z","updated_at":"2025-12-27T08:11:18.789Z","avatar_url":"https://github.com/xapple.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI version](https://badge.fury.io/py/autopaths.svg)](https://badge.fury.io/py/autopaths)\n\n# `autopaths` version 1.6.0\n\n`autopaths` is a python package for dealing with file paths and automation.\n\nIt has many convenience methods that apply to directory paths and/or file paths and contains several submodules that are useful when building pipelines. See below for examples and documentation.\n\n## Prerequisites\n\nSince `autopaths` is written in python, it is compatible with all operating systems: Linux, macOS and Windows. The only prerequisite is `python3` (which is often installed by default) along with the `pip3` package manager.\n\nTo check if you have `python3` installed, type the following on your terminal:\n\n    $ python3 -V\n\nIf you do not have `python3` installed, please refer to the section [obtaining python3](docs/installing_tips.md#obtaining-python3).\n\nTo check you have `pip3` installed, type the following on your terminal:\n\n    $ pip3 -V\n\nIf you do not have `pip3` installed, please refer to the section [obtaining pip3](docs/installing_tips.md#obtaining-pip3).\n\n## Installing\n\nTo install the `autopaths` package, simply type the following commands on your terminal:\n\n    $ pip3 install --user autopaths\n\nAlternatively, if you want to install it for all users of the system:\n\n    $ sudo pip3 install autopaths\n\n## Usage\n\nBellow are some examples to illustrate the various ways there are to use this package.\n\n\n### `FilePath` object\n\nHere are a few example usages of this object:\n\n    from autopaths.file_path import FilePath\n    f = FilePath(\"input/raw/reads_56.fastq\")\n    print(f.exists)\n    print(f.extension)\n    print(f.size)\n    print(f.contains_binary)\n    f.prepend('# This file was backed-up\\n')\n    f.gzip_to('backup/old_reads/reads_56.fastq.gz')\n    f.move_to(f.parent)\n\nAs you can see, once you have created a FilePath, many useful methods are available. No more need for long `os.path` or `shutil` commands of which you can never remember the syntax.\n\nTo see the complete list of utility methods and properties, look at the source code. You can find lots of the common things you would need to do with file paths such as `f.make_executable()` etc. right at your fingertips.\n\n### `DirectoryPath` object\n\nSimilar to a file path object. Here is an example usage of this object:\n\n    from autopaths.dir_path import DirectoryPath\n    d = DirectoryPath(\"cleaned/reads/\")\n    print(d.mod_time)\n    d.create_if_not_exists()\n    f = d + 'new.fastq'\n\n### `AutoPaths` object\n\nYou can use this class like this when making pipelines to quickly refer to a predefined file path with a simple attribute lookup. This example explains it:\n\n    class Sample(object):\n        all_paths = \"\"\"\n                    /raw/raw.sff\n                    /raw/raw.fastq\n                    /clean/trim.fastq\n                    /clean/clean.fastq\n                    \"\"\"\n\n        def __init__(self, base_dir):\n            from autopaths.auto_paths import AutoPaths\n            self.p = AutoPaths(base_dir, self.all_paths)\n\n        def clean(self):\n            shutil.move(self.p.raw_sff, self.p.clean_fastq)\n\n## Extra documentation\n\nMore documentation is available at:\n\n\u003chttp://xapple.github.io/autopaths/autopaths\u003e\n\nThis documentation is simply generated with:\n\n    $ pdoc --html --output-dir docs --force autopaths","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxapple%2Fautopaths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxapple%2Fautopaths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxapple%2Fautopaths/lists"}