Tools I need in every python project
Project description
What is this?
The tools I find myself copying and pasting between every python project.
How do I use this?
pip install blissful_basics
from blissful_basics import print, flatten, to_pure, stringify, stats, product, countdown, large_pickle_save, large_pickle_load, FS, Object
# how you'd expect it
with print.indent:
print("howdy1")
with print.indent:
print("howdy2")
print("howdy3")
# recursively indent's function calls
@print.indent.function
def my_func():
print("this will be indented")
import numpy
import torch
to_pure(numpy.array([1,2,3,4,5])) # [1,2,3,4,5]
to_pure(torch.tensor([1,2,3,4,5])) # [1,2,3,4,5] # even if its on a GPU device
stats([1,2,3,4,5])
# Object(
# max = 5,
# min = 1,
# range = 4,
# count = 5,
# sum = 15,
# average = 3.0,
# stdev = 1.5811388300841898,
# median = 3,
# q1 = 1.5,
# q3 = 4.5,
# normalized = (0.0, 0.25, 0.5, 0.75, 1.0),
# )
a = Object(thing=10)
a.thing # 10
a.thing = 99
a.thing # 99
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
blissful_basics-0.1.0.tar.gz
(7.4 kB
view hashes)
Built Distribution
Close
Hashes for blissful_basics-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b727e787d405aef861df702f6c79621bc4e1f733b691d4572bfece1f255985aa |
|
MD5 | 8f1d3773314136689cb1d040c46cb333 |
|
BLAKE2b-256 | 1dd521c977c217f2aebf95e75e524e69895a9dd9c2ade83fb3ccdc3df8ab0f71 |