{"id":34057165,"url":"https://github.com/waketzheng/aiopathlib","last_synced_at":"2026-04-09T03:32:07.400Z","repository":{"id":57409086,"uuid":"376695607","full_name":"waketzheng/aiopathlib","owner":"waketzheng","description":"Pathlib support for asyncio","archived":false,"fork":false,"pushed_at":"2026-03-08T19:11:52.000Z","size":253,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-08T22:51:52.107Z","etag":null,"topics":["asyncio","pathlib","python3"],"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/waketzheng.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-14T03:46:58.000Z","updated_at":"2026-03-08T19:11:51.000Z","dependencies_parsed_at":"2022-09-26T17:11:09.694Z","dependency_job_id":null,"html_url":"https://github.com/waketzheng/aiopathlib","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/waketzheng/aiopathlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waketzheng%2Faiopathlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waketzheng%2Faiopathlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waketzheng%2Faiopathlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waketzheng%2Faiopathlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waketzheng","download_url":"https://codeload.github.com/waketzheng/aiopathlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waketzheng%2Faiopathlib/sbom","scorecard":{"id":1244553,"data":{"date":"2026-03-02","repo":{"name":"github.com/waketzheng/aiopathlib","commit":"2f526f5c34c2dee2f9d34953557f0ab522959e43"},"scorecard":{"version":"v5.4.1-0.20260302234127-4dbf14294ff1","commit":"4dbf14294ff1c660e93a2c6b70159f8f9b7e1051"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/waketzheng/aiopathlib/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/waketzheng/aiopathlib/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/waketzheng/aiopathlib/codecov.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/waketzheng/aiopathlib/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/waketzheng/aiopathlib/codecov.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:42","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:53","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:54","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/4dbf14294ff1c660e93a2c6b70159f8f9b7e1051/docs/checks.md#branch-protection"}}]},"last_synced_at":"2026-03-08T22:52:54.337Z","repository_id":57409086,"created_at":"2026-03-08T22:52:54.337Z","updated_at":"2026-03-08T22:52:54.337Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["asyncio","pathlib","python3"],"created_at":"2025-12-14T03:20:51.734Z","updated_at":"2026-04-09T03:32:07.395Z","avatar_url":"https://github.com/waketzheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"aiopathlib: Pathlib support for asyncio\n=======================================\n\n[![image](https://img.shields.io/pypi/v/aiopathlib.svg)](https://pypi.org/project/aiopathlib/)\n[![image](https://img.shields.io/pypi/pyversions/aiopathlib.svg)](https://pypi.org/project/aiopathlib/)\n[![image](https://img.shields.io/pypi/l/aiopathlib.svg)](https://pypi.org/project/aiopathlib/)\n[![image](https://img.shields.io/codecov/c/github/waketzheng/aiopathlib/master.svg)](https://codecov.io/github/waketzheng/aiopathlib?branch=master)\n![Mypy coverage](https://img.shields.io/badge/mypy-100%25-green.svg)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n\u003e If you are not using aiofiles, `anyio.Path` is another choice:\n\n```py\nfrom datetime import datetime\nfrom anyio import Path  # pip install anyio\n\nfilepath = Path(__file__)\nanother = filepath.parent / 'sub_dirpath' / 'filename.ext'\n\nif await another.exists():\n    content = await another.read_bytes()\nelif not await another.parent.exists():\n    await another.parent.mkdir(parents=True)\nelse:\n    await another.write_bytes(b'1')\n\n# glob/stat/remove\nasync for p in filepath.parent.glob('*'):\n    if await p.is_file():\n        stat = await p.stat()\n        create_time = datetime.fromtimestamp(stat.st_ctime)\n        update_time = datetime.fromtimestamp(stat.st_mtime)\n        await p.unlink()  # remove file\n        print(f'{p} created at: {create_time}, modified at: {update_time}, removed at: {datetime.now()}')\n```\nSee more at: https://github.com/agronholm/anyio\n\n------\n**aiopathlib** is written in Python, for handling local\ndisk files in asyncio applications.\n\nBase on [aiofiles](https://github.com/Tinche/aiofiles) and just like pathlib, but use await.\n\n```py\nwith open('filename', 'w') as fp:\n    fp.write('{\"msg\":\"My file contents\"}')\n\napath = aiopathlib.AsyncPath('filename')\ntext = await apath.read_text()\nprint(repr(text))\n# '{\"msg\":\"My file contents\"}'\n\ncontent = await apath.read_bytes()\nprint(content)\n# b'{\"msg\":\"My file contents\"}'\n\ndata = await apath.read_json()\nprint(data)\n# {\"msg\": \"My file contents\"}\n```\n\nAsynchronous interface to create folder.\n\n```py\nfrom aiopathlib import AsyncPath\n\napath = AsyncPath('dirname/subpath')\nif not await apath.exists():\n    await apath.mkdir(parents=True)\n```\n\n\nFeatures\n--------\n\n- a file API very similar to Python's standard package `pathlib`, blocking API\n- support for buffered and unbuffered binary files, and buffered text files\n- support for ``async``/``await`` (:PEP:`492`) constructs\n\n\nInstallation\n------------\n\nTo install aiopathlib, simply:\n\n\n```bash\n$ pip install aiopathlib\n```\n\n\nUsage\n-----\nThese functions are awaitable\n\n* ``read_text``\n* ``read_bytes``\n* ``read_json``\n* ``write_text``\n* ``write_bytes``\n* ``write_json``\n* ``mkdir``\n* ``touch``\n* ``exists``\n* ``rename``\n* ``unlink``\n* ``rmdir``\n* ``remove``\n* ``stat``\n* ``lstat``\n* ``is_file``\n* ``is_dir``\n* ``is_symlink``\n* ``is_fifo``\n* ``is_mount``\n* ``is_block_device``\n* ``is_char_device``\n* ``is_socket``\n\nExample\n-------\nSome common using cases:\n\n```\nfrom pashlib import Path\nfrom aiopathlib import AsyncPath\n\nfilename = 'test.json'\nap = AsyncPath(filename)\np = Path(filename)\nassert (await ap.exists()) == p.exists() == False\nawait ap.touch()  # Create a empty file\nassert (await ap.is_file()) == p.is_file() == True\nassert (await ap.is_dir()) == p.is_dir() == False\nassert (await ap.is_symlink()) == p.is_symlink() == False\nfor func in ('is_fifo', 'is_mount', 'is_block_device', 'is_char_device', 'is_socket'):\n    assert (await getattr(ap, func)()) == getattr(p, func)()\nd = {'key': 'value'}\nawait ap.write_json(d)  # == p.write_text(json.dumps(d))\nassert (await ap.read_json()) == d  # == json.loads(p.read_text())\nassert (await ap.read_bytes()) == p.read_bytes()  # b'{\"key\": \"value\"}'\nassert (await ap.stat()) == p.stat()\nassert (await ap.lstat()) == p.lstat()\nap = await ap.rename('test_dir')  # == AsyncPath(p.rename('test_dir'))\nawait ap.remove()  # == await ap.unlink() == p.unlink()\nawait ap.mkdir()  # == p.mkdir()\nawait ap.resolve() # == AsyncPath(p.resolve())\n\n# Synchronization functions\n[Path(i) for i in ap.glob('*')] == list(p.glob('*'))\n[Path(i) for i in ap.rglob('*')] == list(p.rglob('*'))\nap / 'filename' == ap.joinpath('filename') == AsyncPath(f'{ap}/filename')\nstr(AsyncPath('string-or-Path-or-AsyncPath')) == str(Path('string-or-Path-or-AsyncPath'))\nap.stem == p.stem\nap.suffix == p.suffix\nPath(ap.with_name('xxx')) == p.with_name('xxx')\nPath(ap.parent) == p.parent\n...\n```\n\n\nHistory\n-------\n\nSee the [CHANGELOG.md](https://github.com/waketzheng/aiopathlib/blob/master/CHANGELOG.md) file for details.\n\n\nContributing\n------------\n\nContributions are very welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaketzheng%2Faiopathlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaketzheng%2Faiopathlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaketzheng%2Faiopathlib/lists"}