Science Score: 36.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
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
6 of 139 committers (4.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords from Contributors
Repository
File identification library for Python
Basic Info
Statistics
- Stars: 281
- Watchers: 6
- Forks: 165
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
identify
File identification library for Python.
Given a file (or some information about a file), return a set of standardized tags identifying what the file is.
Installation
bash
pip install identify
Usage
With a file on disk
If you have an actual file on disk, you can get the most information possible (a superset of all other methods):
```python
from identify import identify identify.tagsfrompath('/path/to/file.py') {'file', 'text', 'python', 'non-executable'} identify.tagsfrompath('/path/to/file-with-shebang') {'file', 'text', 'shell', 'bash', 'executable'} identify.tagsfrompath('/bin/bash') {'file', 'binary', 'executable'} identify.tagsfrompath('/path/to/directory') {'directory'} identify.tagsfrompath('/path/to/symlink') {'symlink'} ```
When using a file on disk, the checks performed are:
- File type (file, symlink, directory, socket)
- Mode (is it executable?)
- File name (mostly based on extension)
- If executable, the shebang is read and the interpreter interpreted
If you only have the filename
```python
identify.tagsfromfilename('file.py') {'text', 'python'} ```
If you only have the interpreter
```python
identify.tagsfrominterpreter('python3.5') {'python', 'python3'} identify.tagsfrominterpreter('bash') {'shell', 'bash'} identify.tagsfrominterpreter('some-unrecognized-thing') set() ```
As a cli
``` $ identify-cli --help usage: identify-cli [-h] [--filename-only] path
positional arguments: path
optional arguments: -h, --help show this help message and exit --filename-only ```
console
$ identify-cli setup.py; echo $?
["file", "non-executable", "python", "text"]
0
$ identify-cli setup.py --filename-only; echo $?
["python", "text"]
0
$ identify-cli wat.wat; echo $?
wat.wat does not exist.
1
$ identify-cli wat.wat --filename-only; echo $?
1
Identifying LICENSE files
identify also has an api for determining what type of license is contained
in a file. This routine is roughly based on the approaches used by
licensee.
The approach that identify uses is as follows:
- Strip the copyright line
- Normalize all whitespace
- Return any exact matches
- Return the closest by edit distance (where edit distance < 5%)
To use the api, install via pip install identify[license]
```pycon
from identify import identify identify.license_id('LICENSE') 'MIT' ```
The return value of the license_id function is an SPDX id. Currently
licenses are sourced from choosealicense.com.
How it works
A call to tags_from_path does this:
- What is the type: file, symlink, directory? If it's not file, stop here.
- Is it executable? Add the appropriate tag.
- Do we recognize the file extension? If so, add the appropriate tags, stop here. These tags would include binary/text.
- Peek at the first X bytes of the file. Use these to determine whether it is binary or text, add the appropriate tag.
- If identified as text above, try to read and interpret the shebang, and add appropriate tags.
By design, this means we don't need to partially read files where we recognize the file extension.
Owner
- Name: pre-commit
- Login: pre-commit
- Kind: organization
- Website: https://pre-commit.com
- Twitter: pre_commit
- Repositories: 29
- Profile: https://github.com/pre-commit
A framework for managing and maintaining multi-language pre-commit hooks.
GitHub Events
Total
- Issues event: 14
- Watch event: 26
- Delete event: 15
- Issue comment event: 39
- Push event: 50
- Pull request review comment event: 3
- Pull request review event: 14
- Pull request event: 75
- Fork event: 22
- Create event: 25
Last Year
- Issues event: 14
- Watch event: 26
- Delete event: 15
- Issue comment event: 39
- Push event: 50
- Pull request review comment event: 3
- Pull request review event: 14
- Pull request event: 75
- Fork event: 22
- Create event: 25
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Anthony Sottile | a****e@u****u | 262 |
| pre-commit-ci[bot] | 6****] | 129 |
| Chris Kuehl | c****l@o****u | 21 |
| Christian Knittl-Frank | l****l@g****m | 8 |
| Max R | m****r | 4 |
| C.A.M. Gerlach | C****h@G****M | 4 |
| Rob Orr | r****r@a****m | 4 |
| Thibaud Colas | t****s@g****m | 4 |
| Vitaliy Lotorev | v****v | 3 |
| Taylor Buchanan | t****n@e****m | 3 |
| Stephan Wolski | s****n@w****i | 3 |
| ColemanTom | 1****m | 3 |
| AleksaC | a****1@g****m | 3 |
| Aaron Gokaslan | a****n@g****m | 3 |
| David Arnold | d****r@x****s | 3 |
| Stephen Rosen | s****n@g****g | 2 |
| Raphael Boidol | b****r | 2 |
| Qexat | 4****t | 2 |
| Markus Hofbauer | m****r@t****e | 2 |
| Kat Rossiter | s****e | 2 |
| Abdulelah Bin Mahfoodh | a****m@g****m | 2 |
| Stuart Jansen | s****n@b****g | 2 |
| W. Augusto Andreoli | a****a@g****m | 2 |
| dkolepp | d****2@g****m | 2 |
| Marco | m****o@m****m | 2 |
| Adam Johnson | me@a****u | 2 |
| Bradley Dice | b****e@b****m | 2 |
| ClasherKasten | c****0@g****m | 2 |
| Dafydd Jones | d****d@t****t | 2 |
| Ersin Yildirim | 9****n | 2 |
| and 109 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 39
- Total pull requests: 278
- Average time to close issues: 3 months
- Average time to close pull requests: 12 days
- Total issue authors: 39
- Total pull request authors: 102
- Average comments per issue: 1.67
- Average comments per pull request: 0.76
- Merged pull requests: 198
- Bot issues: 1
- Bot pull requests: 105
Past Year
- Issues: 9
- Pull requests: 90
- Average time to close issues: about 1 hour
- Average time to close pull requests: 6 days
- Issue authors: 9
- Pull request authors: 30
- Average comments per issue: 0.78
- Average comments per pull request: 0.66
- Merged pull requests: 61
- Bot issues: 0
- Bot pull requests: 24
Top Authors
Issue Authors
- SerTetora (1)
- HartmutLeister (1)
- tungol (1)
- ghostsquad (1)
- UtkarshKunwar (1)
- KORraNpl (1)
- randdusing (1)
- mondeja (1)
- inknos (1)
- ioggstream (1)
- iainelder (1)
- denini08 (1)
- andresmanelli (1)
- spaceone (1)
- SebastianSchildt (1)
Pull Request Authors
- pre-commit-ci[bot] (105)
- asottile (12)
- jalaziz (6)
- vlotorev (5)
- havocesp (4)
- ColemanTom (4)
- gtbuchanan (4)
- qexat (4)
- benspaulding (3)
- mike325 (3)
- elinscott (2)
- cidlik (2)
- AustinZhang1024 (2)
- dafyddj (2)
- mondeja (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 13
-
Total downloads:
- pypi 57,538,498 last-month
- Total docker downloads: 891,666,266
-
Total dependent packages: 111
(may contain duplicates) -
Total dependent repositories: 19,157
(may contain duplicates) - Total versions: 550
- Total maintainers: 4
pypi.org: identify
File identification library for Python
- Homepage: https://github.com/pre-commit/identify
- Documentation: https://identify.readthedocs.io/
- License: MIT
-
Latest release: 2.6.14
published 10 months ago
Rankings
proxy.golang.org: github.com/pre-commit/identify
- Documentation: https://pkg.go.dev/github.com/pre-commit/identify#section-documentation
- License: mit
-
Latest release: v2.6.14+incompatible
published 10 months ago
Rankings
alpine-edge: py3-identify
File identification library for Python
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.14-r0
published 10 months ago
Rankings
Maintainers (1)
alpine-edge: py3-identify-pyc
Precompiled Python bytecode for py3-identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.14-r0
published 10 months ago
Rankings
Maintainers (1)
spack.io: py-identify
File identification library for Python. Given a file (or some information about a file), return a set of standardized tags identifying what the file is.
- Homepage: https://github.com/pre-commit/identify
- License: []
-
Latest release: 2.5.24
published about 3 years ago
Rankings
Maintainers (1)
conda-forge.org: identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.5.8
published over 3 years ago
Rankings
anaconda.org: identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.5.5
published almost 4 years ago
Rankings
alpine-v3.21: py3-identify
File identification library for Python
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.3-r0
published over 1 year ago
Rankings
Maintainers (1)
alpine-v3.22: py3-identify-pyc
Precompiled Python bytecode for py3-identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.12-r0
published about 1 year ago
Rankings
Maintainers (1)
alpine-v3.21: py3-identify-pyc
Precompiled Python bytecode for py3-identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.3-r0
published over 1 year ago
Rankings
Maintainers (1)
alpine-v3.20: py3-identify-pyc
Precompiled Python bytecode for py3-identify
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.5.36-r0
published about 2 years ago
Rankings
Maintainers (1)
alpine-v3.22: py3-identify
File identification library for Python
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.6.12-r0
published about 1 year ago
Rankings
Maintainers (1)
alpine-v3.20: py3-identify
File identification library for Python
- Homepage: https://github.com/pre-commit/identify
- License: MIT
-
Latest release: 2.5.36-r0
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- covdefaults *
- coverage *
- pytest *