lovely pickling🥒 for context manager hater👊
Project description
EZPKL: lovely pickling🥒 for context manager hater👊
English | 한국어
I hate
with open(file_path) as file... and I don't want to google how to save pickle in python anymore.
then, i made it.
Installation
Use the package manager pip to install ezpkl.
pip install ezpkl
Usage
Save Object to pkl
from ezpkl import save_pkl
a = [1, 2, 3, 4, 5]
# 'a.pkl' will be saved in the current directory.
save_pkl(var=a)
# 'a_list_temp.pkl' will be saved in the current directory.
save_pkl(var=a, file_name='a_list_temp')
Load Object
from ezpkl import load_pkl
a = load_pkl('a.pkl')
Save Object to txt
from ezpkl import save_txt
a = [1, 2, 3, 4, 5]
# 'a.txt' will be saved in the current directory.
save_txt(data=a)
# 'a_list_temp.txt' will be saved in the current directory.
save_txt(data=a, file_name='a_list_temp')
Load Object
from ezpkl import load_txt
a = load_txt('a.txt')
Save List Object to txt with separator
from ezpkl import save_txt
a = ["apple", "banana", "cherry"]
# 'a.txt' will be saved in the current directory with newline separator (default).
save_txt(data=a)
# a.txt file content:
# apple
# banana
# cherry
# 'a_list_temp.txt' will be saved in the current directory with space separator.
save_txt(data=a, file_name='a_list_temp', separator=' ')
# a_list_temp.txt file content:
# apple banana cherry
# 'a_list_temp.txt' will be saved in the current directory without separator.
save_txt(data=a, file_name='a_list_temp', separator=None)
# a_list_temp.txt file content:
# applebananacherry
License
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
ezpkl-0.2.0.tar.gz
(4.6 kB
view details)
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
ezpkl-0.2.0-py3-none-any.whl
(6.2 kB
view details)
File details
Details for the file ezpkl-0.2.0.tar.gz.
File metadata
- Download URL: ezpkl-0.2.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed50b84846ab48fc7f84496917d7f84205e8782030a19d965a7e4c2985ffc6ae
|
|
| MD5 |
9501820a2adec88b7487f55b52f5d682
|
|
| BLAKE2b-256 |
ca69365df678ee53049b31edbe99ea3145ed4cf26a65dad14bfff1296f91176e
|
File details
Details for the file ezpkl-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ezpkl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9614e3c6f3596d30f4c9a1583ebaafa3949bed7154f85bb4aeaca73068bbc19c
|
|
| MD5 |
f849ff3babb5edcd3ebbd3e1ce7e5da6
|
|
| BLAKE2b-256 |
a770bc055c8d2846a5bb3af2a2c1ac82e818270bb996768f467193c2ea21482b
|