Skip to content

Commit

Permalink
📝 docs: added json arg type docs
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
  • Loading branch information
mhkarimi1383 committed Sep 10, 2024
1 parent 432a48c commit 31e7623
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/tutorial/parameter-types/json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# JSON

To use JSON inputs use `dict` as Argument type

it will do something like

```python
import json

data = json.loads(user_input)
```

## Usage

You will get all the correct editor support, attributes, methods, etc for the dict object:`

//// tab | Python 3.7+

```Python hl_lines="5"
{!> ../docs_src/parameter_types/json/tutorial001.py!}
```

////

Check it:

<div class="termy">

```console
// Run your program
$ python main.py --user-info '{"name": "Camila", "age": 15, "height_meters": 1.7, "female": true}'

User Info: {"name": "Camila", "age": 15, "height_meters": 1.7, "female": true}

```

</div>

0 comments on commit 31e7623

Please sign in to comment.