Pickle Viewer & PKL Viewer (No Python)

Pickle Viewer & PKL Viewer (No Python), a VS Code extension by Zovo

Open Python .pkl, .pickle and .p files in VS Code without Python, and see what a pickle would do before you load it.

Install in VS CodeOpen the Marketplace page

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.zovo-pickle-viewer, version 0.1.4.

PKL Viewer showing a pickle as a tree with types, a custom class placeholder and the "Opened without Python" header

Screenshot of VS Code 1.142 with a sample made by scripts/make_samples.py.

Quick start

  1. Install PKL Viewer & Pickle Viewer.
  2. Click a .pkl or .pickle file in the Explorer. For a .p file, right-click it and pick Open in PKL Viewer.

Questions people ask

Is Pickle Viewer & PKL Viewer (No Python) free?

Yes. Pickle Viewer & PKL Viewer (No Python) is free and MIT licensed.

How do I install Pickle Viewer & PKL Viewer (No Python)?

Click "Install in VS Code" above, or search for zovo.zovo-pickle-viewer in the Extensions view.

What you see

TabShows
TreeThe decoded object with types, lengths and values. Dicts keep any key type, tuples stay tuples, and bytes, sets, datetimes and big integers keep their Python type. A class the viewer cannot rebuild shows as a placeholder named module.Class, with the attributes the file stores for it.
ArraysNumPy arrays rebuilt from their bytes when the dtype is a plain number type. It shows the shape, dtype, order, min, max, mean, NaN count, a heatmap for 2-D and larger arrays, and a grid of the first values.
Tablespandas DataFrames as a table, with column dtypes and the index, when the column blocks are plain numbers, bools or Python objects. Other column types fall back to the tree with a note.
OpcodesA listing like pickletools.dis, with byte offsets, MARK nesting and a count of each opcode.
SafetyEvery GLOBAL, STACK_GLOBAL, REDUCE and BUILD target, with the byte where it appears and the arguments a call gets.
Safety tab flagging os.system in a pickle

The safety check

pickle.load imports every name in a GLOBAL or STACK_GLOBAL opcode and then calls the REDUCE targets. That is how a model file from the internet can run a shell command. PKL Viewer lists those names and rates each one as the table below shows.

RatingMeaningExamples
RiskyRuns commands or code, or touches files or the networkos.system, subprocess.Popen, builtins.eval, builtins.exec, socket, shutil
CheckHelpers that attacks chain togetherbuiltins.getattr-style helpers, operator.attrgetter, functools.partial
Needs packageA class from a package outside the standard data typesyour own classes, __main__.Model
Data typePlain dataNumPy, pandas, datetime, collections

When a file is risky, a red banner says what it would call, for example os.system('true',), and the viewer opens on the Safety tab. A clean list is not a promise that a file is safe, so only load pickles you trust.

NumPy array with stats and a heatmap
pandas DataFrame shown as a table

Formats

Big files

Decoding runs in a worker thread, so VS Code stays responsive. Files over 512 MB show a message and are not read (setting pickleViewer.maxFileMB, up to 2048). Large containers show their first 1,000 items, the tree stops at 50,000 nodes, tables show the first 1,000 rows and the opcode listing shows the first 20,000 lines. The opcode counts and the safety check always cover the whole file.

Settings

SettingDefaultWhat it does
pickleViewer.maxFileMB512Largest file to decode.
pickleViewer.askForRatingtrueAsk one time for a rating after a few days of use.

Privacy

PKL Viewer works offline. It makes no network calls and sends no telemetry. The webview runs under a strict Content Security Policy, and file text is always inserted as text.

Limits

License

MIT. See THIRD-PARTY-NOTICES.md for the pickleparser notice.

Install Pickle Viewer & PKL Viewer (No Python)

Click the button to open VS Code and install it, or press Ctrl+P (Cmd+P on macOS) in VS Code and run ext install zovo.zovo-pickle-viewer.

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.zovo-pickle-viewer, version 0.1.4.

Source code and issues are on GitHub.

All our VS Code extensions

Support this work

If this extension saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.