Skip to content

Commit

Permalink
use yaml output
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Sep 5, 2023
1 parent 12a5e84 commit 17d40c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion duck/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
from PIL import Image
import io
import json
import yaml

def display_image(base64_image):
img_data = base64.b64decode(base64_image)
img = Image.open(io.BytesIO(img_data))
return '<img src="data:image/png;base64,{}" width="200"/>'.format(base64_image)

def display_json(data):
content = json.dumps(data, indent=4)
content = yaml.dump(data, default_flow_style=True, indent=2)
return f"<pre>{content}</pre>"

def query():
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ dependencies:
- rdflib-sqlalchemy
- sqlalchemy<2
- pandas
- pyyaml
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ rdflib
rdflib-sqlalchemy
sqlalchemy<2
pandas
pyyaml

0 comments on commit 17d40c1

Please sign in to comment.