{"id":32177905,"url":"https://github.com/open-cogsci/fileinspector","last_synced_at":"2026-03-10T11:05:45.700Z","repository":{"id":57457015,"uuid":"52955586","full_name":"open-cogsci/fileinspector","owner":"open-cogsci","description":"An easy way of determining filetypes in python","archived":false,"fork":false,"pushed_at":"2019-08-16T10:10:07.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-22T14:31:12.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-cogsci.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}},"created_at":"2016-03-02T10:49:32.000Z","updated_at":"2025-11-15T01:02:51.000Z","dependencies_parsed_at":"2022-09-02T16:58:34.291Z","dependency_job_id":null,"html_url":"https://github.com/open-cogsci/fileinspector","commit_stats":null,"previous_names":["dschreij/fileinspector"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/open-cogsci/fileinspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Ffileinspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Ffileinspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Ffileinspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Ffileinspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-cogsci","download_url":"https://codeload.github.com/open-cogsci/fileinspector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Ffileinspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30331654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: 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":[],"created_at":"2025-10-21T20:35:21.334Z","updated_at":"2026-03-10T11:05:45.692Z","avatar_url":"https://github.com/open-cogsci.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File Inspector\n\nCopyright 2016 Daniel Schreij\n\n## About\n\nThis module is a layer on top of the standard Python mimetypes module and [python-magic](https://github.com/ahupp/python-magic). Python-magic only works with local files to which you need to have access, while mimetypes only uses the filename to determine its filetype.\n\nFile inspector first checks if a file exists at the provided path, and if this is the case it uses python-magic to get more information about the file type. If this is not the case (for instance if you just have a reference uri to an online file, without access to the file itself) the mimetypes module is used to deterimine the filetype based on the filename.\n\nThe idea is to then provide uniform mimetype output of the filetype, regardless of the way (mimetypes or python-magic) with which it was determined.\n\nIt's a simple as that, nothing fancy here  ;)\n\n## Usage\n\nYou can use the utility from the command line.\n\n    python fileinspector.py /path/to/local.pdf\n\nfor instance would return\n\n    /path/to/local.pdf:       PDF document, version 1.3\n\nif the file is locally accessible, and the python-magic dependency has been met. If a file is not locally accessible (for instance if the resource is located online), or the python-magic dependency is unmet, fileinspector uses the internal python mimetypes module to determine the filetype. Mimetypes bases its guess on the file's extension.\n\n    python fileinspector.py https://www.google.com/images/nav_logo242.png\n\nshould return\n\n    https://www.google.com/images/nav_logo242.png:      image/png\n\nIt is also possible to scan entire folders\n\n    python fileinspector.py *\n    README.md:      ASCII text, with very long lines\n    fileinspector.py:       Python script, ASCII text executable\n    fileinspector.pyc:      python 2.7 byte-compiled\n    setup.py:       Python script, ASCII text executable\n    test.md:        ASCII text\n\n## License\n\n`python-filespector` is licensed under the [GNU General Public License\nv3](http://www.gnu.org/licenses/gpl-3.0.en.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cogsci%2Ffileinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-cogsci%2Ffileinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cogsci%2Ffileinspector/lists"}