{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

LegalTech HackZurich 2020

\n", "


\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%%html\n", "" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import IFrame\n", "IFrame('./Template 5_ENG.pdf', width=\"100%\", height=800)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# importing required modules\n", "import PyPDF2\n", "\n", "# creating a pdf file object\n", "pdfFileObj = open('Template 5_ENG.pdf', 'rb')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# creating a pdf reader object\n", "pdfReader = PyPDF2.PdfFileReader(pdfFileObj)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# creating a page object\n", "pageObj = pdfReader.getPage(0)\n", "\n", "text = pageObj.extractText()\n", "text = text.replace('-\\n', '')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Public Tender Offer \n", "by \n", "UPC Schweiz GmbH, Wallisellen, Switzerland \n", "for all publicly held registered shares with a nominal value of \n", "CHF 1.00 each \n", "of \n", "Sunrise Communications Group AG, Opfikon, Switzerland \n", "Offer Price:\n", "CHF 110.00 net in cash (the \n", "Offer Price\n", ") per registered share of Sunrise \n", "Communications Group AG (\n", "Sunrise \n", "or the\n", " Company\n", ") with a nominal \n", "value of Swiss Francs (\n", "CHF\n", ") 1.00 each (each a \n", "Sunrise Share\n", "). \n", "The Offer Price will be reduced by the gross amount of any dilutive effects \n", "in respect of the Sunrise Shares prior to the consummation of the Offer \n", "(the \n", "Settlement\n", ", and the date on which the Settlement shall occur, the \n", "Settlement Date\n", "), including dividend payments and other distributions of \n", "any kind, stock splits or reverse stock splits, demergers and spin-offs, \n", "capital increases and the sale of treasury shares at an issuance or sales \n", "price per Sunrise Share below the Offer Price, the purchase by the Company or any of its Subsidiaries of Sunrise Shares at a purchase price \n", "above the lower of the Offer Price and the prevailing share price, the issuance by the Company or any of its Subsidiaries of options, warrants, convertible securities or other rights to acquire Sunrise Shares or other securities of the Company, and repayments of capital in any form\n", ".Offer Period:\n", "From September 11, 2020, to October 8, 2020, 4:00 p.m. Swiss time (subject to extension). \n", "Sunrise \n", "Securities No. \n", "ISIN \n", "Ticker symbol \n", "Registered shares \n", "not tendered \n", "(first trading line) \n", "26 729 122 \n", "CH0267291224 \n", "SRCG \n", "Registered shares \n", "tendered \n", "(second trading line) \n", "56 563 066 \n", "CH0565630669 \n", "SRCGE \n", "________________ \n", "Financial Advisors \n", "Credit Suisse \n", "J.P. Morgan\n", "Offer Manager \n", "Credit Suisse \n", "Offer Prospectus dated August 27, 2020\n", "(the \n", "Offer Prospectus\n", ")\n" ] } ], "source": [ "# extracting text from page\n", "#print(pageObj.extractText())\n", "print(text)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# closing the pdf file object\n", "pdfFileObj.close()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "##\n", "f = open(\"text-eng.txt\", \"w\")\n", "f.write(text)\n", "f.close()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "https://en.wikipedia.org/wiki/Sunrise_(company)\n", "https://en.wikipedia.org/wiki/Sunrise_(company)#History\n", "https://en.wikipedia.org/wiki/Sunrise_(company)#Studios\n", "https://en.wikipedia.org/wiki/Sunrise_(company)#Non-Japanese_productions\n", "https://en.wikipedia.org/wiki/Sunrise_(company)#Video_game_animation_work\n", "https://www.facebook.com/sunriseincofficial/\n" ] } ], "source": [ "from googlesearch import search\n", "\n", "query = \"Sunrise inc\"\n", "\n", "for i in search(query, tld=\"co.in\", num=10, stop=6, pause=2):\n", " print(i)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "
\n", "
" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "# insert contents of \"/test1.txt\" into \"/test2.txt\" at line 20\n", "#with open(\"text-eng.txt\", \"r\") as f1:\n", "# t1 = f1.readlines()\n", "#with open(\"html.html\", \"r\") as f2:\n", "# t2 = f2.readlines()\n", "#t2.insert(71, t1)\n", "#with open(\"html.html\", \"w\") as f2:\n", "# f2.writelines(str(t2))" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import IFrame\n", "IFrame('./html.html', width=\"100%\", height=800)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } }, "nbformat": 4, "nbformat_minor": 2 }