Skip to main content

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

# 
# print helpers
# 
if 1:
    # settings
    print.indent.string = "    "
    
    # recursively indents function calls
    @print.indent.function 
    def my_func(counter=5):
        if counter <= 0: return
        print(f"function call {counter} start")
        my_func(counter-1)
        print(f"function call {counter} done")
    
    
    my_func()
    
    #    function call 5 start
    #        function call 4 start
    #            function call 3 start
    #                function call 2 start
    #                    function call 1 start
    #                    function call 1 done
    #                function call 2 done
    #            function call 3 done
    #        function call 4 done
    #    function call 5 done
    
    
    # simple indent
    with print.indent:
        print("howdy1")
        with print.indent:
            print("howdy2")
        print("howdy3")
    
    #    howdy1
    #        howdy2
    #    howdy3
    
    # also indents stuff from the function
    with print.indent.block("stuff"):
        print("hi")
        my_func()
    
    # stuff
    #     hi
    #        function call 5 start
    #            function call 4 start
    #                function call 3 start
    #                    function call 2 start
    #                        function call 1 start
    #                        function call 1 done
    #                    function call 2 done
    #                function call 3 done
    #            function call 4 done
    #        function call 5 done

# 
# to_pure()
# 
if 1:
    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
# 
if 1:
    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),
    # )

# 
# plain object
# 
if 1:
    a = Object(thing=10)
    a.thing # 10
    a.thing = 99
    a.thing # 99

Metadata

Release files for blissful-basics 0.2.37

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blissful-basics 0.2.37
File Size Uploaded Provenance Actions
blissful_basics-0.2.37.tar.gz 3.5 MB Without provenance Details for blissful_basics-0.2.37.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for blissful-basics 0.2.37
File Interpreter ABI Platform Actions
blissful_basics-0.2.37-py3-none-any.whl Python 3 none any Details for blissful_basics-0.2.37-py3-none-any.whl

Total release size: 7.0 MB

Release files / blissful_basics-0.2.37.tar.gz

Download URL blissful_basics-0.2.37.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
4d951df5e23151c7c26f9d540670dcd58f29e667a1363e23b40337ff6b2015a6
BLAKE2b-256 checksum
How to use checksums
cc15dfbf414fb6d1456c779c87791aa5457fa34c78a88eb221faf3450f6ca621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/6.7.0 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.8.13

Release files / blissful_basics-0.2.37-py3-none-any.whl

Download URL blissful_basics-0.2.37-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
83834e9b1e487c3bdab49c5ce7d47428a69d6b5953acdacd28f8db3bbcd83ada
BLAKE2b-256 checksum
How to use checksums
ac5497ad3e399cc5add0155a43dc4c108cdce1170e90fa03be695aee2bbd28f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/6.7.0 pkginfo/1.9.6 requests/2.31.0 requests-toolbelt/1.0.0 tqdm/4.65.0 CPython/3.8.13

Security for blissful-basics 0.2.37

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.37 This release

2 release files No provenance

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