Skip to content

Commit

Permalink
Add map linting and update python data
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneCurcuru committed Feb 16, 2024
1 parent e8e5fab commit 5a35164
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
12 changes: 11 additions & 1 deletion _data/python_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,15 @@
"minimumdepositcasinosorg": "minimumdepositcasinos.org",
"easeus-software": "easeus.com",
"adimianbe-sprl": "adimian.com",
"roboflow": "roboflow.com"
"roboflow": "roboflow.com",
"python-software-foundation": "python.org",
"aws": "amazon.com",
"microsoft": "microsoft.com",
"american-express": "americanexpress.com",
"crunchy-data": "crunchydata.com",
"rezoomex": "rezoomex.com",
"endorlabs.com": "endorlabs.com",
"anvil": "anvil.works",
"astral": "astral.sh",
"devitjobs": "devitjobs.com"
}
21 changes: 10 additions & 11 deletions _data/sponsorships/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
],
"second": [
"ansys.com",
"microsoft"
"microsoft.com"
],
"third": [
"american-express",
"americanexpress.com",
"capitalone.com",
"python-software-foundation",
"aws"
"python.org",
"amazon.com"
],
"fourth": [
"indeed.com",
"redhat.com",
"openedg.org"
],
"fifth": [
"crunchy-data",
"crunchydata.com",
"pydantic.dev",
"sentry.io",
"janestreet.com",
"jetbrains.com"
],
"sixth": [
"rezoomex",
"rezoomex.com",
"elastic.co",
"lerner.co.il",
"deepset.ai",
"temporal.io",
"endor-labs",
"anvil",
"anvil.works",
"capeprivacy.com",
"akamai.com",
"telemetryhub.com",
Expand All @@ -44,7 +44,7 @@
],
"seventh": [
"sixfeetup.com",
"astral",
"astral.sh",
"pythonic-exam.com",
"stickermule.com",
"guidebook.com",
Expand All @@ -54,11 +54,10 @@
"lincolnloop.com"
],
"eighth": [
"devitjobs",
"devitjobs.com",
"minimumdepositcasinos.org",
"dm-jobs.com",
"easeus.com",
"roboflow.com"
],
"parseDate": "20240215"
]
}
16 changes: 15 additions & 1 deletion assets/ruby/sponsor_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def cleanup_with_map(links, mapname)
sponsors = {}
map = JSON.parse(File.read(mapname))
links.each do | level, ary |
next unless ary.is_a?(Array) # Skip dates, errors, etc
sponsors[level] = []
ary.each do | itm |
newitm = map.fetch(itm, nil)
Expand Down Expand Up @@ -281,6 +282,9 @@ def parse_commandline
opts.on('-oORGID', '--one ORGID', 'Input org id (asf, python, etc.) to parse one.') do |orgid|
options[:orgid] = orgid
end
opts.on('-mMAPID', '--map MAPID', 'Lint one existing sponsorship with its map.') do |mapid|
options[:mapid] = mapid
end
opts.on("-v", "--[no-]verbose", "Verbose output to stdout.") do |v|
options[:verbose] = v
@verbose = v
Expand All @@ -301,8 +305,18 @@ def parse_commandline
if __FILE__ == $PROGRAM_NAME
options = parse_commandline
orgid = options.fetch(:orgid, nil)
mapid = options.fetch(:mapid, nil)
parsed = {}
if orgid
if mapid
sponsor_file = File.join('_data/sponsorships', "#{mapid}.json")
links = JSON.parse(File.read(sponsor_file))
mapname = File.join('_data', "#{mapid}_map.json")
newfile = cleanup_with_map(links, mapname)
File.open(sponsor_file, "w") do |f|
f.write(JSON.pretty_generate(newfile))
end
exit 0
elsif orgid
options[:outfile] ||= File.join(DEFAULT_OUTDIR, "#{orgid}.json")
parsed = process_sponsorship(orgid, get_current_sponsorship(get_sponsorship_file(orgid)))
else
Expand Down

0 comments on commit 5a35164

Please sign in to comment.