<jupyter_start><jupyter_text>Releases Presentation<jupyter_code>%%capture
import sys
!{sys.executable} -m pip install google-auth-oauthlib
!{sys.executable} -m pip install google-api-python-client
!{sys.executable} -m pip install xhtml2pdf
!{sys.executable} -m pip install pdfrw
import requests
import pandas as pd
import re
from modules.Presentations import *
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:70% !important; }</style>"))
HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')<jupyter_output><empty_output><jupyter_text>We get the json file with the information fromhttps://wmwaredata.s3.us-east-2.amazonaws.com/releases.json<jupyter_code>url = 'https://wmwaredata.s3.us-east-2.amazonaws.com/releases.json'
r = requests.get(url, allow_redirects=True)
open('data/releases.json', 'wb').write(r.content)
df = pd.read_json('data/releases.json')
df = df.rename(columns={'repo_repo': 'repo_name'})

repos = []
dates = []
descriptions = []

for i in range(len(df)):
    # Repo
    repo = df['repo_name'].iloc[i] + '\n\n' + df['repo_url'].iloc[i]
    repos.append(repo)
    # Date
    d = df['release_date'].iloc[i]        
    if d is not None:
        d = d.split('T')
        date = d[0] + '\n\n' + d[1][:-1]
    else:
        date = ''
    dates.append(date)
    # Description
    content = re.sub('<.*?>', '', df['release_name'].iloc[i])
    des = wrap_by_word(content, n=20)
    descriptions.append(des)

df['Repo'] = repos
df['Date'] = dates
df['Description'] = descriptions

df = df.rename(columns={'release_tag': 'Tag'})

df = df[['Repo', 'Tag', 'Date', 'Description']]
df
create_presentation(df, 
                    file_name='Releases Presentation', 
                    table_title='Releases', 
                    step = 4, 
                    columns_widths=[100, 40, 60, 500], 
                    columns_to_merge=['Repo'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17456700091157704, 'fraction_numerical': 0.010483135824977211, 'mean_word_length': 3.7408207343412525, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '664499', 'license': 'Apache-2.0', 'n_tokens_mistral': 787, 'n_tokens_neox': 761, 'n_words': 152, 'path': 'upwork-devs/Pappaterra-Lucia/Releases Presentation.ipynb', 'repo_name': 'lucia15/k8-vmware-visualisation', 'size': '2194'}