Skip to main content

alt text

A Python extension for parsing the MFT on Windows 10 / Windows 11. Returns a list of tuples for all active entries on the volume. This can be used to find new or modified files efficiently as its not necessary to walk the file system.

Requires administrator privileges.

Changes

1.8.1

  • Added DumpMft and CreateCsv
  • Fixed issue with filesize being 0 if unnamed 0x80 not in base record (re: chichimainya-del)

1.7.1

  • Added second example

For full history see the CHANGELOG.

Install

pip install mftparser

Parameters

  • drive — drive letter e.g. "C:" (default "C:")
  • only_active — if False, return all entries (default True)
  • microseconds — if True, return timestamps as epoch microseconds (default False, returns NTFS ticks)
  • cutoff — takes timestamp format "2026-05-10T07:33:12" or "2026-05-10 07:33:12" in system time. return entries only from that time onward

Functions

results = mftparser.ScanVolume("C:", only_active=True, microseconds=False)

returns tuple with 20 fields per entry

recno, sequence_num, frn, parent_frn, parent_recno, parent_sequence, in_use, path, name, size, hardlinks, is_dir, is_hardlink, has_ads, file_attribs, mod_time, creation_time, mft_mod, access_time, last_usn = results

or

(
recno, sequence_num, frn, parent_frn, parent_recno,
parent_sequence, in_use, path, name, size, hardlinks,
is_dir, is_hardlink, has_ads, file_attribs, mod_time,
creation_time, mft_mod, access_time, last_usn
) = results

output_path = mftparser.CreateCsv("C:", output="C:\\file.csv")

input required can be drive or raw mft file. if output is not specified output to pwd. returns the result path.

output_path = mftparser.DumpMft("C:", output="C:\\mft.raw")

input takes the drive and default is C: if not specified. output returns result path.

mftparser.ntfs_to_us(ts)

ntfs ticks to epoch microseconds

mftparser.ntfs_to_ns(ts)

ntfs ticks to epoch nanoseconds

recno, seq = mftparser.frn_to_entry(frn)

file reference number to record number and sequence

frn = mftparser.entry_to_frn(recno, seq)

record number and sequence to a file reference number

Example

results = mftparser.ScanVolume()
print(len(results))
for entry in results:
    is_dir = entry[9]
    if is_dir:
        continue
    ...
dirs = {}
fc = []
for entry in results:
    recno, sequence_num, frn, parent_frn, parent_recno, parent_sequence, in_use, path, name, size, hardlinks, is_dir, is_hardlink, has_ads, file_attribs, mod_time, creation_time, mft_mod, access_time, last_usn = entry
    if is_dir:
        dirs[frn] = {
            "parent": parent_frn,
            "name": name,
            "path": path
        }
    else:
        fc.append((recno, sequence_num, in_use, parent_recno, parent_sequence, path, name, size, hardlinks, has_ads, file_attribs, creation_time, mod_time, mft_mod, access_time, last_usn))

Metadata

Release files for mftparser 1.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mftparser 1.8.1
File Interpreter ABI Platform Actions
mftparser-1.8.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for mftparser-1.8.1-cp39-abi3-win_amd64.whl

Release files / mftparser-1.8.1-cp39-abi3-win_amd64.whl

Download URL mftparser-1.8.1-cp39-abi3-win_amd64.whl
Size 20.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7f14bb859b6cce2a2cf0a0a7e1f94004920b0192687296d6847fc505e27f8eb1
BLAKE2b-256 checksum
How to use checksums
45467b171d85ad74f96b307d91dc9fcfb96504213cde42ad0818abc70a7022fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for mftparser 1.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page