Skip to content

Instantly share code, notes, and snippets.

@markcmiller86
markcmiller86 / transferissues.py
Last active September 14, 2021 21:01
Python3 GraphQl cript to transfer issues
# Copyright (c) 2021, Lawrence Livermore National Security, LLC
#
# Python3 script using GraphQL interface to GitHub to transfer
# issues between GitHub repos.
#
# Programmer: Mark C. Miller, Tue Jul 20 10:21:40 PDT 2021
#
import datetime, email.header, glob, mailbox, os, pytz
import re, requests, shutil, sys, textwrap, time
from difflib import SequenceMatcher
@markcmiller86
markcmiller86 / email2discussions.py
Last active August 31, 2021 12:28
Python3 GraphQl script to import an email archive to GitHub discussions (rev 4)
# Copyright (c) 2021, Lawrence Livermore National Security, LLC
#
# Python3 script using GraphQL interface to GitHub discussions to read
# .txt file mbox files of VisIt User's email archive and import each
# email thread as a GitHub discussion.
#
# 1. Reads a directory of .txt files in mbox format for messages (readAllMboxFiles)
# 2. Removes duplicate messages (removeDateAndSubjectDups) which have
# identical dates and highly similar subjects.
# 3. Threads messages using filtered email subjects and date proximity