Skip to content

Julia's `@exfiltrate` for Python; Exports the local variables into a global dictionary for later debugging.

License

Notifications You must be signed in to change notification settings

NightMachinery/PyExfiltrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyExfiltrator

Julia’s @exfiltrate for Python; Exports the local variables into a global dictionary for later debugging.

Installation

pip install pyexfiltrator

Or install the latest master:

pip install -U 'git+https://github.com/NightMachinary/PyExfiltrator'

Usage

from pyexfiltrator import exfiltrate, exfiltrated
from icecream import ic # prints its input

global_var_1 = "Hi"
global_var_2 = "ice"

def test_fn(arg1=8, arg2=['a', 'b']):
    print("test_fn started")

    global global_var_1
    local_var_1 = (1,2,3)

    ic(exfiltrate())

    print("test_fn finished")

def test_fn2(arg1=3, arg3='monkey'):
    print("test_fn2 started")

    local_var_2 = None

    ic(exfiltrate())

    print("test_fn2 finished")

test_fn(arg1=10)
ic(exfiltrated)
test_fn2()
ic(exfiltrated)
>>> test_fn started
ic| exfiltrate(): {'arg1': 10, 'arg2': ['a', 'b'], 'local_var_1': (1, 2, 3)}
test_fn finished
ic| exfiltrated: {'arg1': 10, 'arg2': ['a', 'b'], 'local_var_1': (1, 2, 3)}
test_fn2 started
ic| exfiltrate(): {'arg1': 3, 'arg3': 'monkey', 'local_var_2': None}
test_fn2 finished
ic| exfiltrated: {'arg1': 3,
                  'arg2': ['a', 'b'],
                  'arg3': 'monkey',
                  'local_var_1': (1, 2, 3),
                  'local_var_2': None}

License

The MIT License

About

Julia's `@exfiltrate` for Python; Exports the local variables into a global dictionary for later debugging.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages