semvec/pypi-packages huggingface dataset:
chocolate 0.0.2
An improvement to Python's kwargs
Requires Python: >=3.6

# Chocolate

**Chocolate** is a Python package that improves Python's `**kwargs`.

```python
from chocolate import filter_args


# Here is some function.
def example_function(arg1, arg2: int, arg3=3, arg4: str = ""):
    print(f"{arg1} {arg2} {arg3} {arg4}")

# We can give this function a dictionary of arguments using **kwargs.
kwargs = {"arg1": 1, "arg2": 2, "arg4": "4"}
example_function(**kwargs)

# But what if the **kwargs dictionary has additional keys?
broken_kwargs = {"arg1": "This", "arg2": "does", "undefined_arg": "not", "arg3": "work"}
try:
    example_function(**broken_kwargs)
except Exception as exception:
    print(exception)

# Chocolate can take care of that!
example_function(**filter_args(broken_kwargs, example_function))
```
moduleknife 0.2.1
-

moduleknife
========================================

.. code-block:: console

  $ moduelgraph 02dump_json.py
  {
     "age": 20,
     "name": "foo"
  }
  digraph g {
      g0 [label="json"]
      g1 [label="json.encoder"]
      g2 [label="json.decoder"]
      g3 [label="argparse"]
      g4 [label="copy"]
      g5 [label="gettext"]
      g6 [label="textwrap"]
      g7 [label="json.scanner"]
      g8 [label="02dump_json"]
      g9 [label="locale"]
      g10 [label="struct"]
      g0 -> g1
      g0 -> g2
      g3 -> g4
      g3 -> g5
      g3 -> g6
      g2 -> g7
      g8 -> g0
      g8 -> g3
      g5 -> g9
      g5 -> g10
  }
  $ moduelgraph 02dump_json.py --outfile=02dump_json.dot
  {
    "age": 20,
    "name": "foo"
  }
  write 02dump_json.dot...
  $ moduelgraph 02dump_json.py --driver=ToplevelOnlyDriver --outfile=02dump_json2.dot
  {
    "age": 20,
    "name": "foo"
  }
  write 02dump_json2.dot...


02dump_json.py

.. code-block:: python

  import json
  import sys
  import argparse


  def main():
      parser = argparse.ArgumentParser()
      parser.add_argument("--name", default="foo")

      args = parser.parse_args()

      person = {"name": args.name, "age": 20}
      json.dump(person, sys.stdout, indent=2)


  if __name__ == "__main__":
      main()
  else:
      print("hmm")


`02dump_json.svg <./misc/readme.svg>`_
`02dump_json2.svg <./misc/readme2.svg>`_


0.2.0

- modulegraph, add --browse option
- modulegraph, fix bug that modulegraph's __file__ is used when calling as main