In [1]:
def func(arg1, arg2, arg3):
    print(arg1)
    print(arg2)
    print(arg3)

In [2]:
d = {'arg1': 'one', 'arg2': 'two', 'arg3': 'three'}

In [3]:
func(**d)


one
two
three

In [4]:
func(**{'arg1': 'one', 'arg2': 'two', 'arg3': 'three'})


one
two
three

In [5]:
# func(**{'arg1': 'one', 'arg2': 'two'})
# TypeError: func() missing 1 required positional argument: 'arg3'

In [6]:
# func(**{'arg1': 'one', 'arg2': 'two', 'arg3': 'three', 'arg4': 'four'})
# TypeError: func() got an unexpected keyword argument 'arg4'

In [7]:
def func_default(arg1=1, arg2=2, arg3=3):
    print(arg1)
    print(arg2)
    print(arg3)

In [8]:
func_default(**{'arg1': 'one'})


one
2
3

In [9]:
func_default(**{'arg2': 'two', 'arg3': 'three'})


1
two
three

In [10]:
# func_default(**{'arg1': 'one', 'arg4': 'four'})
# TypeError: func_default() got an unexpected keyword argument 'arg4'

In [11]:
def func_kwargs(arg1, **kwargs):
    print('arg1', arg1)
    for k, v in kwargs.items():
        print(k, v)

In [12]:
func_kwargs(**{'arg1': 'one', 'arg2': 'two', 'arg3': 'three'})


arg1 one
arg2 two
arg3 three

In [13]:
func_kwargs(**{'arg1': 'one', 'arg2': 'two', 'arg3': 'three', 'arg4': 'four'})


arg1 one
arg2 two
arg3 three
arg4 four

In [14]:
func_kwargs(**{'arg1': 'one', 'arg3': 'three'})


arg1 one
arg3 three