Skip to main content

pickle工具

1.如何安装

pip install pickle_tool

2.该包包含的方法

save_to_pickle

装饰器,若被装饰的函数有返回值,在该函数外层加上该装饰器,则会将函数的返回对象序列化保存到磁盘,下次调用该函数时直接读磁盘的序列化结果 用于节省一些耗时的运算结果保存在本地,以免下次要重复计算

示例:

@save_to_pickle("tmp.pickle", overwrite=False)
def foo():
    return 1

则当下次再运行该函数,会直接读取”tmp.pickle”文件,并返回保存的结果

load_pickle

简化了对pickle的读取操作,不需要再额外使用open()来打开文件

obj = load_pickle("tmp.pickle")

Metadata

Release files for pickle-tool 0.1.0

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

Source distribution (sdist)

Source distribution for pickle-tool 0.1.0
File Size Uploaded
pickle_tool-0.1.0.tar.gz 2.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pickle-tool 0.1.0
File Interpreter ABI Platform
pickle_tool-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.8 kB

Release files / pickle_tool-0.1.0.tar.gz

Download URL pickle_tool-0.1.0.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6b22cdae8187918de27f9871f0b09314bace3754a9a4eb1e2fcfefbf65a17741
BLAKE2b-256 checksum
How to use checksums
c16ecde06be49231430573f1047c41ac94c7f3b3ce7d17b670064ad3f593f872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.5

Release files / pickle_tool-0.1.0-py3-none-any.whl

Download URL pickle_tool-0.1.0-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c264aa7913a6d5045715219015f43476ba30367b0f33fa750585b97f81245746
BLAKE2b-256 checksum
How to use checksums
8d243302d4d4c57b1a023e34455281b38fe920200b1daa2aefe55dad6933428a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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