https://github.com/bwheelz36/get_all_files

a simple package to get all files with given file extension in a directory

https://github.com/bwheelz36/get_all_files

Science Score: 13.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
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

a simple package to get all files with given file extension in a directory

Basic Info
  • Host: GitHub
  • Owner: bwheelz36
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 46.9 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 4
Created about 3 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

README.md

READ ME

tests PyPI version codecov

This is a very simple package which is basically a wrapper around glob; it simply gets all the files with extension matching a list of extensions in a given directory. I found that I was including functionality like this in so many other projects I might as well just make it a package. Plus I wanted to play with poetry.

install

bash pip install get_all_files

Examples

get all jpg files in home directory ```python from getallfiles import getallfiles from pathlib import Path

homedir = Path('~').expanduser() jpgfiles = getallfiles(home_dir, 'jpg') ```

get all jpg AND png files in home directory ```python from getallfiles import getallfiles from pathlib import Path

homedir = Path('~').expanduser() jpgfiles = getallfiles(home_dir, ['jpg', 'png']) ```

get all jpg files starting with 'a' in home directory ```python from getallfiles import getallfiles from pathlib import Path

homedir = Path('~').expanduser() jpgfiles = getallfiles(homedir, 'jpg', filename='a*') ```

get absolute file paths instead of file names ```python from getallfiles import getallfiles from pathlib import Path

homedir = Path('~').expanduser() jpgfiles = getallfiles(homedir, ['jpg', 'png'], returnabsolute_filepath=True) ```

Loop over multiple directories

This package is not recursive - if you want to process multiple directories you have to do it yourself:

```python from getallfiles import getallfiles from pathlib import Path import os

homedir = Path('~').expanduser() subfolders = [f.path for f in os.scandir(homedir) if f.isdir()] extension = 'txt' # why not allfiles = [] for folder in subfolders: files = getallfiles(folder, extension, returnabsolutefilepath=True) all_files.extend(files) ```

Owner

  • Login: bwheelz36
  • Kind: user

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 5
  • Average time to close issues: 27 minutes
  • Average time to close pull requests: about 5 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.6
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bwheelz36 (2)
Pull Request Authors
  • bwheelz36 (5)
Top Labels
Issue Labels
enhancement (2)
Pull Request Labels