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.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 18 fields per entry

recno, sequence_num, 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, 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

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, 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
    if is_dir:
        frn = mftparser.entry_to_frn(recno, sequence_num)
        parent_frn = mftparser.entry_to_frn(parent_recno, parent_sequence)
        dirs[frn] = {
            "parent": parent_frn,
            "name": name,
            "path": path
        }
    else:
        fc.append((recno, sequence_num, in_use, parent_recno, parent_squence, path, name, size, hardlinks, has_ads, file_attribs, creation_time, mod_time, mft_mod, access_time)

Metadata

Release files for mftparser 1.7.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.7.1
File Interpreter ABI Platform Actions
mftparser-1.7.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for mftparser-1.7.1-cp39-abi3-win_amd64.whl

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

Download URL mftparser-1.7.1-cp39-abi3-win_amd64.whl
Size 15.5 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
45f80f8e740c7d05b67e51c41759f8fa87c7cf820219ea01d8848e4c9598ceab
BLAKE2b-256 checksum
How to use checksums
bb90304d54e3f82dface1844101e2b8f22650e7bd007f8e2968a3db0339d44b4
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.7.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