fs

Python's Filesystem abstraction layer

https://github.com/pyfilesystem/pyfilesystem2

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 49 committers (4.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

filesystem filesystem-library ftp pyfilesystem pyfilesystem2 python tar zip

Keywords from Contributors

fuzzing semantic-web metagenomes genome bioinformatics annotations binding http-server http-client asyncio
Last synced: 6 months ago · JSON representation

Repository

Python's Filesystem abstraction layer

Basic Info
  • Host: GitHub
  • Owner: PyFilesystem
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://www.pyfilesystem.org
  • Size: 1.68 MB
Statistics
  • Stars: 2,058
  • Watchers: 42
  • Forks: 180
  • Open Issues: 117
  • Releases: 50
Topics
filesystem filesystem-library ftp pyfilesystem pyfilesystem2 python tar zip
Created over 9 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog Contributing Funding License

README.md

PyFilesystem2

Python's Filesystem abstraction layer.

PyPI version PyPI Downloads Build Status Windows Build Status Coverage Status Codacy Badge Docs

Documentation

Introduction

Think of PyFilesystem's FS objects as the next logical step to Python's file objects. In the same way that file objects abstract a single file, FS objects abstract an entire filesystem.

Let's look at a simple piece of code as an example. The following function uses the PyFilesystem API to count the number of non-blank lines of Python code in a directory. It works recursively, so it will find .py files in all sub-directories.

python def count_python_loc(fs): """Count non-blank lines of Python code.""" count = 0 for path in fs.walk.files(filter=['*.py']): with fs.open(path) as python_file: count += sum(1 for line in python_file if line.strip()) return count

We can call count_python_loc as follows:

python from fs import open_fs projects_fs = open_fs('~/projects') print(count_python_loc(projects_fs))

The line project_fs = open_fs('~/projects') opens an FS object that maps to the projects directory in your home folder. That object is used by count_python_loc when counting lines of code.

To count the lines of Python code in a zip file, we can make the following change:

python projects_fs = open_fs('zip://projects.zip')

Or to count the Python lines on an FTP server:

python projects_fs = open_fs('ftp://ftp.example.org/projects')

No changes to count_python_loc are necessary, because PyFileystem provides a simple consistent interface to anything that resembles a collection of files and directories. Essentially, it allows you to write code that is independent of where and how the files are physically stored.

Contrast that with a version that purely uses the standard library:

python def count_py_loc(path): count = 0 for root, dirs, files in os.walk(path): for name in files: if name.endswith('.py'): with open(os.path.join(root, name), 'rt') as python_file: count += sum(1 for line in python_file if line.strip()) return count

This version is similar to the PyFilesystem code above, but would only work with the OS filesystem. Any other filesystem would require an entirely different API, and you would likely have to re-implement the directory walking functionality of os.walk.

Credits

The following developers have contributed code and their time to this projects:

See CONTRIBUTORS.md for a full list of contributors.

PyFilesystem2 owes a massive debt of gratitude to the following developers who contributed code and ideas to the original version.

  • Ryan Kelly
  • Andrew Scheller
  • Ben Timby

Apologies if I missed anyone, feel free to prompt me if your name is missing here.

Support

If commercial support is required, please contact Will McGugan.

Owner

  • Name: pyFilesystem
  • Login: PyFilesystem
  • Kind: organization

GitHub Events

Total
  • Issues event: 3
  • Watch event: 63
  • Issue comment event: 22
  • Push event: 4
  • Pull request review comment event: 1
  • Pull request event: 4
  • Fork event: 9
  • Create event: 1
Last Year
  • Issues event: 3
  • Watch event: 63
  • Issue comment event: 22
  • Push event: 4
  • Pull request review comment event: 1
  • Pull request event: 4
  • Fork event: 9
  • Create event: 1

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 734
  • Total Committers: 49
  • Avg Commits per committer: 14.98
  • Development Distribution Score (DDS): 0.508
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Will McGugan w****n@g****m 361
Martin Larralde m****e@e****e 130
Thomas Feldmann m****l@t****e 64
atollk t****s@g****m 41
Martin Larralde m****e@e****r 22
Martin Larralde a****s@u****m 14
Martin Larralde m****e@e****r 14
Giampaolo Cimino c****o@n****t 12
Oliver Galvin o****g@r****t 9
Diego Argueta d****a@u****m 6
Sven Schliesing m****n@r****t 5
Geoff Jukes g****s@u****m 4
Andrew Scheller g****b@l****g 3
Andrey Serov 4****w@u****m 3
Eelke van den Bos e****s@g****m 3
Ben Lindsay b****y@g****m 2
Kossak t****k@u****m 2
Louis Sautier s****s@g****m 2
Matthew Gamble g****t@m****t 2
Philippe Ombredanne p****e@g****m 2
Rehan Khwaja r****n@k****e 2
Tim Gates t****s@i****m 2
fresheed o****s@g****m 2
sqwishy s****y@f****a 2
Adrian Garcia Badaracco 1****b@u****m 1
Alex Povel 4****l@u****m 1
Andrew Scheller l****h@d****g 1
Bernhard M. Wiedemann g****w@l****e 1
Dafna Hirschfeld d****3@g****m 1
Felix Yan f****s@a****g 1
and 19 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 83
  • Total pull requests: 47
  • Average time to close issues: 6 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 62
  • Total pull request authors: 30
  • Average comments per issue: 3.73
  • Average comments per pull request: 3.17
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 4
  • Pull requests: 10
  • Average time to close issues: about 24 hours
  • Average time to close pull requests: 5 months
  • Issue authors: 4
  • Pull request authors: 5
  • Average comments per issue: 2.25
  • Average comments per pull request: 0.7
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • tfeldmann (7)
  • ReimarBauer (3)
  • kloczek (3)
  • adriangb (3)
  • prchristie (2)
  • frafra (2)
  • hrnciar (2)
  • willmcgugan (2)
  • djmattyg007 (2)
  • dAnjou (2)
  • jdonnerstag (2)
  • althonos (2)
  • JustASquid (2)
  • dsoulis (1)
  • CDU-Ge (1)
Pull Request Authors
  • eli-schwartz (8)
  • tfeldmann (6)
  • althonos (5)
  • lurch (2)
  • edgarrmondragon (2)
  • djmattyg007 (2)
  • akeeman (2)
  • jenhagg (2)
  • dependabot[bot] (2)
  • musicinmybrain (2)
  • mweinelt (2)
  • kianmeng (1)
  • adriangb (1)
  • arossert (1)
  • benlindsay (1)
Top Labels
Issue Labels
question (14) bug (12) enhancement (11) docs (5) Discussion (3)
Pull Request Labels
bug (5) docs (2) dependencies (2) github_actions (2)

Packages

  • Total packages: 6
  • Total downloads:
    • pypi 6,478,585 last-month
  • Total docker downloads: 19,389,451
  • Total dependent packages: 153
    (may contain duplicates)
  • Total dependent repositories: 1,141
    (may contain duplicates)
  • Total versions: 165
  • Total maintainers: 4
pypi.org: fs

Python's filesystem abstraction layer

  • Versions: 88
  • Dependent Packages: 134
  • Dependent Repositories: 1,128
  • Downloads: 6,478,569 Last month
  • Docker Downloads: 19,389,451
Rankings
Dependent packages count: 0.2%
Downloads: 0.2%
Dependent repos count: 0.3%
Docker downloads count: 0.5%
Average: 1.1%
Stargazers count: 1.6%
Forks count: 3.7%
Maintainers (2)
Last synced: 6 months ago
proxy.golang.org: github.com/pyfilesystem/pyfilesystem2
  • Versions: 50
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
conda-forge.org: fs

pyfilesystem2 lets you work with diverse filesystems through a common API.

  • Versions: 23
  • Dependent Packages: 17
  • Dependent Repositories: 6
Rankings
Dependent packages count: 3.8%
Stargazers count: 9.3%
Average: 10.1%
Forks count: 13.7%
Dependent repos count: 13.9%
Last synced: 6 months ago
spack.io: py-fs

Python's filesystem abstraction layer

  • Versions: 2
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Stargazers count: 5.4%
Forks count: 7.6%
Average: 10.3%
Dependent packages count: 28.1%
Maintainers (1)
Last synced: 6 months ago
pypi.org: fs-smb-int

fs-smb_int

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 16 Last month
Rankings
Stargazers count: 1.6%
Forks count: 3.8%
Dependent packages count: 10.0%
Average: 20.5%
Dependent repos count: 21.8%
Downloads: 65.2%
Maintainers (1)
Last synced: 6 months ago
anaconda.org: fs

pyfilesystem2 lets you work with diverse filesystems through a common API.

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 6
Rankings
Stargazers count: 18.1%
Forks count: 24.4%
Average: 28.8%
Dependent packages count: 30.6%
Dependent repos count: 42.0%
Last synced: 6 months ago

Dependencies

.github/workflows/package.yml actions
  • actions/checkout v2 composite
  • actions/checkout v1 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
  • pypa/gh-action-pypi-publish master composite
  • rasmus-saks/release-a-changelog-action v1.0.1 composite
.github/workflows/test.yml actions
  • AndreMiras/coveralls-python-action develop composite
  • actions/checkout v1 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
docs/requirements.txt pypi
  • Sphinx *
  • recommonmark *
  • sphinx-rtd-theme *
tests/requirements.txt pypi
  • mock * test
  • parameterized * test
  • psutil * test
  • pyftpdlib * test
  • pysendfile * test