{"id":13501676,"url":"https://github.com/ua-nick/fleep-py","last_synced_at":"2025-07-24T21:16:58.594Z","repository":{"id":57431211,"uuid":"115556788","full_name":"ua-nick/fleep-py","owner":"ua-nick","description":"File format determination library for Python","archived":false,"fork":false,"pushed_at":"2024-05-21T21:53:55.000Z","size":122,"stargazers_count":262,"open_issues_count":17,"forks_count":40,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-08T07:03:29.584Z","etag":null,"topics":["extension","file-extensions","file-format","file-format-detection","file-type-detection","file-types","fileformat","filetype","magic-number","magic-numbers","mimetype"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/fleep","language":"Python","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/ua-nick.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","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":"2017-12-27T20:53:27.000Z","updated_at":"2024-10-17T14:15:03.000Z","dependencies_parsed_at":"2024-11-19T05:03:14.451Z","dependency_job_id":null,"html_url":"https://github.com/ua-nick/fleep-py","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"994bc2c274482d80ab13d89d8f7343eb316d3e44"},"previous_names":["floyernick/fleep","paliimx/fleep-py"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-nick%2Ffleep-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-nick%2Ffleep-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-nick%2Ffleep-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-nick%2Ffleep-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ua-nick","download_url":"https://codeload.github.com/ua-nick/fleep-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"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":["extension","file-extensions","file-format","file-format-detection","file-type-detection","file-types","fileformat","filetype","magic-number","magic-numbers","mimetype"],"created_at":"2024-07-31T22:01:46.042Z","updated_at":"2025-04-07T18:14:02.139Z","avatar_url":"https://github.com/ua-nick.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"fleep\n=====\n\nFile format determination library for Python\n\n|pypi version| |python version| |license|\n\nGetting Started\n---------------\n\n**fleep** is a library that determines file format by file signature (also known as \"magic number\").\n\nInstallation\n------------\n\nYou can install fleep using *pip*. Simply run in CLI:\n\n::\n\n    pip install fleep\n\nRequirements\n------------\n\n-  Python \u003e= 3.1\n\nIn Use\n------\n\nfleep has main function *get()* that determines file format. It takes byte sequence (128 bytes are enough) as an argument and returns an instance of class *Info* with the following arguments:\n\n-  *type* -\u003e list of suitable file types\n-  *extension* -\u003e list of suitable file extensions\n-  *mime* -\u003e list of suitable file MIME types\n\nYou may presume that first element in list will be the most suitable.\n\nAlso an instance of class *Info* has the following methods:\n\n-  *type_matches()* -\u003e checks if file type matches with given type as an argument\n-  *extension_matches()* -\u003e checks if file extension matches with given extension as an argument\n-  *mime_matches()* -\u003e checks if file MIME type matches with given MIME type as an argument\n\nThere are 3 more functions:\n\n-  *supported_types()* -\u003e returns a list of supported file types\n-  *supported_extensions()* -\u003e returns a list of supported file extensions\n-  *supported_mimes()* -\u003e returns a list of supported file MIME types\n\nExamples\n--------\n\nYou can find examples in *examples* folder. There is a simple example:\n\n.. code:: python\n\n    import fleep\n\n    with open(\"png_image\", \"rb\") as file:\n        info = fleep.get(file.read(128))\n\n    print(info.type)  # prints ['raster-image']\n    print(info.extension)  # prints ['png']\n    print(info.mime)  # prints ['image/png']\n\n    print(info.type_matches(\"raster-image\"))  # prints True\n    print(info.extension_matches(\"gif\"))  # prints False\n    print(info.mime_matches(\"image/png\"))  # prints True\n\nTests\n-----\n\nYou can find tests in *tests* folder. There are results of speed test:\n\n**Workstation**\n\n-  Python 3.6 x64 bit\n-  Windows 10 Home x64 bit\n-  Intel Pentium G4620 3.70GHz\n-  Kingston DDR4-2400 8192MB\n-  Kingston SSD 120GB 550MB/s\n\n**Results**\n\n*Note:* 0.0012345 -\u003e time in seconds\n\n+-----------+---------+-----------+-----------+\n| Iteration | Minimum | Maximum   | Average   |\n+===========+=========+===========+===========+\n| 1         | 0.0     | 0.0005312 | 0.0000851 |\n+-----------+---------+-----------+-----------+\n| 2         | 0.0     | 0.0005360 | 0.0000858 |\n+-----------+---------+-----------+-----------+\n| 3         | 0.0     | 0.0005236 | 0.0000837 |\n+-----------+---------+-----------+-----------+\n| 4         | 0.0     | 0.0005035 | 0.0000833 |\n+-----------+---------+-----------+-----------+\n| 5         | 0.0     | 0.0005295 | 0.0000835 |\n+-----------+---------+-----------+-----------+\n\nSupported Formats\n-----------------\n\nThere is a list of supported formats (in alphabetical order):\n\n*Raster Image:*\n\n-  BMP\n-  GIF\n-  ICO\n-  JP2\n-  JPEG\n-  PNG\n-  PSD\n-  TIFF\n-  WEBP\n\n*Raw Image:*\n\n-  ARW\n-  CR2\n-  CRW\n-  DNG\n-  ERF\n-  NEF\n-  NRW\n-  ORF\n-  PEF\n-  RAF\n-  RAW\n-  RW2\n-  SRW\n-  X3F\n\n*Vector Image:*\n\n-  AI\n-  EPS\n\n*3D Image:*\n\n-  C4D\n-  FBX\n-  MA\n-  MS3D\n-  MTL\n-  OBJ\n-  PLY\n-  WRL\n-  X3D\n-  XSI\n\n*Audio:*\n\n-  AAC\n-  AC3\n-  AIFF\n-  AMR\n-  AU\n-  FLAC\n-  M4A\n-  MIDI\n-  MKA\n-  MP3\n-  OGA\n-  RA\n-  VOC\n-  WAV\n-  WMA\n\n*Video:*\n\n-  3G2\n-  3GP\n-  ASF\n-  AVI\n-  FLV\n-  M4V\n-  MKV\n-  MOV\n-  MP4\n-  MPG\n-  OGV\n-  SWF\n-  VOB\n-  WEBM\n-  WMV\n\n*Document:*\n\n-  DOC\n-  DOCX\n-  EPUB\n-  KEY\n-  NUMBERS\n-  ODP\n-  ODS\n-  ODT\n-  PAGES\n-  PDF\n-  PPS\n-  PPT\n-  PPTX\n-  RTF\n-  XLS\n-  XLSX\n-  XML\n\n*Archive:*\n\n-  7Z\n-  DMG\n-  GZ\n-  ISO\n-  RAR\n-  TAR.Z\n-  ZIP\n\n*Executable:*\n\n-  COM\n-  EXE\n-  JAR\n\n*Font:*\n\n-  OTF\n-  TTF\n-  WOFF\n-  WOFF2\n\n*System:*\n\n-  CAB\n-  CAT\n-  DLL\n-  DRV\n-  REG\n-  SDB\n-  SYS\n\n*Database:*\n\n-  SQLITE\n\nChangelog\n---------\n\nYou can find changelog in *CHANGELOG.md* file.\n\nLicense\n-------\n\nThis project is licensed under the *MIT License*.\n\nAuthors\n-------\n\n**Mykyta Paliienko** - `GitHub profile`_\n\n.. _GitHub profile: https://github.com/floyernick\n\n.. |pypi version| image:: https://img.shields.io/badge/pypi-v1.0.1-blue.svg\n   :target: https://pypi.python.org/pypi/fleep\n.. |python version| image:: https://img.shields.io/badge/python-3-blue.svg\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://github.com/floyernick/fleep/blob/master/LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fua-nick%2Ffleep-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fua-nick%2Ffleep-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fua-nick%2Ffleep-py/lists"}