Skip to main content

picklecachefunc

picklecachefunc is a Python decorator to cache function outputs to files using pickle.

Installation

pip install picklecachefunc

Example usage

from picklecachefunc import picklecachefunc

@picklecachefunc(arg_name='file_name')
def compute_expensive_function(file_name, x, y):
    return x + y

result1 = compute_expensive_function(file_name='result1.pkl', x=3, y=4)
print(result1)

result2 = compute_expensive_function(file_name='result2.pkl', x=5, y=6)
print(result2)

License

MIT License

Copyright (c) 2024 Seong Joon Oh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for picklecachefunc 0.6.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 picklecachefunc 0.6.0
File Size Uploaded
picklecachefunc-0.6.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for picklecachefunc 0.6.0
File Interpreter ABI Platform
picklecachefunc-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.5 kB

Release files / picklecachefunc-0.6.0.tar.gz

Download URL picklecachefunc-0.6.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ec4d13ddcc7a06cf70eac6d2172a0d95b834b0a69b7b3681dbbc71aaa87c8ac1
BLAKE2b-256 checksum
How to use checksums
c2ec4b2f9cdf495e6cd47d94def5bff4a67f2a91816e41e5774985cabaac5371
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.17

Release files / picklecachefunc-0.6.0-py3-none-any.whl

Download URL picklecachefunc-0.6.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
537bbec3ddd5e6db268bed22e85bcd3537c91493650113a9297cd2c073a04f94
BLAKE2b-256 checksum
How to use checksums
0df79cb3c54d80b0c98bb83b62bedaedbb9510942b019a8039178bcd69c27262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.17

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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