Skip to content

Commit

Permalink
better example
Browse files Browse the repository at this point in the history
  • Loading branch information
jplacht committed Oct 30, 2023
1 parent 80e7279 commit ec17f82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@ fio = FIO()

material = fio.Material.get("DW")
print(material)
print(material.model_dump_json())
```

This will print the material information of Drinking Water:
This will print the material information of Drinking Water as MaterialModel and it's JSON.
```python
MaterialId='4fca6f5b5e6c3b8a1b887c6dc99db146' CategoryName='consumables (basic)' CategoryId='3f047ec3043bdd795fd7272d6be98799' Name='drinkingWater' Ticker='DW' Weight=0.10000000149011612 Volume=0.10000000149011612 UserNameSubmitted='SAGANAKI' Timestamp=datetime.datetime(2023, 10, 28, 19, 26, 21, 831707)
```

```json
{
"MaterialId": "4fca6f5b5e6c3b8a1b887c6dc99db146",
"CategoryName": "consumables (basic)",
"CategoryId": "3f047ec3043bdd795fd7272d6be98799",
"Name": "drinkingWater",
"Ticker": "DW",
"Weight": 0.10000000149011612,
"Volume": 0.10000000149011612,
"UserNameSubmitted": "SAGANAKI",
"Timestamp": "2023-10-28T19:26:21.831707"
}
```

# Tests

**pyfio** uses pytest, requests_mock and pytest-cov to run tests, mock calls towards FIO endpoints and generate the code coverage report.
Expand Down
1 change: 1 addition & 0 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

material = fio.Material.get("DW")
print(material)
print(material.model_dump_json())

0 comments on commit ec17f82

Please sign in to comment.