Install & Compatibility
Where this runs
tested against v0.1.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.046s · 18.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 1.6s · import 0.045s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
analyze_pickle
✓ from fickling import analysis
✗ from fickling.analysis import analyze_pickle
check_safety
✓ from fickling import check_safety
load
✓ from fickling import load
This quickstart demonstrates how to use `fickling.analysis.analyze_pickle` to check both benign and potentially malicious pickle data. It shows how to catch `UnsafeError` and iterate through detected violations.
import pickle
from fickling.analysis import analyze_pickle
from fickling.errors import UnsafeError
# Create a benign pickle (for demonstration)
class MyObject:
def __init__(self, name):
self.name = name
obj = MyObject("safe_data")
benign_pickled_data = pickle.dumps(obj)
# Analyze the pickled data
try:
print("\n--- Analyzing benign pickle ---")
results = analyze_pickle(benign_pickled_data)
if results.is_safe():
print("Pickle is safe. No violations found.")
else:
print("Pickle is potentially unsafe. Violations:")
for violation in results.violations:
print(f"- {violation.severity.name}: {violation.message}")
except UnsafeError as e:
print(f"Analysis detected an unsafe pickle: {e}")
except Exception as e:
print(f"An unexpected error occurred during analysis: {e}")
# Example of a potentially unsafe pickle (e.g., using os.system)
# NOTE: Do NOT run this with untrusted data in production!
# This is purely illustrative of what Fickling detects.
class MaliciousObject:
def __reduce__(self):
return (getattr(os, 'system'), ('echo malicious command executed!',))
import os
malicious_obj = MaliciousObject()
unsafe_pickled_data = pickle.dumps(malicious_obj)
# Analyze the potentially unsafe pickled data
try:
print("\n--- Analyzing potentially unsafe pickle ---")
results = analyze_pickle(unsafe_pickled_data)
if results.is_safe():
print("Pickle is safe. No violations found.")
else:
print("Pickle is potentially unsafe. Violations:")
for violation in results.violations:
print(f"- {violation.severity.name}: {violation.message}")
except UnsafeError as e:
print(f"Analysis detected an unsafe pickle: {e}")
except Exception as e:
print(f"An unexpected error occurred during analysis: {e}")
fickling --version
Upgrade
Version history
0.1.12latest on PyPI · released Jun 26, 2026
Audit
Dependencies
torchoptionalRequired for analyzing PyTorch model pickles.