-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileformats.py
542 lines (530 loc) · 13.6 KB
/
fileformats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# USE THE DICTIONARY 'dict_fileformats' as reference to file formats and their extensions
# dictionary below contains file formats(extensions) as keys and their description as values
dict_fileformats = {
# IMAGE FILE EXTENSIONS
".jpg": "JPEG image file",
".png": "Portable Network Graphics file",
".gif": "Graphics Interchange Format file",
".bmp": "Bitmap image file",
".tiff": "Tagged Image File Format",
".svg": "Scalable Vector Graphics file",
".ico": "Icon file",
".webp": "WebP image file",
".raw": "Raw image file",
".pdf": "Portable Document Format file",
".ICO" : "Icon File",
".WebP" : "WebP Image",
".HEIC/HEIF" : "High Efficiency Image Format", # this extension is split in two in the tuple 'tuple_fileformats' below
".JP2" : "JPEG 2000 Image",
".PBM" : "Portable Bitmap Image",
".PGM" : "Portable Graymap Image",
".PPM" : "Portable Pixmap Image",
".XBM" : "X BitMap Image",
".WBMP" : "Wireless Bitmap Image",
# VIDEO FILE EXTENSIONS
".mp4": "MPEG:4 video file",
".avi": "Audio Video Interleave file",
".mov": "QuickTime video file",
".mkv": "Matroska video file",
".flv": "Flash video file",
".wmv": "Windows Media Video file",
".mpg": "MPEG video file",
".webm": "WebM video file",
".3gp": "3GPP video file",
".m4v": "MPEG:4 video file",
".ogg": "Ogg video file",
".ts": "MPEG transport stream file",
".VOB" : "DVD Video Object",
".RM" : "RealMedia",
".SWF" : "Shockwave Flash",
".ASF" : "Advanced Systems Format",
".MTS" : "AVCHD Video",
".F4V" : "Flash Video",
".MXF" : "Material Exchange Format",
".AMV" : "Anime Music Video",
# AUDIO FILE EXTENSIONS
"MP3" : "MPEG Audio Layer:3",
"WAV" : "Waveform Audio File Format",
"FLAC" : "Free Lossless Audio Codec",
"AAC" : "Advanced Audio Coding",
"OGG" : "Ogg Vorbis",
"WMA" : "Windows Media Audio",
"AIFF" : "Audio Interchange File Format",
"ALAC" : "Apple Lossless Audio Codec",
"M4A" : "MPEG:4 Audio Layer",
"AC3" : "Audio Coding 3",
"AMR" : "Adaptive Multi : Rate Audio Codec",
"MP2" : "MPEG Audio Layer : 2",
"AU" : "Audio File",
"MIDI" : "Musical Instrument Digital Interface",
"OPUS" : "Opus Audio Codec",
"APE" : "Monkey's Audio",
"DSD" : "Direct Stream Digital",
"MPGA" : "MPEG Audio",
"RA" : "RealAudio",
"WV" : "WavPack Audio",
"CAF" : "Core Audio Format",
"MPC" : "Musepack",
"SPX" : "Speex Audio",
"MP1" : "MPEG Audio Layer:1",
"MOD" : "Module File",
"SND" : "Sound File",
"ADX" : "CRI Audio File",
"GSM" : "GSM Audio File",
"VQF" : "TwinVQ Audio",
"TTA" : "True Audio",
"SPC" : "Super Nintendo Audio File",
"OPUS" : "Opus Audio File",
"EAC3" : "Enhanced AC:3 Audio",
"WavPack" : "WavPack Audio File",
"WVX" : "WavPack Hybrid Lossless Audio",
"MID" : "MIDI File",
"DTS" : "Digital Theater Systems Audio File",
"MKA" : "Matroska Audio File",
"AMR:WB" : "Adaptive Multi:Rate Wideband Audio",
"ATRAC" : "Adaptive Transform Acoustic Coding",
"S3M" : "Scream Tracker 3 Module",
"IT" : "Impulse Tracker Module",
"XM" : "Extended Module",
"NSF" : "NES Sound Format",
"SID" : "Commodore 64 Audio File",
"W64" : "Sony Wave64 Audio File",
"3GA" : "3GPP Audio File",
"ADPCM" : "Adaptive Differential Pulse Code Modulation",
"SD2" : "Sound Designer II File",
"VOC" : "Creative Voice File",
"MPP" : "Musepack Compressed Audio File",
"AMR:NB" : "Adaptive Multi:Rate Narrowband Audio",
"RMI" : "RIFF MIDI File",
"IFF" : "Interchange File Format",
"MTM" : "MultiTracker Module",
"S3Z" : "Compressed Scream Tracker 3 Module",
"AIFC" : "Compressed Audio Interchange File Format",
"RIFF" : "Resource Interchange File Format",
"RNS" : "Reason Song File",
"IRCAM" : "IRCAM Sound File",
"PVF" : "Portable Voice Format",
"ARR" : "Cubase Arrange File",
"KAR": "Karaoke MIDI File",
"OFR" : "OptimFROG Lossless Audio File",
"PAF" : "Ensoniq PARIS Audio File",
"AU/SND" : "Sun Audio File",
"SDS" : "MIDI Sample Dump Standard File",
"AIFF:C" : "AIFF:C Sound File",
"WVE" : "Wondershare Filmora Project File",
"MPC8" : "Musepack SV8 Audio File",
# TEXT FILE EXTENSIONS
"TXT" : "Plain Text File",
"CSV" : "Comma - Separated Values",
"XML" : "Extensible Markup Language",
"JSON" : "JavaScript Object Notation",
"HTML" : "Hypertext Markup Language",
"RTF" : "Rich Text Format",
"DOC/DOCX" : "Microsoft Word Document",
"PDF" : "Portable Document Format",
"EPUB" : "Electronic Publication",
"Markdown" : "Markdown Text Format",
# 'DEVELOPER' FILE EXTENSIONS
"EXE": "Executable File",
"DLL": "Dynamic Link Library",
"SYS": "System File",
"APP": "Application File",
"BAT": "Batch File",
"SH": "Shell Script",
"PS1": "PowerShell Script",
"VBS": "VBScript File",
"JAR": "Java Archive",
"APK": "Android Package",
"IPA": "iOS App Archive",
"PY": "Python Script",
"PYC": "Compiled Python File",
"RB": "Ruby Script",
"R": "R Script",
"PL": "Perl Script",
"C": "C Source Code File",
"CPP": "C++ Source Code File",
"H": "C/C++ Header File",
"JAVA": "Java Source Code File",
"JS": "JavaScript Source Code File",
"CSS": "Cascading Style Sheet",
"HTML": "Hypertext Markup Language File",
"PHP": "PHP Script",
"ASP/ASPX": "Active Server Page",
"JSP": "JavaServer Pages File",
"TS": "TypeScript Source Code File",
"GO": "Go Source Code File",
"SWIFT": "Swift Source Code File",
"SCALA": "Scala Source Code File",
"RUBY": "Ruby Source Code File",
"PERL": "Perl Script",
"LUA": "Lua Source Code File",
"PLSQL": "PL/SQL Source Code File",
"ASM": "Assembly Source Code File",
"VB": "Visual Basic Source Code File",
"VBSCRIPT": "VBScript File",
"MATLAB": "MATLAB Source Code File",
"OCTAVE": "Octave Script File",
"F90": "Fortran 90 Source Code File",
"F95": "Fortran 95 Source Code File",
"BAT": "Windows Batch Script",
"CMD": "Windows Command Script",
"SWF": "Flash Animation File",
"HTA": "HTML Application File",
"IPA": "iOS App Archive",
"APK": "Android Package File",
"MSI": "Windows Installer Package",
"DMG": "macOS Disk Image",
"ISO": "Disk Image File",
# SYSTEM FILE EXTENSIONS
"DLL": "Dynamic Link Library",
"SYS": "System File",
"EXE": "Executable File",
"SYS": "Device Driver File",
"INI": "Initialization File",
"BAT": "Batch File",
"CFG": "Configuration File",
"INF": "Information File",
"LIB": "Library File",
"DRV": "Device Driver File",
"SYS": "System Configuration File",
"VXD": "Virtual Device Driver File",
"DMP": "Dump File",
"BAK": "Backup File",
"NFO": "Information File",
"REG": "Registry File",
"BIN": "Binary File",
"PRX": "Plugin File",
"DAT": "Data File",
"PNF": "Precompiled Setup Information File",
"ICO": "Icon File",
"OVL": "Overlay File",
"MUI": "Multilingual User Interface File",
"SFC": "System File Checker File",
"BCD": "Boot Configuration Data File",
"NLS": "National Language Support File",
"WIM": "Windows Imaging Format File",
"NT": "Windows NT File",
"NTFS": "NTFS File System",
"NTUSER": "NT User Data File",
"PF": "Page File",
"LOG": "Log File",
"SAM": "Security Account Manager File",
"TMP": "Temporary File",
"SYS": "System Recovery File",
"GZ": "Compressed File Archive",
"P7M": "Digitally Encrypted Message File",
"ROM": "Read-Only Memory Image File",
"EFI": "Extensible Firmware Interface File",
"BOOT": "Boot Sector File",
"KEY": "Security Key File",
"PRF": "Outlook Profile File",
"CAT": "Security Catalog File",
"MBR": "Master Boot Record",
"VHDX": "Hyper-V Virtual Hard Disk File",
"OST": "Outlook Offline Data File",
"DLL": "Control Panel Extension File",
"TTF": "TrueType Font File",
"CUR": "Cursor Image File",
"SYS": "Kernel System File",
# ADOBE FILE EXTENSIONS
"PSD": "Adobe Photoshop Document",
"PSB": "Adobe Photoshop Big Document",
"TIFF": "Tagged Image File Format",
"JPEG": "Joint Photographic Experts Group",
"PNG": "Portable Network Graphics",
"GIF": "Graphics Interchange Format",
"PDF": "Portable Document Format",
"AI": "Adobe Illustrator File",
"SVG": "Scalable Vector Graphics",
"EPS": "Encapsulated PostScript",
"INDD": "Adobe InDesign Document",
"IDML": "Adobe InDesign Markup Language File",
"PRPROJ": "Adobe Premiere Pro Project File",
"MP4": "MPEG-4 Video File",
"MOV": "QuickTime Movie",
"AVI": "Audio Video Interleave",
"MXF": "Material Exchange Format",
"AEP": "Adobe After Effects Project File",
"AEPX": "Adobe After Effects XML Project File",
"AET": "Adobe After Effects Project Template",
"XD": "Adobe XD Document",
"WAV": "Waveform Audio File Format",
"MP3": "MPEG Audio Layer 3",
"AIFF": "Audio Interchange File Format",
"FLAC": "Free Lossless Audio Codec",
# MSOFFICE/OFFICE 365 FILE EXTENSIONS
"DOC": "Word Document",
"DOCX": "Word Open XML Document",
"DOT": "Word Document Template",
"DOTX": "Word Open XML Document Template",
"RTF": "Rich Text Format",
"XLS": "Excel Spreadsheet (Legacy)",
"XLSX": "Excel Open XML Spreadsheet",
"XLSM": "Excel Open XML Macro-Enabled Spreadsheet",
"XLSB": "Excel Binary Spreadsheet",
"CSV": "Comma-Separated Values",
"PPT": "PowerPoint Presentation (Legacy)",
"PPTX": "PowerPoint Open XML Presentation",
"PPS": "PowerPoint Slide Show (Legacy)",
"PPSX": "PowerPoint Open XML Slide Show",
"POT": "PowerPoint Template (Legacy)",
"POTX": "PowerPoint Open XML Template",
"ACCDB": "Access Database (2007 or later)",
"MDB": "Access Database (Legacy)",
"PST": "Outlook Data File (Personal Storage Table)",
"OST": "Outlook Offline Data File",
"PUB": "Publisher Document",
"ONE": "OneNote Document"
}
# this tuple to be used in the programs
tuple_fileformats = (
".3ga",
".3gp",
".aac",
".ac3",
".accdb",
".adpcm",
".adx",
".aep",
".aepx",
".aet",
".ai",
".aifc",
".aiff",
".aiff:c",
".alac",
".amr",
".amr:nb",
".amr:wb",
".amv",
".ape",
".apk",
".app",
".arr",
".asf",
".asm",
".asp",
".aspx",
".atrac",
".au",
".au",
".avi",
".avi",
".bak",
".bat",
".bcd",
".bin",
".bmp",
".boot",
".c",
".caf",
".cat",
".cfg",
".cmd",
".cpp",
".css",
".csv",
".cur",
".dat",
".dll",
".dmg",
".dmp",
".doc",
".doc",
".docx",
".docx",
".dot",
".dotx",
".drv",
".dsd",
".dts",
".eac3",
".efi",
".eps",
".epub",
".exe",
".f4v",
".f90",
".f95",
".flac",
".flv",
".gif",
".gif",
".go",
".gsm",
".gz",
".h",
".heic",
".heif",
".hta",
".html",
".ico",
".ico",
".ico",
".idml",
".iff",
".indd",
".inf",
".ini",
".ipa",
".ircam",
".iso",
".it",
".jar",
".java",
".jp2",
".jpeg",
".jpg",
".js",
".json",
".jsp",
".kar",
".key",
".lib",
".log",
".lua",
".m4a",
".m4v",
".md",
".markdown",
".matlab",
".mbr",
".mdb",
".mid",
".midi",
".mka",
".mkv",
".mod",
".mov",
".mov",
".mp1",
".mp2",
".mp3",
".mp4",
".mp4",
".mpc",
".mpc8",
".mpg",
".mpga",
".mpp",
".msi",
".mtm",
".mts",
".mui",
".mxf",
".mxf",
".nfo",
".nls",
".nsf",
".nt",
".ntfs",
".ntuser",
".octave",
".ofr",
".ogg",
".ogg",
".one",
".opus",
".ost",
".ovl",
".p7m",
".paf",
".pbm",
".pdf",
".pdf",
".perl",
".pf",
".pgm",
".php",
".pl",
".plsql",
".pnf",
".png",
".png",
".pot",
".potx",
".ppm",
".pps",
".ppsx",
".ppt",
".pptx",
".prf",
".prproj",
".prx",
".ps1",
".psb",
".psd",
".pst",
".pub",
".pvf",
".py",
".pyc",
".r",
".ra",
".raw",
".rb",
".reg",
".riff",
".rm",
".rmi",
".rns",
".rom",
".rtf",
".ruby",
".s3m",
".s3z",
".sam",
".scala",
".sd2",
".sds",
".sfc",
".sh",
".sid",
".snd",
".snd",
".spc",
".spx",
".svg",
".svg",
".swf",
".swf",
".swift",
".sys",
".tiff",
".tiff",
".tmp",
".ts",
".ts",
".tta",
".ttf",
".txt",
".vb",
".vbs",
".vbscript",
".vhdx",
".vob",
".voc",
".vqf",
".vxd",
".w64",
".wav",
".wavpack",
".wbmp",
".webm",
".webp",
".webp",
".wim",
".wma",
".wmv",
".wv",
".wve",
".wvx",
".xbm",
".xd",
".xls",
".xlsb",
".xlsm",
".xlsx",
".xm",
".xml",
)