Drill-bits: Handy tools for ML in Python
Project description
Install
pip install drill-bits
Examples
All type read & write:
from drill-bits.io import io_utils
data = io_utils.omni_load(file_name)
io_utils.omni_save(file_name, data)
Currently supported extensions including: .npy, .txt, .pkl, .jpg, .png.
Extract digit information from str:
from drill_bits.io import str_utils
test_str = 'img1_h102_w103.img'
resolution = str_utils.extract_info(test_str, ['h', 'w'], int)
# resolution will be [102, 103]
A decorator saves you from reprocessing:
import time
from drill_bits.operation import base_operation
def foo(n):
time.sleep(1)
if n == 1:
return 1
else:
return n * foo(n-1)
opt = BaseOperation(path).get_handle(force_run=False, verbose=True)
foo_warp = opt(foo)
print(foo_warp(5)) # it will take 5s to run
print(foo_warp(5)) # it will finish immediately
opt = BaseOperation(path).get_handle(force_run=True, verbose=True)
foo_warp = opt(foo)
print(foo_warp(5)) # it will take 5s to run again
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
drill_bits-0.0.5.tar.gz
(6.8 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
File details
Details for the file drill_bits-0.0.5.tar.gz.
File metadata
- Download URL: drill_bits-0.0.5.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a983566f0c1c5f474825cbab989c50c8f16aafd67934d10a519b0f750dd970d
|
|
| MD5 |
dfe75e46ddbd1228cb8fcf63afd792cf
|
|
| BLAKE2b-256 |
370e8b80fc9d949bd41f76f81b742c13b8fc153e39ceab4354c733d8e28d9f96
|
File details
Details for the file drill_bits-0.0.5-py3-none-any.whl.
File metadata
- Download URL: drill_bits-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94832a47a3fc12c06581c65703359ec8e1da73d15b38e47e0d031ccd9b82d4c8
|
|
| MD5 |
8ae42dc83242803fcb82a7476df0ddf1
|
|
| BLAKE2b-256 |
04ed653eff28747ee4f92f67a4f50e2e54bf6ebab8961452e9a91b941c7fed3b
|