Save & restore Python interpreter sessions — an R-style snapshotter powered by dill.
Project description
sessionstash
Save & restore your Python interpreter workspace in one command - an R-style snapshotter powered by
dill.
✨ Key Features
- One-liner snapshot & restore of the current interpreter via
dill - Skips heavyweight / un-pickleable objects by default (customisable)
- CLI included -
python -m sessionstash save|load - Pure-Python implementation; only runtime dependency is
dill
📦 Installation
pip install sessionstash
(For development: pip install -e .[dev])
🚀 Quick Start
import sessionstash as ss
counter = 42
message = "Hello, workspace!"
ss.save_workspace("snapshot.dill") # Save everything
del counter, message
ss.load_workspace("snapshot.dill") # Restore
print(counter, message) # 42 Hello, workspace!
CLI usage
# Save the current session
python -m sessionstash save my_session.dill
# Load it back and drop into an IPython shell
python -m sessionstash load my_session.dill --shell
🛠️ Public API
| Function | Description | Signature |
|---|---|---|
save_workspace |
Serialize a namespace (default globals()) to disk |
save_workspace(path, namespace=None) |
load_workspace |
Inject a serialized namespace back into the current one | load_workspace(path, namespace=None) |
🔒 Security Notice
A dill/pickle file can execute arbitrary code when loaded.
Never run load_workspace() on data from an untrusted source.
🗺️ Roadmap
- Optional encryption / signature verification
- Size & timing report for each stored object
- VS Code / IPython extensions for automatic snapshots
🤝 Contributing
- Clone:
git clone https://github.com/<yourname>/sessionstash - Install dev deps:
pip install -e .[dev] - Open a pull request - issues and PRs are welcome!
📄 License
sessionstash is released under the MIT License © 2025 Jiwoong Kim.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sessionstash-0.1.1.tar.gz.
File metadata
- Download URL: sessionstash-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
568c073aa5d79885da90c44527645c7b10f3d6e49f721e18c22d6302db62581d
|
|
| MD5 |
6e06a728eb0670225679db3450cdf341
|
|
| BLAKE2b-256 |
9c0fe28feef9e4132eb0a68ef2bc3f7f32be3981431459f08760d9918048fe7a
|
File details
Details for the file sessionstash-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sessionstash-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c07ea12cd3100e51a2be4ace074c9fb8239f3903b2f91cca7f6b941a9389151
|
|
| MD5 |
a7dc4b9b88f74863977e82b0d7a71935
|
|
| BLAKE2b-256 |
9078ed1cb2155358f7206e686fdf418a0a439aa7d1868028eba80eee4d1e58dc
|