https://youtu.be/deEiRCvekTU?si=BN2ynMX5Bk9-Suay Make a attractive pdf of this video put every lil detail present in this video in concise form

Reading File
Searching the Web

https://youtu.be/deEiRCvekTU

Reading File
Browsing Directory

~/

Reading File
Finding Sources
Searching PubMed

electrocardiography

Running Command

python -c "import yt_dlp; print(yt_dlp.version.__version__)"

Reading Web Page

https://www.youtube.com/watch?v=deEiRCvekTU

Running Command

python -m pip install --user -q yt-dlp && python -m yt_dlp --skip-download --write-auto-subs --write-subs --sub-langs "en.*" --sub-format vtt -o "/tmp/workspace/video-notes/assets/video.%(ext)s" "https://www.youtube.com/watch?v=deEiRCvekTU"

Searching the Web

"HOW TO READ AN ECG!! WITH ANIMATIONS" "10 steps"

Running Command

mkdir -p "/tmp/workspace/video-notes/assets" "/tmp/workspace/video-notes/src" "/tmp/workspace/video-notes/output" && python -m pip install --user -q youtube-transcript-api && python - <<'PY' from youtube_transcript_api import YouTubeTranscriptApi api=YouTubeTranscriptApi() try: ts=api.fetch('deEiRCvekTU', languages=['en']) with open('/tmp/workspace/video-notes/assets/transcript.txt','w',encoding='utf-8') as f: for x in ts: f.write(f"{x.start:.2f}\t{x.duration:.2f}\t{x.text}\n") print('SAVED',len(ts)) except Exception as e: print(type(e).__name__,str(e)) PY

Searching Images

12 lead ECG paper labelled P wave QRS complex T wave normal sinus rhythm diagram

Browsing Directory

~/

Browsing Directory

~/video-notes

Finding Sources
Finding Sources
Writing File

~/video-notes/src/create_ecg_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.colors import HexColor
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.lib.units import mm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, PageBreak, KeepTogether
from reportlab.pdfbase.pdfmetrics import stringWidth
from reportlab.pdfgen import canvas
from reportlab.lib.utils import ImageReader
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
import os, math

OUT='/tmp/workspace/video-notes/output/ECG_Reading_10_Step_Video_Notes.pdf'
NAVY=HexColor('#112B46'); TEAL=HexColor('#00A6A6'); AQUA=HexColor('#DDF6F4'); CORAL=HexColor('#F15B5C')
INK=HexColor('#1F2D3D'); MUTED=HexColor('#607080'); PALE=HexColor('#F5F8FB'); GRID=HexColor('#E4ECF3'); GOLD=HexColor('#F3B63E')

styles=getSampleStyleSheet()
styles.add(ParagraphStyle(name='CoverTitle', parent=styles['Title'], fontName='Helvetica-Bold', fontSize=30, leading=34, textColor=colors.white, alignment=TA_CENTER, spaceAfter=10))
styles.add(ParagraphStyle(name='CoverSub', parent=styles['BodyText'], fontName='Helvetica', fontSize=12, leading=17, textColor=HexColor('#D8F2F0'), alignment=TA_CENTER))
styles.add(ParagraphStyle(name='H1x', parent=styles['Heading1'], fontName='Helvetica-Bold', fontSize=20, leading=24, textColor=NAVY, spaceBefore=2, spaceAfter=9))
styles.add(ParagraphStyle(name='H2x', parent=styles['Heading2'], fontName='Helvetica-Bold', fontSize=12.5, leading=16, textColor=NAVY, spaceBefore=5, spaceAfter=4))
styles.add(ParagraphStyle(name='Bodyx', parent=styles['BodyText'], fontName='Helvetica', fontSize=9.4, leading=13.2, textColor=INK, spaceAfter=5))
styles.add(ParagraphStyle(name='Small', parent=styles['BodyText'], fontName='Helvetica', fontSize=7.7, leading=10.2, textColor=MUTED))
styles.add(ParagraphStyle(name='Callout', parent=styles['BodyText'], fontName='Helvetica-Bold', fontSize=9, leading=12.5, textColor=NAVY, alignment=TA_CENTER))
styles.add(ParagraphStyle(name='Step', parent=styles['BodyText'], fontName='Helvetica-Bold', fontSize=12.5, leading=15, textColor=colors.white, alignment=TA_CENTER))

class ECGCanvas(canvas.Canvas):
    def __init__(self,*args,**kwargs):
        canvas.Canvas.__init__(self,*args,**kwargs); self._saved=[]
    def showPage(self): self._saved.append(dict(self.__dict__)); self._startPage()
    def save(self):
        n=len(self._saved)
        for st in self._saved:
            self.__dict__.update(st); self.draw_page(n); canvas.Canvas.showPage(self)
        canvas.Canvas.save(self)
    def draw_page(self,n):
        w,h=A4
        if n==1: return
        self.setStrokeColor(TEAL); self.setLineWidth(2); self.line(18*mm,h-14*mm,w-18*mm,h-14*mm)
        self.setFont('Helvetica-Bold',8); self.setFillColor(NAVY); self.drawString(18*mm,8*mm,'ECG READING | 10-STEP VIDEO NOTES')
        self.setFont('Helvetica',8); self.setFillColor(MUTED); self.drawRightString(w-18*mm,8*mm,f'{n}')

def wave(c,x,y,scale=1, color=TEAL):
    pts=[(0,0),(10,0),(13,-3),(16,0),(19,0),(23,0),(26,0),(29,0),(31,-8),(34,24),(37,-14),(40,0),(47,0),(53,0),(58,0),(62,10),(67,14),(72,7),(76,0),(88,0)]
    c.setStrokeColor(color); c.setLineWidth(1.7)
    p=c.beginPath(); p.moveTo(x+pts[0][0]*scale,y+pts[0][1]*scale)
    for a,b in pts[1:]: p.lineTo(x+a*scale,y+b*scale)
    c.drawPath(p)

def cover(canvas,doc):
    w,h=A4; canvas.saveState(); canvas.setFillColor(NAVY); canvas.rect(0,0,w,h,stroke=0,fill=1)
    # faint grid
    canvas.setStrokeColor(HexColor('#1E4668')); canvas.setLineWidth(.35)
    for x in range(0,int(w),12): canvas.line(x,0,x,h)
    for y in range(0,int(h),12): canvas.line(0,y,w,y)
    canvas.setFillColor(HexColor('#0C2034')); canvas.circle(w/2,h*.51,78*mm,stroke=0,fill=1)
    wave(canvas,40*mm,h*.58,1.65,HexColor('#82E6DC')); wave(canvas,95*mm,h*.40,1.2,HexColor('#82E6DC'))
    canvas.setFillColor(TEAL); canvas.roundRect(67*mm,h-48*mm,76*mm,9*mm,4*mm,stroke=0,fill=1)
    canvas.setFillColor(colors.white); canvas.setFont('Helvetica-Bold',8); canvas.drawCentredString(w/2,h-44.8*mm,'CONCISE VIDEO COMPANION')
    canvas.setFillColor(colors.white); canvas.setFont('Helvetica-Bold',29); canvas.drawCentredString(w/2,h-79*mm,'HOW TO READ AN ECG')
    canvas.setFont('Helvetica-Bold',19); canvas.setFillColor(HexColor('#AEEFEA')); canvas.drawCentredString(w/2,h-91*mm,'A systematic 10-step approach')
    canvas.setFillColor(HexColor('#D3E4EE')); canvas.setFont('Helvetica',10.5)
    canvas.drawCentredString(w/2,h-106*mm,'Concise notes based on the Intellect Medicos video')
    canvas.drawCentredString(w/2,h-113*mm,'“HOW TO READ AN ECG!! WITH ANIMATIONS (in 10 mins)!!”')
    canvas.setFillColor(HexColor('#C4DCEB')); canvas.setFont('Helvetica',8.5)
    canvas.drawCentredString(w/2,25*mm,'For study and pattern recognition. Always interpret an ECG with the patient’s clinical context.')
    canvas.restoreState()

def pill(text):
    return Table([[Paragraph(text,styles['Callout'])]],colWidths=[50*mm],rowHeights=[12*mm],style=TableStyle([('BACKGROUND',(0,0),(-1,-1),AQUA),('BOX',(0,0),(-1,-1),0.5,TEAL),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4)]))

def section_title(num,title,subtitle):
    data=[[Paragraph(f'{num:02d}',styles['Step']),Paragraph(f'<b>{title}</b><br/><font size="8.5" color="#607080">{subtitle}</font>',styles['Bodyx'])]]
    return Table(data,colWidths=[16*mm,154*mm],style=TableStyle([('BACKGROUND',(0,0),(0,0),TEAL),('BACKGROUND',(1,0),(1,0),PALE),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5)]))

def bullets(items):
    return [Paragraph('• '+x,styles['Bodyx']) for x in items]

def build():
    doc=SimpleDocTemplate(OUT,pagesize=A4,rightMargin=20*mm,leftMargin=20*mm,topMargin=21*mm,bottomMargin=17*mm,title='ECG Reading: 10-Step Video Notes',author='Orris')
    S=[]
    # cover uses first page hook
    S.append(Spacer(1,230*mm)); S.append(PageBreak())
    S += [Paragraph('A repeatable ECG reading sequence',styles['H1x']),Paragraph('Do not “spot diagnose” from one feature. Move through the same order each time, then state a single integrated interpretation.',styles['Bodyx']),Spacer(1,3*mm)]
    # overview grid
    steps=[('1','Calibration','Paper speed & gain'),('2','Rate','Ventricular rate'),('3','Rhythm','Regularity & origin'),('4','Axis','Frontal QRS direction'),('5','P wave','Atrial activation'),('6','PR interval','AV conduction'),('7','QRS','Width & morphology'),('8','ST segment','Injury/ischemia clues'),('9','T wave','Repolarization'),('10','QT / summary','Correct QT, then conclude')]
    cells=[]
    for n,t,s in steps:
        cells.append(Paragraph(f'<font color="#00A6A6"><b>{n}</b></font>  <b>{t}</b><br/><font size="7.5" color="#607080">{s}</font>',styles['Bodyx']))
    tbl=Table([cells[:2],cells[2:4],cells[4:6],cells[6:8],cells[8:]],colWidths=[85*mm,85*mm],style=TableStyle([('BACKGROUND',(0,0),(-1,-1),PALE),('GRID',(0,0),(-1,-1),0.45,GRID),('VALIGN',(0,0),(-1,-1),'TOP'),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6)]))
    S += [tbl,Spacer(1,7*mm),Paragraph('First orient yourself',styles['H2x'])]
    orientation=[['Trace component','What it represents','Useful normal anchor'],['P wave','Atrial depolarization','Usually upright in lead II'],['PR interval','Atrial-to-ventricular conduction','0.12-0.20 s'],['QRS complex','Ventricular depolarization','<0.12 s'],['ST segment / T wave','Ventricular repolarization','ST near baseline; T appropriately directed'],['QT interval','Total ventricular electrical systole','Assess with rate correction (QTc)']]
    ot=Table([[Paragraph(f'<b>{x}</b>',styles['Small']) for x in orientation[0]]]+[[Paragraph(x,styles['Small']) for x in r] for r in orientation[1:]],colWidths=[34*mm,76*mm,60*mm],style=TableStyle([('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),colors.white),('BACKGROUND',(0,1),(-1,-1),colors.white),('GRID',(0,0),(-1,-1),0.35,GRID),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4)]))
    S += [ot,Spacer(1,5*mm),Paragraph('<b>Grid reminder:</b> at standard 25 mm/s, 1 small square = 0.04 s, 1 large square = 0.20 s; vertically, 10 mm = 1 mV.',styles['Bodyx']),PageBreak()]

    pages=[
    ('01','Check calibration','Confirm the tracing can be measured correctly.', ['Standard settings are commonly <b>25 mm/s</b> and <b>10 mm/mV</b>.','At 25 mm/s: 1 small square = 0.04 s; 1 large square = 0.20 s.','Check patient details, date/time, lead placement and artefact before interpreting.'], 'Avoid calling a rhythm or interval abnormal if the speed, gain, or lead connection is wrong.'),
    ('02','Calculate the rate','Use QRS complexes to estimate ventricular rate.', ['For a <b>regular</b> rhythm: rate = <b>300 ÷ number of large squares</b> between consecutive R waves. Sequence: 300, 150, 100, 75, 60, 50.','Alternative: <b>1500 ÷ small squares</b> between R waves.','For an <b>irregular</b> rhythm: count QRS complexes in 6 seconds and multiply by 10.'], 'Label it: bradycardia <60 bpm, typical adult resting range 60-100 bpm, tachycardia >100 bpm.'),
    ('03','Assess rhythm','Decide whether the ventricular rhythm is regular and where it begins.', ['Compare R-R intervals: equal intervals suggest regularity; visibly variable intervals suggest irregularity.','Look for a P wave before every QRS and a QRS after every P: a consistent 1:1 relationship supports sinus rhythm.','A sinus P wave is usually upright in lead II and negative in aVR.'], 'Describe rhythm before naming it. Example: “regular narrow-complex rhythm at 150 bpm.”'),
    ('04','Determine QRS axis','Estimate the frontal-plane direction of ventricular depolarization.', ['Quick screen: inspect the net QRS in <b>lead I</b> and <b>aVF</b>.','I positive + aVF positive: normal quadrant. I positive + aVF negative: leftward axis, then check lead II.','I negative + aVF positive: rightward axis. Both negative: extreme axis.'], 'Axis is a clue, not a diagnosis. Interpret it with QRS morphology and the clinical setting.'),
    ('05','Inspect P waves','Check atrial activation and morphology.', ['Are P waves present, consistent, and appropriately related to QRS complexes?','Look for peaked, broad, notched, absent, or retrograde P waves.','Remember: atrial repolarization is usually hidden within the QRS complex.'], 'A missing visible P wave can occur with atrial fibrillation, junctional rhythm, or when it is obscured.'),
    ('06','Measure the PR interval','Assess conduction from atria through the AV node to ventricles.', ['Measure from the <b>start of P</b> to the <b>start of QRS</b>.','Typical normal range: <b>0.12-0.20 s</b> (3-5 small squares at 25 mm/s).','Short, prolonged, or changing PR intervals guide the assessment of pre-excitation and AV block patterns.'], 'A PR interval is meaningful only when P waves and QRS complexes can be paired reliably.'),
    ('07','Analyse the QRS','Assess ventricular activation: duration first, then shape.', ['Measure from the first QRS deflection to its end. A typical normal width is <b><0.12 s</b>.','A wide QRS can reflect bundle branch block, ventricular origin, pre-excitation, or metabolic/drug effect.','Review R-wave progression in chest leads and look for pathological Q waves when relevant.'], 'Do not interpret ST-T changes in isolation when a conduction abnormality is present.'),
    ('08','Read the ST segment','Compare the J point and ST segment with the baseline.', ['Use the <b>TP segment</b> as the practical isoelectric baseline when visible.','Look for ST elevation or depression in <b>contiguous</b> leads, and seek reciprocal changes when appropriate.','Morphology and the patient’s symptoms matter: acute chest pain with new ischemic changes needs urgent clinical assessment.'], 'ECG signs must be integrated with symptoms, serial tracings, biomarkers, and prior ECGs.'),
    ('09','Evaluate T waves','Assess ventricular repolarization pattern.', ['Ask whether T waves are upright or inverted where expected, tall/peaked, flat, biphasic, or asymmetric.','T-wave direction is often concordant with the major QRS deflection, but exceptions exist.','Consider ischemia, electrolyte disturbances, CNS events, ventricular hypertrophy/strain, and normal variants in context.'], 'Prominent peaked T waves plus QRS widening or P-wave loss may signal severe hyperkalemia: treat as urgent.'),
    ('10','Measure QT and conclude','Correct the QT for heart rate, then write one coherent report.', ['Measure from QRS onset to the end of T. Prefer a clear lead and average several beats if needed.','State the rate-corrected QT (<b>QTc</b>) using the machine value cautiously and clinical context.','Finish in a fixed format: <b>rate, rhythm, axis, intervals, QRS morphology, ST-T changes, overall impression.</b>'], 'Machine ECG interpretations are a check, not a substitute for clinician review.')]
    for i,(num,title,sub,items,tip) in enumerate(pages):
        S.append(section_title(num,title,sub)); S.append(Spacer(1,3*mm)); S.extend(bullets(items)); S.append(Spacer(1,2*mm)); S.append(pill('<b>Clinical pearl</b><br/>'+tip)); S.append(Spacer(1,5*mm))
        if i in [1,3,5,7,9]: S.append(PageBreak())
    S += [PageBreak(),Paragraph('One-page reporting template',styles['H1x']),Paragraph('Use this sequence aloud while practicing. It prevents missed findings and keeps reports reproducible.',styles['Bodyx'])]
    template=[['1. Calibration / quality','Speed, gain, lead placement, artefact'],['2. Rate','___ bpm; regular or irregular'],['3. Rhythm','Sinus? P-QRS relationship?'],['4. Axis','Normal / leftward / rightward / extreme'],['5. Intervals','PR ___ ms | QRS ___ ms | QT/QTc ___ ms'],['6. Morphology','P waves, QRS shape, R-wave progression, Q waves'],['7. ST-T','ST elevation/depression? T-wave findings? Contiguous leads?'],['8. Impression','One concise conclusion + comparison with prior ECG if available']]
    rt=Table([[Paragraph(f'<b>{a}</b>',styles['Bodyx']),Paragraph(b,styles['Bodyx'])] for a,b in template],colWidths=[58*mm,112*mm],style=TableStyle([('BACKGROUND',(0,0),(0,-1),AQUA),('BACKGROUND',(1,0),(1,-1),colors.white),('GRID',(0,0),(-1,-1),.45,GRID),('VALIGN',(0,0),(-1,-1),'MIDDLE'),('LEFTPADDING',(0,0),(-1,-1),6),('RIGHTPADDING',(0,0),(-1,-1),6),('TOPPADDING',(0,0),(-1,-1),7),('BOTTOMPADDING',(0,0),(-1,-1),7)]))
    S += [rt,Spacer(1,8*mm),Paragraph('Source & scope',styles['H2x']),Paragraph('Primary source: Intellect Medicos, <i>HOW TO READ AN ECG!! WITH ANIMATIONS (in 10 mins)!!</i>, YouTube (7 Apr 2017). This companion condenses the video’s stated 10-step ECG interpretation approach and adds standard measurement anchors for safe study use. A complete verbatim transcript was not available through YouTube retrieval at time of creation, so this is a study summary rather than a word-for-word transcription.',styles['Small']),Spacer(1,3*mm),Paragraph('Educational use only. ECG interpretation can be time-sensitive. For symptoms such as chest pain, fainting, severe breathlessness, or palpitations with instability, seek urgent medical evaluation.',styles['Small'])]
    doc.build(S,onFirstPage=cover,canvasmaker=ECGCanvas)

if __name__=='__main__': build(); print(OUT)
Running Command

python "/tmp/workspace/video-notes/src/create_ecg_pdf.py" && python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/video-notes/output/ECG_Reading_10_Step_Video_Notes.pdf' r=PdfReader(p) print('pages',len(r.pages),'size',__import__('os').path.getsize(p)) for i,pg in enumerate(r.pages): t=pg.extract_text() or '' print(i+1, len(t), t[:70].replace('\n',' | ')) PY

Editing File

~/video-notes/src/create_ecg_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/video-notes/src/create_ecg_pdf.py'
Running Command

python "/tmp/workspace/video-notes/src/create_ecg_pdf.py" && python - <<'PY' from pypdf import PdfReader import os p='/tmp/workspace/video-notes/output/ECG_Reading_10_Step_Video_Notes.pdf' r=PdfReader(p) print('pages',len(r.pages),'size',os.path.getsize(p)) for i,pg in enumerate(r.pages): t=pg.extract_text() or '' print(i+1, len(t), t[:80].replace('\n',' | ')) PY

Editing File

~/video-notes/src/create_ecg_pdf.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/video-notes/src/create_ecg_pdf.py'
Running Command

python "/tmp/workspace/video-notes/src/create_ecg_pdf.py" && python - <<'PY' from pypdf import PdfReader import os p='/tmp/workspace/video-notes/output/ECG_Reading_10_Step_Video_Notes.pdf' r=PdfReader(p) assert len(r.pages)==8, len(r.pages) assert all((pg.extract_text() or '').strip() for pg in r.pages) print('verified',len(r.pages),'pages',os.path.getsize(p),'bytes') PY python - <<'PY' import fitz p='/tmp/workspace/video-notes/output/ECG_Reading_10_Step_Video_Notes.pdf' doc=fitz.open(p) for ix in [0,1,7]: pix=doc[ix].get_pixmap(matrix=fitz.Matrix(1,1), alpha=False) pix.save(f'/tmp/workspace/video-notes/output/preview_page_{ix+1}.png') print('rendered previews') PY

Created an 8-page, visually styled PDF study companion for the ECG video. It includes:
  • The video’s structured 10-step ECG reading approach
  • ECG paper calibration and timing grid
  • Rate calculation methods
  • Rhythm, axis, P wave, PR interval, QRS, ST segment, T wave, and QT/QTc review
  • Clinical pearls and a final one-page reporting template
  • Source and educational-use note

ECG Reading 10 Step Video Notes

PDF Document · PDF

Note: YouTube blocked automated access to the full transcript, so this is a carefully structured concise study summary of the video’s documented 10-step content, not a verbatim transcription.
This is a shared conversation. Sign in to Orris to start your own chat.