{"id":42977017,"url":"https://github.com/wdhongtw/minidir","last_synced_at":"2026-01-31T01:37:57.325Z","repository":{"id":115851692,"uuid":"551591849","full_name":"wdhongtw/minidir","owner":"wdhongtw","description":"Minimal abstraction about directories and files","archived":false,"fork":false,"pushed_at":"2024-06-07T03:14:01.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T14:17:17.886Z","etag":null,"topics":["filesystem","python","testing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/minidir/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wdhongtw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-10-14T17:43:44.000Z","updated_at":"2024-06-07T03:14:04.000Z","dependencies_parsed_at":"2024-05-29T21:33:31.087Z","dependency_job_id":"26ed4c96-5b6a-4c5a-a349-fcdbfedfa0ef","html_url":"https://github.com/wdhongtw/minidir","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wdhongtw/minidir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdhongtw%2Fminidir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdhongtw%2Fminidir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdhongtw%2Fminidir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdhongtw%2Fminidir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wdhongtw","download_url":"https://codeload.github.com/wdhongtw/minidir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdhongtw%2Fminidir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28926283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T22:32:35.345Z","status":"ssl_error","status_checked_at":"2026-01-30T22:32:31.927Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["filesystem","python","testing"],"created_at":"2026-01-31T01:37:57.152Z","updated_at":"2026-01-31T01:37:57.290Z","avatar_url":"https://github.com/wdhongtw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minidir: Minimal directory interface and implementation\n\nThe minimal interface for directories and files and\ntwo implementations: in-memory and real file system versions.\n\nIt's a good choice when we want to separate file-access side effects from\npure functional part of our code base.\n\n## Installation\n\nAlready published on Pypi\n\n```shell\npip install minidir\n```\n\n## Usage\n\n- Interface: `Directory` -\u003e `Path`, `File`\n    - `Directory` is the container where we access `File` by `Path`\n- Implementation\n    - `SystemDirectory`: a `Directory` backed by real file system.\n    - `FakeDirectory`: a `Directory` only exists in-memory.\n\nSome error like `NameCollision` and `NotFound` will be raised in corresponding situations.\n\nExample:\n\n```python\nimport minidir\n\nclass SomeClass:\n    folder: minidir.Directory\n\n    def __init__(self, folder: minidir.Directory) -\u003e None:\n        # inject directory to separate side effect from core logic\n        pass\n\ndef main():\n    # use actual file system during production\n    instance = SomeClass(minidir.SystemDirectory(\"/path/to/root\"))\n\ndef test_some_class():\n    # use in-memory implementation during test\n    instance = SomeClass(minidir.FakeDirectory())\n```\n\n## Future Work\n\n- Implementations for network-oriented storage, e.g. WebDAV, S3, Dropbox ...\n- Stream based file read / write interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwdhongtw%2Fminidir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwdhongtw%2Fminidir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwdhongtw%2Fminidir/lists"}