Skip to main content

基于pickle的拓展工具

Project description

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pickle_tool-0.1.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

pickle_tool-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file pickle_tool-0.1.0.tar.gz.

File metadata

  • Download URL: pickle_tool-0.1.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.5

File hashes

Hashes for pickle_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b22cdae8187918de27f9871f0b09314bace3754a9a4eb1e2fcfefbf65a17741
MD5 6df21458b0534178cbc554da97d8d6ad
BLAKE2b-256 c16ecde06be49231430573f1047c41ac94c7f3b3ce7d17b670064ad3f593f872

See more details on using hashes here.

File details

Details for the file pickle_tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pickle_tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.5

File hashes

Hashes for pickle_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c264aa7913a6d5045715219015f43476ba30367b0f33fa750585b97f81245746
MD5 bdef69d8e276989e73263b4a9b771593
BLAKE2b-256 8d243302d4d4c57b1a023e34455281b38fe920200b1daa2aefe55dad6933428a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page