TopGit theo dõi pre-commit/identify trên GitHub, đã đạt 297 sao. File identification library for Python
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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 ruby gem that github uses to figure out the license for a
repo).
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]
>>> 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.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/pre-commit/identify là nguồn chính thức.
pre-commit/identify có phải mã nguồn mở không?
Có — pre-commit/identify phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/pre-commit/identify.
pre-commit/identify là gì?
pre-commit/identify (pre-commit/identify) là dự án Python trên GitHub. Theo mô tả gốc: File identification library for Python
Đọc đầy đủ README ở tab phía trên.
Chưa chắc identify có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về identify.