summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromina xj ix k <romina@sunshinegardens.org>2022-02-25 12:30:39 -0700
committerromina xj ix k <romina@sunshinegardens.org>2022-02-25 12:35:42 -0700
commitf9bab1a90e2c87aad252ee30b04b05a58d36d0d7 (patch)
tree297b14fb36dbb2a8671ab37f09a5b063ea47eb85
parente58b99896d52696cdca7ca341fda73edddb254b0 (diff)
dump ALL issue properties
-rw-r--r--.gitignore1
-rw-r--r--main.py16
2 files changed, 11 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..afed073
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.csv
diff --git a/main.py b/main.py
index 6fce390..58abe95 100644
--- a/main.py
+++ b/main.py
@@ -16,16 +16,17 @@ issues_api_instance = giteapy.IssueApi(giteapy.ApiClient(configuration))
def dump_to_csv(filename, array_of_objects):
- # we need to create list of dicts with custom properties from list of api objects fields
- converted = list(map(lambda x: {'title': x.title}, array_of_objects)) # could be used vars(x) to convert all
-
- # this is just to avoid duplicates
+ """
+ convert api objects
+ """
+ converted = [o.to_dict() for o in array_of_objects]
+ # dedup
array_of_dicts = []
map_info = {}
for conv in converted:
- if conv['title'] not in map_info:
+ if conv['id'] not in map_info:
array_of_dicts.append(conv)
- map_info[conv['title']] = True
+ map_info[conv['id']] = True
keys = array_of_dicts[0].keys()
@@ -37,6 +38,9 @@ def dump_to_csv(filename, array_of_objects):
def fetch_all(**kwargs):
+ """
+ FIXME missing comments
+ """
result = []
page = 1
while True: