-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (23 loc) · 1.23 KB
/
main.py
File metadata and controls
31 lines (23 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from scripts.create_trello_card import create_card, create_checklist, create_checklist_item
from scripts.parse_markdown import parse_markdown
def main():
print("Starting script...")
# Step 1: Parse the markdown file to get the list ID and card details
list_id, cards_details = parse_markdown('markdown_files/xml.md')
# Step 2: Loop through each card's details and create cards and checklists on Trello
for card_details in cards_details:
card_title = card_details['title']
card_description = card_details['description']
# Step 2.1: Create a card on Trello
response = create_card(list_id, card_title, card_description)
card_id = response['id']
for checklist in card_details['checklists']:
checklist_name = checklist['title']
checklist_response = create_checklist(card_id, checklist_name)
checklist_id = checklist_response['id'] # Get the ID of the created checklist
# Loop through checklist['items'] to add each item to the checklist
for item in checklist['items']:
create_checklist_item(checklist_id, item)
print("Cards and checklists created successfully.")
if __name__ == "__main__":
main()