-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Mertic <[email protected]>
- Loading branch information
Showing
12 changed files
with
355 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright this project and it's contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# encoding=utf8 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright this project and its contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# encoding=utf8 | ||
|
||
import yaml | ||
import argparse | ||
import urllib.request | ||
import urllib.parse | ||
import json | ||
import os | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-o", "--output", help="filename to save output to",default='_data/clomonitor.yaml') | ||
args = parser.parse_args() | ||
|
||
if os.environ.get("LANDSCAPE_URL") != '' and os.environ.get("ARTWORK_URL") != '': | ||
landscapeHostedProjects = '{}/api/projects/all.json'.format(os.environ.get("LANDSCAPE_URL")) | ||
projectEntries = [] | ||
|
||
with urllib.request.urlopen(landscapeHostedProjects) as hostedProjectsResponse: | ||
projectData = json.load(hostedProjectsResponse) | ||
for project in projectData: | ||
if project.get('maturity') == 'emeritus': | ||
continue | ||
print("Processing {}...".format(project.get('name'))) | ||
|
||
# grab correct logo from artwork repo | ||
logo_url = '' | ||
logo_url_dark = '' | ||
if project.get('artwork_url'): | ||
urlparts = urllib.parse.urlparse(project.get('artwork_url')) | ||
with urllib.request.urlopen('{}://{}/assets/data.json'.format(urlparts.scheme,urlparts.netloc)) as artworkResponse: | ||
artworkData = json.load(artworkResponse) | ||
logo_url = '{}://{}{}{}'.format(urlparts.scheme,urlparts.netloc,urlparts.path,artworkData.get(urlparts.path,{}).get('primary_logo')) | ||
logo_url_dark = '{}://{}{}{}'.format(urlparts.scheme,urlparts.netloc,urlparts.path,artworkData.get(urlparts.path,{}).get('dark_logo')) | ||
else: | ||
logo_url = project.get('logo') | ||
logo_url_dark = project.get('logo') | ||
|
||
projectEntry = { | ||
'name': project.get('annotations',{}).get('slug'), | ||
'display_name': project.get('name'), | ||
'description': project.get('description'), | ||
'category': 'Visual Effects and Computer Graphics', | ||
'logo_url': logo_url, | ||
'logo_url_dark': logo_url_dark, | ||
'devstats_url': project.get('dev_stats_url'), | ||
'maturity': project.get('maturity'), | ||
'repositories': [] | ||
} | ||
for repo in project.get('repositories',[]): | ||
projectEntry['repositories'].append({ | ||
'name': repo.get('url').rsplit('/', 1)[-1], | ||
'url': repo.get('url'), | ||
'exclude': ['clomonitor'] | ||
}) | ||
projectEntries.append(projectEntry) | ||
|
||
with open(args.output, 'w') as cloMonitorFileObject: | ||
print("Saving file {}".format(args.output)) | ||
yaml.dump(projectEntries, cloMonitorFileObject, sort_keys=False, indent=2) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright this project and its contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# encoding=utf8 | ||
|
||
import csv | ||
import urllib.request | ||
import json | ||
import os | ||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-o", "--output", help="filename to save output to",default='_data/projects.csv') | ||
args = parser.parse_args() | ||
|
||
if os.environ.get("LANDSCAPE_URL") != '': | ||
landscapeHostedProjects = '{}/api/projects/all.json'.format(os.environ["LANDSCAPE_URL"]) | ||
|
||
csvRows = [] | ||
with urllib.request.urlopen(landscapeHostedProjects) as hostedProjectsResponse: | ||
projectData = json.load(hostedProjectsResponse) | ||
for project in projectData: | ||
categories = [] | ||
categories.append("{category} / {subcategory}".format(category=project.get('category'),subcategory=project.get('subcategory'))) | ||
for additional_category in project.get('additional_categories',{}): | ||
categories.append("{category} / {subcategory}".format(category=additional_category['category'],subcategory=additional_category['subcategory'])) | ||
print("Processing {}...".format(project.get('name'))) | ||
csvRows.append({ | ||
'Name': project.get('name'), | ||
'Level': project.get('maturity'), | ||
'Logo URL': project.get('logo_url'), | ||
'Slug': project.get('annotations',{}).get('slug'), | ||
'Categories': ','.join(categories), | ||
'Website': project.get('homepage_url'), | ||
'Chair': project.get('annotations',{}).get('chair'), | ||
'TAC Representative': project.get('annotations',{}).get('TAC_representative'), | ||
'Documentation': project.get('extra',{}).get('documentation_url'), | ||
'Calendar': project.get('annotations',{}).get('calendar_url'), | ||
'Artwork': project.get('artwork_url'), | ||
'iCal': project.get('annotations',{}).get('ical_url'), | ||
'LFX Insights URL': project.get('dev_stats_url'), | ||
'Accepted Date': project.get('accepted_at'), | ||
'Last Review Date': project.get('extra',{}).get('annual_review_date'), | ||
'Next Review Date': project.get('annotations',{}).get('next_annual_review_date'), | ||
'Slack URL': project.get('slack_url'), | ||
'Chat Channel': project.get('chat_channel'), | ||
'Mailing List': project.get('mailing_list_url'), | ||
'Github Org': project.get('annotations',{}).get('project_org'), | ||
'Best Practices Badge ID': project.get('bestPracticeBadgeId') , | ||
'Primary Github Repo': project.get('repo_url'), | ||
'Contributed By': project.get('annotations',{}).get('contributed_by'), | ||
}) | ||
|
||
with open(args.output, 'w') as projectsCsvFileObject: | ||
print("Saving file {}".format(args.output)) | ||
writer = csv.DictWriter(projectsCsvFileObject, fieldnames = csvRows[0].keys()) | ||
writer.writeheader() | ||
writer.writerows(csvRows) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright this project and its contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# encoding=utf8 | ||
|
||
import sys | ||
import csv | ||
import json | ||
import os | ||
import subprocess | ||
from urllib.parse import urlparse | ||
import argparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-o", "--output", help="filename to save output to",default='_data/tacmembers.csv') | ||
args = parser.parse_args() | ||
|
||
if os.environ.get("TAC_AGENDA_GH_PROJECT_URL") != '': | ||
urlparts = urlparse(os.environ.get("TAC_AGENDA_GH_PROJECT_URL")).path.split('/') | ||
if urlparts and urlparts[1] == 'orgs' and urlparts[3] == 'projects': | ||
command = subprocess.run("gh project item-list {gh_project_id} --owner {gh_org} --format json --limit 100".format(gh_project_id=urlparts[4],gh_org=urlparts[2]), shell=True, capture_output=True) | ||
jsonProjectData = command.stdout | ||
|
||
csvRows = [] | ||
try: | ||
projectData = json.loads(jsonProjectData) | ||
except: | ||
print("Invalid response from gh client: '{}'".format(command.stderr)) | ||
sys.exit(0) | ||
|
||
for item in projectData.get('items',[]): | ||
print("Processing {}...".format(item['content']['title'])) | ||
meetingItem = { | ||
'title': item.get('content',{}).get('title'), | ||
'url': item.get('content',{}).get('url'), | ||
'number': item.get('content',{}).get('number'), | ||
'scheduled_date': item.get('scheduled Date'), | ||
'status': item.get('status'), | ||
'last_review_date': item.get('last Review Date'), | ||
} | ||
if '1-new-project-wg' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '1-new-project-wg' | ||
elif '2-annual-review' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '2-annual-review' | ||
elif '2-annual-review-tac' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '2-annual-review' | ||
elif '2-annual-review-sig' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '2-annual-review-sig' | ||
elif '3-tac-meeting-long' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '3-tac-meeting-long' | ||
elif '4-tac-meeting-short' in item.get('labels',{}): | ||
meetingItem['meeting_label'] = '4-tac-meeting-short' | ||
else: | ||
meetingItem['meeting_label'] = None | ||
csvRows.append(meetingItem) | ||
|
||
with open(args.output, 'w') as csvFileObject: | ||
print("Saving file {}".format(args.output)) | ||
writer = csv.DictWriter(csvFileObject, fieldnames = csvRows[0].keys()) | ||
writer.writeheader() | ||
writer.writerows(csvRows) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright this project and its contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# encoding=utf8 | ||
|
||
import argparse | ||
import csv | ||
import urllib.request | ||
import json | ||
import os | ||
from urllib.parse import urlparse | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-o", "--output", help="filename to save output to",default='_data/tacmembers.csv') | ||
args = parser.parse_args() | ||
|
||
if os.environ.get("LFX_TAC_COMMITTEE_URL") != '': | ||
urlparts = urlparse(os.environ.get("LFX_TAC_COMMITTEE_URL")).path.split('/') | ||
if urlparts and urlparts[1] == 'project' and urlparts[3] == 'collaboration' and urlparts[4] == 'committees': | ||
committeeURL = 'https://api-gw.platform.linuxfoundation.org/project-service/v2/public/projects/{project_id}/committees/{committee_id}/members'.format(project_id=urlparts[2],committee_id=urlparts[5]) | ||
csvRows = [] | ||
|
||
with urllib.request.urlopen(committeeURL) as committeeURLResponse: | ||
committeeURLResponseJSON = json.load(committeeURLResponse) | ||
for committeeMember in committeeURLResponseJSON['Data']: | ||
print("Processing {} {}...".format(committeeMember['FirstName'].title(),committeeMember['LastName'].title())) | ||
csvRows.append({ | ||
'Full Name': "{} {}".format(committeeMember['FirstName'].title(),committeeMember['LastName'].title()), | ||
'Account Name: Account Name': committeeMember['Organization']['Name'] if 'Organization' in committeeMember and 'Name' in committeeMember['Organization'] else None, | ||
'Appointed By': committeeMember['AppointedBy'] if 'AppointedBy' in committeeMember else None, | ||
'Voting Status': committeeMember['VotingStatus'] if 'VotingStatus' in committeeMember else None, | ||
'Special Role': committeeMember['Role'] if 'Role' in committeeMember else None, | ||
'Title': committeeMember['Title'] if 'Title' in committeeMember else None, | ||
'HeadshotURL': committeeMember['LogoURL'] if 'LogoURL' in committeeMember else None | ||
}) | ||
|
||
with open(args.output, 'w') as tacmembersCsvFileObject: | ||
print("Saving file {}".format(args.output)) | ||
writer = csv.DictWriter(tacmembersCsvFileObject, fieldnames = csvRows[0].keys()) | ||
writer.writeheader() | ||
writer.writerows(csvRows) | ||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.