1,035
edits
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Useful links == | == Useful links == | ||
https://github.com/mastodon/mastodon/discussions/18143#discussioncomment-3431366 | https://github.com/mastodon/mastodon/discussions/18143#discussioncomment-3431366 | ||
== Steps to make importable == | |||
Not very sophisticated, but hey. | |||
<syntaxhighlight lang="python"> | |||
import pandas as pd | |||
# Download the tables directly from this page | |||
df = pd.read_html('https://wiki.neuromatch.io/Defederated_Instances/Imports') | |||
# combine | |||
dfs = pd.concat(df) | |||
# sort values so that entries with reasons come first, dedupe | |||
dfs.sort_values(['domain','reason']).drop_duplicates(subset='domain', keep='first') | |||
# change 'severity' values to match import format | |||
dfs.loc[dfs['#severity']=='Limited','#severity'] = 'limit' | |||
dfs.loc[dfs['#severity']=='Suspended','#severity'] = 'suspend' | |||
# add columns and rename to match import format | |||
dfs['#reject_media'] = True | |||
dfs['#reject_reports'] = True | |||
dfs['#obfuscate'] = True | |||
dfs = dfs.rename(columns={'domain':'#domain','severity':'#severity','reason':'#public_comment'}) | |||
# reorder | |||
dfs = dfs[['#domain','#severity','#reject_media','#reject_reports','#public_comment','#obfuscate']] | |||
# export to csv | |||
dfs.to_csv('filename.csv', index=False) | |||
</syntaxhighlight> | |||
That will give you a deduped CSV, but then you still need to go through manually and remove obfuscated domain names and check to make sure the blocks align with what would fit for the instance :) | |||