{"id":34085288,"url":"https://github.com/brondavies/filetypetranslator","last_synced_at":"2025-12-14T13:01:38.867Z","repository":{"id":57432502,"uuid":"68351659","full_name":"brondavies/filetypetranslator","owner":"brondavies","description":"Helper functions for your .Net, Python, JavaScript, and Java projects to get mime types and general file category","archived":false,"fork":false,"pushed_at":"2025-05-05T21:02:20.000Z","size":594,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-29T21:57:20.126Z","etag":null,"topics":["attachments","downloads","email","file-type","file-type-check","file-type-detection","file-types","mime-type","mime-type-check","mime-types","web"],"latest_commit_sha":null,"homepage":"","language":"C#","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/brondavies.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2016-09-16T04:08:44.000Z","updated_at":"2025-05-05T21:02:24.000Z","dependencies_parsed_at":"2023-11-13T17:25:50.384Z","dependency_job_id":"c8305076-f791-46af-8890-15e32b191714","html_url":"https://github.com/brondavies/filetypetranslator","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.5098039215686274,"last_synced_commit":"e9e55687f59f09862a9537cfbc25e936d9a9e712"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brondavies/filetypetranslator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brondavies%2Ffiletypetranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brondavies%2Ffiletypetranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brondavies%2Ffiletypetranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brondavies%2Ffiletypetranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brondavies","download_url":"https://codeload.github.com/brondavies/filetypetranslator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brondavies%2Ffiletypetranslator/sbom","scorecard":{"id":254459,"data":{"date":"2025-08-11","repo":{"name":"github.com/brondavies/filetypetranslator","commit":"f511496580a276da2614dab308e087e369fc5c01"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/brondavies/filetypetranslator/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/brondavies/filetypetranslator/codeql-analysis.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/brondavies/filetypetranslator/codeql-analysis.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/brondavies/filetypetranslator/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/brondavies/filetypetranslator/codeql-analysis.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:18:27.309Z","repository_id":57432502,"created_at":"2025-08-17T09:18:27.309Z","updated_at":"2025-08-17T09:18:27.309Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27728760,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["attachments","downloads","email","file-type","file-type-check","file-type-detection","file-types","mime-type","mime-type-check","mime-types","web"],"created_at":"2025-12-14T13:01:38.194Z","updated_at":"2025-12-14T13:01:38.861Z","avatar_url":"https://github.com/brondavies.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![FTT Logo](https://raw.githubusercontent.com/brondavies/filetypetranslator/master/ftt-icon.png) File Type Translator (FTT)\r\n\r\n[![NuGet version (FTTLib)](https://img.shields.io/nuget/v/FTTLib.dll.svg?style=flat-square)](https://www.nuget.org/packages/FTTLib.dll/)\r\n[![NuGet Downloads](https://img.shields.io/nuget/dt/FTTLib.dll.svg)](https://www.nuget.org/packages/FTTLib.dll/)\r\n[![npm](https://badge.fury.io/js/fttlib.svg)](https://www.npmjs.com/package/fttlib/)\r\n[![PyPI](https://badge.fury.io/py/fttlib.svg)](https://pypi.org/project/fttlib/)\r\n[![CodeQL](https://github.com/brondavies/filetypetranslator/workflows/CodeQL/badge.svg)](https://github.com/brondavies/filetypetranslator/actions?query=workflow%3ACodeQL)\r\n\r\nA library of helper methods for your .Net, Javascript or Python projects to get [mime types](https://en.wikipedia.org/wiki/Media_type) and general file category\r\n\r\n# Releases\r\nAvailable as a [nuget package](https://www.nuget.org/packages/FTTLib.dll), [npm package](https://www.npmjs.com/package/fttlib/), or\r\n[PyPI package](https://pypi.org/project/fttlib/)\r\n\r\n#### 1.1.8 - Updated sources, adds many modern file types and updates/eliminates some legacy mime types\r\n#### 1.1.7 - Updated sources, optimized generated code to be smaller and to be easier to diff future versions\r\n#### 1.1.5 - Updated sources, adds many modern file types and updates/eliminates some legacy mime types\r\n#### 1.1.4 - Multi-framework targeting nuget package\r\n#### 1.1.3 - Updated sources, Notably the mime type for .js is now text/javascript instead of application/javascript according to the [IANA standard specification](https://www.iana.org/assignments/media-types/application/javascript)\r\n#### 1.1.2 - Updated sources, Initial python release\r\n#### 1.1.1 - Updated sources, switched to .netstandard runtime\r\n#### 1.1.0 - Updated sources, added PDF, Presentation, and Spreadsheet file categories - formerly part of Document\r\n#### 1.0.3 - Initial public release\r\n\r\n# Examples\r\n\r\n#### Install\r\n\r\n```sh\r\ndotnet add package FTTLib.dll\r\n```\r\n\r\n#### Import the library\r\n\r\n```csharp\r\nusing FTTLib;\r\n```\r\n\r\n####  When you need to know the mime type of a file based on its extension.\r\n\r\n```csharp\r\nstring mimeType = FTT.GetMimeType(@\"Path\\To\\My\\File.doc\");\r\nConsole.WriteLine(mimeType);\r\n\r\nmimeType = FTT.GetMimeType(@\"Path\\To\\My\\File.docx\");\r\nConsole.WriteLine(mimeType);\r\n\r\n\u003e  application/msword\r\n\u003e  application/vnd.openxmlformats-officedocument.wordprocessingml.document\r\n```\r\n\r\n####  When you need to know the file type category of a file based on its extension.\r\n\r\n```csharp\r\nFileCategory category = FTT.GetFileCategory(@\"Path\\To\\My\\File.docx\");\r\nConsole.WriteLine(category);\r\n\r\ncategory = FTT.GetFileCategory(@\"Path\\To\\My\\File.jpg\");\r\nConsole.WriteLine(category);\r\n\r\n\u003e  Document\r\n\u003e  Image\r\n```\r\n\r\n####  When you need to know the preferred file extension for a file based on its mime type.\r\n\r\n```csharp\r\nstring[] extensions = FTT.GetMimeTypeFileExtensions(\"text/csv\");\r\nConsole.WriteLine(extensions[0]);\r\n\r\n\u003e  csv\r\n```\r\n\r\n# Design\r\n\r\nThis library is designed along the following tenets:\r\n\r\n* No external dependencies\r\n* No file system access\r\n* Small memory footprint\r\n* Simple static methods (no extension methods and no instantiatable classes)\r\n* Case-insensitive\r\n* Portable - works in applications targeting any CLR\r\n\r\n# File Categories\r\n\r\nFile media types are broken down into relatively few categories.  Sub-categories may be considered in a future release according to information on [Wikipedia](https://en.wikipedia.org/wiki/List_of_file_formats)  Here are the guidelines that determine a file's category\r\n\r\n* Archive: any file that can be extracted into several files\r\n* Audio: any file that can only contain an audio stream\r\n* Binary: any file that is unclassified or does not have a text representation\r\n* Code: any file that contains instructions that are compilable or machine-readable\r\n* Document: any file that is designed for conveying structured information between people\r\n* Image: any file that can only contain a single image or series of images\r\n* PDF: any file that is considered a document archive format\r\n* Presentation: any file that is designed for electronic presentations consisting of a series of separate pages or slides\r\n* Spreadsheet: any file in which data is arranged in rows and columns and can be manipulated and used in calculations\r\n* Text: any file that is not classified under another category and is not binary\r\n* Video: any file that is designed to be a container for a video stream\r\n\r\n# Known Limitations\r\n\r\n* Even though a mime type to file extension mapping is not necessarily one-to-one, the most common should be returned by the library\r\n* This library does not provide file sniffing capabilities - in other words, if you have a file and you want to verify the contents are of a specific type, look elsewhere. FTT only uses the file name with an extension.  That capability may be added in a future release.\r\n* The only file categories presently considered are Archive, Audio, Binary, Code, Document, Image, PDF, Presentation, Spreadsheet, Text, and Video.  Binary is the default if there is no match in the database.\r\n\r\n# Sources\r\n\r\nWhile it is unrealistic to expect this library to provide a comprehensive list with *all* the file types the world has to offer, it would be nice if we could get close.  Generally, if the file type is even remotely common, it is listed in one of the sources.  You can [submit a bug report](https://github.com/brondavies/filetypetranslator/issues/new) for a file type that is missing or that you think should be added.  You will have to include a reputable source as well.\r\n\r\n### Information sources for this library are provided through the following and in order of preference:\r\n\r\n1. http://www.iana.org/assignments/media-types/media-types.xhtml\r\n1. https://gitlab.freedesktop.org/xdg/shared-mime-info\r\n1. https://cdn.rawgit.com/jshttp/mime-db/master/db.json\r\n1. http://www.file-extensions.org/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrondavies%2Ffiletypetranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrondavies%2Ffiletypetranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrondavies%2Ffiletypetranslator/lists"}