Skip to content

Commit

Permalink
update version
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhsingh971 committed Sep 13, 2023
2 parents 8728956 + 4a554a5 commit eab156e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyutils"
version = "0.0.1a1"
version = "0.0.1a2"
description = "collection of python utility functions"
authors = ["Rishabh Singh <rishabhsingh971@gmail.com>"]
readme = "README.md"
Expand Down
5 changes: 5 additions & 0 deletions pyutils/csvu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def save_csv(file_path, rows, mode, fieldnames=None):
return
if isinstance(rows, dict):
rows = list(rows.values())
if isinstance(rows, dict) and fieldnames is None:
fields = set()
for key in rows:
fields.add(key)
fieldnames = list(fields)
write_header = False
if not os.path.exists(file_path) or mode == "w":
parent_dir = os.path.dirname(file_path)
Expand Down

0 comments on commit eab156e

Please sign in to comment.