Skip to main content

Lazier workflow for Jupyter

Project description

lazier

lazier allows you to move faster when you are exploring how functions change with their input, this module was written because I often felt that there had to be an easier way to work in a interactive enviroment with jupyter notebooks.

Here is a demonstration: Without lazier:

def foo(a,b,c,d):
    print(a)
    print(b)
    print(c)
    print(d)
foo(a=1,b= 2, c=3, d=4)
1
2
3
4
foo(d=2)
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-3-9233fe4ac2c5> in <module>()
----> 1 foo(d=2)


TypeError: foo() missing 3 required positional arguments: 'a', 'b', and 'c'

with lazier:

from lazier import lazier
@lazier
def foo(a,b,c,d):
    print(a)
    print(b)
    print(c)
    print(d)
foo(a=1,b= 2, c=3, d=4)
1
2
3
4

Now suppose you want to see how the output of the function changed if d was 7 in the above function call, with lazier it looks like:

foo(d=7)
1
2
3
7

and so on.

foo(a=9)
9
2
3
7

using reset you can forget all past values that it remebers

foo.reset()
foo()
foo() missing 4 required positional arguments: 'a', 'b', 'c', and 'd'
foo(a=1, b=11, c=3)
foo() missing 1 required positional argument: 'd'
foo(d=9)
1
11
3
9

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lazier, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size lazier-0.0.1-py3-none-any.whl (2.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lazier-0.0.1.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page