actorcat

hotmail contacts

May 22nd, 2026 (edited)
59
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.74 KB | None | 0 0
  1.  
  2. import pandas as pd
  3. from reportlab.lib.pagesizes import letter
  4. from reportlab.platypus import Table, TableStyle, SimpleDocTemplate, Paragraph
  5. from reportlab.lib import colors
  6. from reportlab.lib.units import inch
  7. from reportlab.lib.styles import getSampleStyleSheet
  8. import tkinter as tk
  9. from tkinter import filedialog, messagebox
  10.  
  11.  
  12. def import_contacts_csv(csv_path):
  13.     df = pd.read_csv(csv_path)
  14.     def safe_get(col):
  15.         # Try to get the column, case-insensitive, fallback to empty
  16.         for c in df.columns:
  17.             if c.strip().lower() == col.strip().lower():
  18.                 return df[c].fillna('')
  19.         return pd.Series([''] * len(df))
  20.  
  21.     first = safe_get('First Name')
  22.     last = safe_get('Last Name')
  23.     phone_home = safe_get('Home Phone')
  24.     phone_business = safe_get('Business Phone')
  25.     phone_mobile = safe_get('Mobile Phone') if 'Mobile Phone' in [c.strip() for c in df.columns] else pd.Series([''] * len(df))
  26.     email = safe_get('E-mail Address')
  27.     street = safe_get('Home Street')
  28.     city = safe_get('Home City')
  29.     state = safe_get('Home State')
  30.     postal = safe_get('Home Postal Code')
  31.     # Combine address fields, skipping empty parts and ensuring all are strings
  32.     address = [', '.join(filter(None, [str(s).strip(), str(c).strip(), str(st).strip(), str(p).strip()])) for s, c, st, p in zip(street, city, state, postal)]
  33.     # Combine all phone numbers into one string, labeled
  34.     phones = []
  35.     import re
  36.     def phone_link(label, number):
  37.         num = str(number).strip()
  38.         if not num:
  39.             return ''
  40.         # Extract digits for tel: link
  41.         digits = re.sub(r'[^0-9+]', '', num)
  42.         if digits:
  43.             return f'{label}: <link href="tel:{digits}">{num}</link>'
  44.         else:
  45.             return f'{label}: {num}'
  46.  
  47.     for h, b, m in zip(phone_home, phone_business, phone_mobile):
  48.         phone_parts = []
  49.         if str(m).strip():
  50.             phone_parts.append(phone_link("Mobile", m))
  51.         if str(h).strip():
  52.             phone_parts.append(phone_link("Home", h))
  53.         if str(b).strip():
  54.             phone_parts.append(phone_link("Business", b))
  55.         phones.append("<br/>".join(phone_parts))
  56.     contacts = list(zip(first, last, phones, email, address))
  57.     return contacts
  58.  
  59.  
  60. def export_contacts_to_pdf(contacts, pdf_path):
  61.     doc = SimpleDocTemplate(
  62.         pdf_path,
  63.         pagesize=letter,
  64.         leftMargin=0.1*inch,
  65.         rightMargin=0.1*inch,
  66.         topMargin=0.3*inch,
  67.         bottomMargin=0.3*inch
  68.     )
  69.     elements = []
  70.     data = [["First Name", "Last Name", "Phone(s)", "Email", "Address"]]
  71.     styles = getSampleStyleSheet()
  72.     # Use a custom style for better word wrapping
  73.     from reportlab.lib.styles import ParagraphStyle
  74.     wrap_style = ParagraphStyle('wrap', parent=styles['Normal'], wordWrap='CJK', allowOrphans=1, allowWidows=1, splitLongWords=True, fontSize=8, leading=10)
  75.     for c in contacts:
  76.         # Phone(s) as Paragraph to support line breaks
  77.         phone_para = Paragraph(str(c[2]), wrap_style)
  78.         row = [
  79.             Paragraph(str(c[0]), wrap_style),  # First Name
  80.             Paragraph(str(c[1]), wrap_style),  # Last Name
  81.             phone_para,  # Phone(s) with line breaks
  82.             Paragraph(str(c[3]), wrap_style),  # Email
  83.             Paragraph(str(c[4]), wrap_style)   # Address
  84.         ]
  85.         data.append(row)
  86.     table_data = [data[0]]
  87.     for row in data[1:]:
  88.         table_data.append([row[0], row[1], row[2], row[3], row[4]])
  89.     # Adjust column widths: more space for address, allow for wrapping
  90.     table = Table(table_data, repeatRows=1, colWidths=[1.1*inch, 1.1*inch, 1.7*inch, 1.7*inch, 2.2*inch])
  91.     # Enable word wrap and splitting for all columns
  92.     table.setStyle(TableStyle([
  93.         ('WORDWRAP', (0, 0), (-1, -1), 'CJK'),
  94.         ('VALIGN', (0, 0), (-1, -1), 'TOP'),
  95.         ('ALIGN', (0, 0), (-1, -1), 'LEFT'),
  96.         ('SPLITLONGWORDS', (0, 0), (-1, -1), True),
  97.     ]))
  98.     style = TableStyle([
  99.         ('BACKGROUND', (0,0), (-1,0), colors.lightblue),
  100.         ('TEXTCOLOR', (0,0), (-1,0), colors.whitesmoke),
  101.         ('ALIGN', (0,0), (-1,-1), 'LEFT'),
  102.         ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
  103.         ('BOTTOMPADDING', (0,0), (-1,0), 12),
  104.         ('GRID', (0,0), (-1,-1), 0.5, colors.grey),
  105.         ('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
  106.     ])
  107.     table.setStyle(style)
  108.     elements.append(table)
  109.     doc.build(elements)
  110.  
  111.  
  112.  
  113. def run_gui():
  114.  
  115.     import os
  116.  
  117.     def browse_csv():
  118.         path = filedialog.askopenfilename(filetypes=[('CSV Files', '*.csv'), ('All Files', '*.*')])
  119.         if path:
  120.             csv_entry.delete(0, tk.END)
  121.             csv_entry.insert(0, path)
  122.             # Set PDF path to same folder and base name as CSV
  123.             base = os.path.splitext(os.path.basename(path))[0]
  124.             folder = os.path.dirname(path)
  125.             pdf_path = os.path.join(folder, base + '.pdf')
  126.             pdf_entry.delete(0, tk.END)
  127.             pdf_entry.insert(0, pdf_path)
  128.  
  129.     def browse_pdf():
  130.         # Default to the folder of the CSV if available
  131.         initialdir = os.path.dirname(csv_entry.get()) if csv_entry.get() else ''
  132.         path = filedialog.asksaveasfilename(defaultextension='.pdf', filetypes=[('PDF Files', '*.pdf'), ('All Files', '*.*')], initialdir=initialdir)
  133.         if path:
  134.             pdf_entry.delete(0, tk.END)
  135.             pdf_entry.insert(0, path)
  136.  
  137.     def export():
  138.         csv_path = csv_entry.get().strip('"').strip("'")
  139.         pdf_path = pdf_entry.get().strip('"').strip("'")
  140.         if not pdf_path.lower().endswith('.pdf'):
  141.             pdf_path += '.pdf'
  142.         try:
  143.             contacts = import_contacts_csv(csv_path)
  144.             # messagebox.showinfo("Debug", f"Output PDF path: {pdf_path}\nNumber of contacts loaded: {len(contacts)}")
  145.             export_contacts_to_pdf(contacts, pdf_path)
  146.             messagebox.showinfo("Success", f"Exported {len(contacts)} contacts to {pdf_path}")
  147.         except Exception as e:
  148.             messagebox.showerror("Error", f"Failed to export PDF: {e}")
  149.  
  150.     root = tk.Tk()
  151.     root.title("Contacts to PDF Exporter")
  152.  
  153.     tk.Label(root, text="Google Contacts CSV:").grid(row=0, column=0, sticky='e')
  154.     csv_entry = tk.Entry(root, width=40)
  155.     csv_entry.grid(row=0, column=1)
  156.     tk.Button(root, text="Browse", command=browse_csv).grid(row=0, column=2)
  157.  
  158.     tk.Label(root, text="Output PDF file:").grid(row=1, column=0, sticky='e')
  159.     pdf_entry = tk.Entry(root, width=40)
  160.     pdf_entry.grid(row=1, column=1)
  161.     # tk.Button(root, text="Browse", command=browse_pdf).grid(row=1, column=2)
  162.  
  163.     tk.Button(root, text="Export to PDF", command=export).grid(row=2, column=0, columnspan=3, pady=10)
  164.  
  165.     root.mainloop()
  166.  
  167.  
  168. if __name__ == "__main__":
  169.     run_gui()
  170.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Ebkimqy
    15 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=hjskmjktqc
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment