{"id":26883811,"url":"https://github.com/jiro4989/filetype","last_synced_at":"2025-10-19T01:06:50.454Z","repository":{"id":38235788,"uuid":"324177111","full_name":"jiro4989/filetype","owner":"jiro4989","description":"Small and dependency free Nim package to infer file and MIME type checking the magic numbers signature.","archived":false,"fork":false,"pushed_at":"2023-08-06T14:23:54.000Z","size":1516,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T17:51:12.648Z","etag":null,"topics":["file","file-format","library","magic-numbers","nim"],"latest_commit_sha":null,"homepage":"https://jiro4989.github.io/filetype/filetype.html","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiro4989.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-24T14:45:00.000Z","updated_at":"2024-09-12T13:20:11.000Z","dependencies_parsed_at":"2025-03-31T17:42:39.204Z","dependency_job_id":"51704a13-f147-4063-a5a0-131c97658d49","html_url":"https://github.com/jiro4989/filetype","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":"jiro4989/repo-template-nim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Ffiletype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Ffiletype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Ffiletype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Ffiletype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiro4989","download_url":"https://codeload.github.com/jiro4989/filetype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253112071,"owners_count":21856070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["file","file-format","library","magic-numbers","nim"],"created_at":"2025-03-31T17:37:15.704Z","updated_at":"2025-10-19T01:06:45.399Z","avatar_url":"https://github.com/jiro4989.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"====\nfiletype\n====\n\n|gh-actions|\n\nSmall and dependency free Nim package to infer file and MIME type checking the magic numbers signature.\nfiletype is heavily inspired by `h2non/filetype \u003chttps://github.com/h2non/filetype\u003e`_.\n\n.. contents:: Table of contents\n\nUsage\n=====\n\n.. code-block:: nim\n\n   import filetype\n   let content = readFile(\"tests/testdata/sample.png\")\n   doAssert match(content).extension == \"png\"\n   doAssert matchFile(\"tests/testdata/sample.png\").mime.value == \"image/png\"\n   doAssert isPngFile(\"tests/testdata/sample.png\")\n   if isZipFile(\"tests/testdata/sample.zip\"):\n     echo \"file is zip\"\n\nTypes\n=============\n\n.. code-block:: nim\n\n   type\n      FileType* = object\n         mime*: Mime\n         extension*: string ## File extension. (ex: `zip`)\n      Mime* = object\n         ## MIME type.\n         typ*: string     ## Ex: `application` of `application/gzip`.\n         subType*: string ## Ex: `gzip` of `application/gzip`.\n         value*: string   ## Ex: `application/gzip` of `application/gzip`.\n\nAPI documents\n=============\n\nSee `filetype module \u003chttps://jiro4989.github.io/filetype/filetype.html\u003e`_.\n\nInstallation\n============\n\n.. code-block:: shell\n\n   $ nimble install -Y filetype\n\nSupported format\n================\n\n=======   ======\nType      Format\n=======   ======\nImage     jpeg, jp2, png, gif, webp, cr2, tiff, bmp, jxr, psd, ico, dwg\nArchive   gz, zip, bz2, 7z, pdf, exe, rtf, nes, crx, ps, xz, sqlite, deb, ar, lz, rpm, elf\nAudio     midi, ogg, flac, wav, amr, mp3, aac\nFont      woff, woff2, ttf, otf\nVideo     wmv, flv, avi, mpeg, mp4\n=======   ======\n\nLICENSE\n=======\n\nMIT\n\nReference\n=========\n\n* https://en.wikipedia.org/wiki/List_of_file_signatures\n* https://en.wikipedia.org/wiki/JPEG\n* https://en.wikipedia.org/wiki/Portable_Network_Graphics\n* https://en.wikipedia.org/wiki/GIF\n* https://en.wikipedia.org/wiki/BMP_file_format\n* https://en.wikipedia.org/wiki/JPEG_XR\n\n.. |gh-actions| image:: https://github.com/jiro4989/filetype/workflows/test/badge.svg\n   :target: https://github.com/jiro4989/filetype/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Ffiletype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiro4989%2Ffiletype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Ffiletype/lists"}