-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
869 lines (829 loc) · 41.7 KB
/
Copy pathindex.html
File metadata and controls
869 lines (829 loc) · 41.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- ========== PRIMARY SEO ========== -->
<title>Pytml – Lightweight Python in Browser (vs PyScript & Flask)</title>
<meta name="description" content="Pytml is a 15KB zero‑config JS library that runs Python in HTML. Compare vs PyScript & Flask – no server, faster load, simpler syntax. Perfect for demos & education.">
<meta name="keywords" content="Pytml, PyScript vs Pytml, Flask vs Pytml, run python in browser, lightweight python web, zero config python, python html bridge, pyodide, webassembly python, educational coding, static site python">
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large">
<meta name="author" content="Aswanth R (NodeX-AR)">
<link rel="canonical" href="https://pytml.js.org/">
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://pytml.js.org/sitemap.xml" />
<meta name="google-site-verification" content="ri10nA5CuSxwYGnZIdeVOJl2eh8FayQ2ydsNIrGJTo8" />
<!-- ========== FAVICON ========== -->
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon-48x48.png" sizes="48x48">
<link rel="manifest" href="/site.webmanifest">
<link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/android-chrome-512x512.png" sizes="512x512">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3b82f6">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<!-- ========== OPEN GRAPH ========== -->
<meta property="og:type" content="website">
<meta property="og:title" content="Pytml – Lightweight Python in Browser (vs PyScript & Flask)">
<meta property="og:description" content="Run Python in HTML with zero config. Compare with PyScript & Flask – 15KB, no server, instant setup. Honest, fast, lazy.">
<meta property="og:url" content="https://pytml.js.org/">
<meta property="og:image" content="https://pytml.js.org/preview.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:site_name" content="NodeX-AR">
<meta property="og:locale" content="en_US">
<meta property="og:updated_time" content="2026-06-18T10:00:00+00:00">
<!-- ========== TWITTER CARD ========== -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Pytml – Lightweight Python in Browser (vs PyScript & Flask)">
<meta name="twitter:description" content="Zero‑config Python in HTML – compare vs PyScript & Flask. 15KB, faster, simpler, no backend.">
<meta name="twitter:image" content="https://pytml.js.org/preview.png">
<!-- ========== ENHANCED SCHEMA.ORG WITH ZENODO CITATION ========== -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebApplication",
"@id": "https://pytml.js.org/#webapp",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://pytml.js.org/"
},
"name": "Pytml",
"alternateName": "Python in HTML Bridge",
"headline": "Lightweight Python in Browser – Honest Comparison vs PyScript & Flask",
"description": "Pytml is a 15KB zero-config JS library that runs Python in HTML via WebAssembly. Unlike PyScript (heavy) or Flask (needs server), Pytml is instant, tiny, and works on any static host.",
"keywords": ["Pytml", "PyScript alternative", "Flask alternative", "Python in Browser", "Zero Config Python"],
"applicationCategory": "DeveloperApplication",
"softwareVersion": "2.0",
"datePublished": "2026-06-04",
"dateModified": "2026-06-18",
"license": "https://github.com/NodeX-AR/Pytml/blob/main/LICENSE",
"url": "https://pytml.js.org/",
"author": {
"@type": "Person",
"@id": "https://a-r.is-a.dev/#person",
"name": "Aswanth R",
"alternateName": "NodeX-AR",
"url": "https://a-r.is-a.dev/",
"sameAs": [
"https://www.wikidata.org/wiki/Q140290370",
"https://orcid.org/0009-0007-1619-374X",
"https://github.com/NodeX-AR",
"https://www.linkedin.com/in/nodex-ar"
]
},
"citation": {
"@type": "ScholarlyArticle",
"@id": "https://doi.org/10.5281/zenodo.20786716",
"name": "Pytml: Running Python in the Browser Using Pyodide",
"description": "Academic paper describing Pytml, a JavaScript library that uses Pyodide to run Python in web browsers.",
"author": {
"@type": "Person",
"@id": "https://a-r.is-a.dev/#person",
"name": "Aswanth R",
"url": "https://a-r.is-a.dev/"
},
"datePublished": "2026-06-21",
"publisher": {
"@type": "Organization",
"name": "Zenodo"
},
"url": "https://doi.org/10.5281/zenodo.20786716"
},
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
},
"sameAs": [
"https://github.com/NodeX-AR/Pytml",
"https://dev.to/nodex-ar/pytml-running-python-in-the-browser-without-a-backend-1nn4",
"https://devpost.com/software/pytml",
"https://www.npmjs.com/package/pytml"
]
},
{
"@type": "Person",
"@id": "https://a-r.is-a.dev/#person",
"name": "Aswanth R",
"alternateName": "NodeX-AR",
"description": "Ethical hacker and Python developer. Creator of Pytml — a zero-config JavaScript library that runs Python in the browser.",
"url": "https://a-r.is-a.dev/",
"sameAs": [
"https://www.wikidata.org/wiki/Q140290370",
"https://orcid.org/0009-0007-1619-374X",
"https://github.com/NodeX-AR",
"https://www.linkedin.com/in/nodex-ar"
],
"citation": {
"@type": "ScholarlyArticle",
"@id": "https://doi.org/10.5281/zenodo.20786716",
"name": "Pytml: Running Python in the Browser Using Pyodide",
"datePublished": "2026-06-21",
"publisher": "Zenodo",
"url": "https://doi.org/10.5281/zenodo.20786716"
}
},
{
"@type": "ScholarlyArticle",
"@id": "https://doi.org/10.5281/zenodo.20786716",
"name": "Pytml: Running Python in the Browser Using Pyodide",
"description": "Academic paper describing Pytml, a JavaScript library that uses Pyodide to run Python in web browsers.",
"author": {
"@type": "Person",
"@id": "https://a-r.is-a.dev/#person",
"name": "Aswanth R",
"url": "https://a-r.is-a.dev/"
},
"datePublished": "2026-06-21",
"publisher": {
"@type": "Organization",
"name": "Zenodo"
},
"url": "https://doi.org/10.5281/zenodo.20786716",
"isPartOf": {
"@type": "CreativeWork",
"name": "Zenodo",
"url": "https://zenodo.org/"
}
},
{
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://pytml.js.org/"
},
{
"@type": "ListItem",
"position": 2,
"name": "Pytml vs PyScript & Flask"
}
]
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the actual bundle size of Pytml?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The Pytml wrapper itself is ~15KB minified. The Pyodide runtime (~6MB) is loaded lazily from CDN only when you actually run Python code, so initial page load isn't blocked."
}
},
{
"@type": "Question",
"name": "Can I use Pytml with React, Vue, or other JS frameworks?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. Pytml is framework-agnostic. You can drop the script tag in any HTML page, including those generated by React or Vue. It scans the DOM for <py> tags after the framework renders."
}
},
{
"@type": "Question",
"name": "What Python packages are supported?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Any pure-Python package available on Pyodide's repository – including NumPy, Pandas, Matplotlib, SciPy, and scikit-learn. C-extensions are not supported unless compiled to WebAssembly."
}
},
{
"@type": "Question",
"name": "How does Pytml handle errors and debugging?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Python tracebacks are captured and rendered directly in the browser terminal box. Syntax errors, runtime exceptions, and import errors all appear with line numbers and stack traces, just like a local Python REPL."
}
},
{
"@type": "Question",
"name": "Is there any server-side component or data sent to a backend?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. Everything runs client-side in WebAssembly. No Python code, input, or output ever leaves your browser. This makes Pytml ideal for privacy-sensitive demos and educational tools."
}
},
{
"@type": "Question",
"name": "What are the performance limitations?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Pytml runs Python in a WebAssembly sandbox. It's roughly 2-5x slower than native CPython for CPU-bound tasks, and memory is limited to the browser's tab allocation (usually 2-4GB). Heavy number crunching may be slower than server-side Python, but for demos, data viz, and scripting, it's perfectly fine."
}
}
]
}
]
}
</script>
<!-- ========== FONTS ========== -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz@14..32&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- ========== STYLES (YOUR ORIGINAL – UNCHANGED, except minor mobile fixes below) ========== -->
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
--bg: #050505;
--accent: #3b82f6;
--accent-dark: #2563eb;
--accent-glow: rgba(59, 130, 246, 0.2);
--border: rgba(255,255,255,0.08);
--text: #e5e5e5;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: var(--bg);
color: var(--text);
font-family: 'Inter', system-ui, sans-serif;
overflow-x: hidden;
-webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }
.text-accent { color: var(--accent); }
.border-accent { border-color: var(--accent); }
.font-heading { font-family: 'Space Grotesk', sans-serif; }
.bg-noise {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 9998;
opacity: 0.03;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
}
.btn-term {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.7rem 1.3rem;
background: #0c0c0c;
border: 1px solid #27272a;
color: #b0b0b0;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
text-transform: uppercase;
transition: all 0.2s;
text-decoration: none;
touch-action: manipulation;
cursor: pointer;
min-height: 48px;
line-height: 1.2;
}
.btn-term::before { content: "> "; margin-right: 4px; color: var(--accent); }
.btn-term:hover { background: var(--accent); color: #050505; border-color: var(--accent); transform: translateX(4px); }
.btn-term:active { transform: scale(0.97); }
.card {
background: rgba(8,8,8,0.7);
backdrop-filter: blur(2px);
border: 1px solid #1e1e1e;
border-radius: 0.5rem;
padding: 1.5rem;
transition: border 0.25s, transform 0.25s;
height: 100%;
}
.card:hover { border-color: var(--accent); transform: translateY(-4px); background: rgba(59,130,246,0.02); }
.code-box {
background: #0b0b0b;
border-left: 3px solid var(--accent);
padding: 1rem;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-word;
color: #c0c0c0;
border-radius: 0 0.5rem 0.5rem 0;
max-width: 100%;
tab-size: 2;
line-height: 1.6;
}
.fade-up { opacity: 0; transform: translateY(30px); transition: all 0.7s cubic-bezier(0.2, 0.9, 0.4, 1); }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.logo-box {
display: inline-flex;
align-items: center;
gap: 0.75rem;
background: #0c0c0c;
border: 2px solid var(--accent);
padding: 0.4rem 1rem 0.4rem 0.75rem;
border-radius: 0.25rem;
box-shadow: 0 0 20px var(--accent-glow);
flex-wrap: nowrap;
max-width: 100%;
}
.logo-box img {
width: 42px;
height: 42px;
display: block;
flex-shrink: 0;
}
.logo-box .text {
font-family: 'JetBrains Mono', monospace;
font-size: 2rem;
font-weight: 700;
color: var(--accent);
letter-spacing: 0.08em;
line-height: 1.1;
white-space: nowrap;
}
.logo-box .text small {
font-size: 0.6rem;
color: #5A627A;
display: block;
letter-spacing: 0.2em;
margin-top: 0.05rem;
white-space: nowrap;
}
.badge-term {
display: inline-block;
background: #0c0c0c;
border: 1px solid #27272a;
padding: 0.2rem 0.8rem;
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
color: var(--text);
border-radius: 999px;
}
.badge-term i { color: var(--accent); }
.skill-tag {
background: #0f0f0f;
border: 1px solid #262626;
padding: 0.25rem 0.8rem;
font-size: 0.75rem;
font-family: monospace;
border-radius: 999px;
transition: all 0.2s;
white-space: nowrap;
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent); }
.footer-link { color: #5A627A; text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: var(--accent); text-decoration: underline; }
.marquee {
overflow: hidden;
mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
-webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
display: flex;
gap: 2rem;
animation: marqueeScroll 25s linear infinite;
width: max-content;
}
@keyframes marqueeScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #1f1f1f; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.pulse-ring {
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0% { transform: scale(1); opacity: 0.15; }
50% { transform: scale(1.1); opacity: 0.35; }
100% { transform: scale(1); opacity: 0.15; }
}
/* ===== YOUR MOBILE‑FIRST TWEAKS (ENHANCED FOR BETTER CENTERING & SCROLL) ===== */
@media (max-width: 640px) {
.logo-box { padding: 0.3rem 0.7rem 0.3rem 0.5rem; gap: 0.5rem; }
.logo-box img { width: 32px; height: 32px; }
.logo-box .text { font-size: 1.5rem; letter-spacing: 0.05em; }
.logo-box .text small { font-size: 0.5rem; }
.btn-term { font-size: 0.7rem; padding: 0.5rem 0.9rem; min-height: 44px; gap: 0.35rem; }
.btn-term::before { content: ">"; margin-right: 2px; }
.card { padding: 1rem; }
.code-box { font-size: 0.75rem; padding: 0.75rem; }
.hero-img-wrap img { width: 120px; height: 120px; }
.hero-img-wrap .pulse-ring { width: 160px; height: 160px; }
.marquee-track { gap: 1rem; }
.skill-tag { font-size: 0.65rem; padding: 0.2rem 0.6rem; }
/* FIX: Comparison table scroll on mobile */
.compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { min-width: 420px; }
}
@media (max-width: 480px) {
.logo-box .text { font-size: 1.25rem; }
.logo-box img { width: 28px; height: 28px; }
.logo-box .text small { font-size: 0.45rem; }
.btn-term { font-size: 0.65rem; padding: 0.4rem 0.7rem; min-height: 40px; }
.hero-img-wrap img { width: 100px; height: 100px; }
.hero-img-wrap .pulse-ring { width: 140px; height: 140px; }
.code-box { font-size: 0.65rem; padding: 0.5rem; }
.badge-term { font-size: 0.6rem; padding: 0.15rem 0.5rem; }
.card h3 { font-size: 1rem; }
.skill-tag { font-size: 0.55rem; padding: 0.15rem 0.5rem; }
.marquee-track { gap: 0.75rem; }
}
@media (max-width: 380px) {
.logo-box .text { font-size: 1rem; }
.logo-box img { width: 24px; height: 24px; }
.logo-box .text small { font-size: 0.4rem; }
.btn-term { font-size: 0.55rem; padding: 0.3rem 0.6rem; min-height: 36px; }
.hero-img-wrap img { width: 80px; height: 80px; }
.hero-img-wrap .pulse-ring { width: 110px; height: 110px; }
.code-box { font-size: 0.6rem; padding: 0.4rem; }
/* Tighter padding on ultra-small screens */
section { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.compare-table { min-width: 360px; font-size: 0.55rem; }
.compare-table th, .compare-table td { padding: 0.3rem 0.2rem; }
}
@media (prefers-reduced-motion: reduce) {
.fade-up { opacity: 1; transform: none; transition: none; }
.marquee-track { animation: none; }
.pulse-ring { animation: none; }
.btn-term:hover { transform: none; }
.card:hover { transform: none; }
}
/* ===== COMPARISON TABLE ===== */
.compare-table {
width: 100%;
border-collapse: collapse;
font-size: 0.8rem;
text-align: left;
}
.compare-table th,
.compare-table td {
padding: 0.75rem 0.5rem;
border-bottom: 1px solid #1e1e1e;
}
.compare-table th {
color: var(--accent);
font-family: 'JetBrains Mono', monospace;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
font-size: 0.7rem;
}
.compare-table td {
color: #b0b0b0;
}
.compare-table .highlight {
color: var(--text);
font-weight: 500;
}
.compare-table .check { color: var(--accent); }
.compare-table .cross { color: #555; }
@media (max-width: 640px) {
.compare-table th,
.compare-table td {
padding: 0.5rem 0.3rem;
font-size: 0.65rem;
}
.compare-table th { font-size: 0.6rem; }
}
</style>
</head>
<body>
<div class="bg-noise"></div>
<!-- ===== HEADER WITH LOGO (ONLY ONE – KEPT THIS) ===== -->
<header class="relative z-10 border-b border-white/5 py-4 px-4 sm:px-6">
<div class="max-w-6xl mx-auto flex items-center justify-between flex-wrap gap-4">
<div class="logo-box">
<img src="/android-chrome-192x192.png" alt="Pytml logo" width="42" height="42" loading="lazy">
<div class="text">
PYTML
<small>python → html</small>
</div>
</div>
<nav aria-label="Primary navigation">
<ul class="flex flex-wrap gap-4 text-sm mono text-gray-400">
<li><a href="#compare" class="hover:text-accent transition">Comparison</a></li>
<li><a href="#features" class="hover:text-accent transition">Features</a></li>
<li><a href="#code" class="hover:text-accent transition">Code</a></li>
<li><a href="#faq" class="hover:text-accent transition">FAQ</a></li>
<li><a href="https://nodex-ar.github.io/Pytml/demo.html" target="_blank" rel="noopener noreferrer" class="hover:text-accent transition">Demo</a></li>
<li><a href="https://github.com/NodeX-AR/Pytml" target="_blank" rel="noopener noreferrer" class="hover:text-accent transition">GitHub</a></li>
</ul>
</nav>
</div>
</header>
<!-- ===== MAIN CONTENT ===== -->
<main class="relative z-10">
<!-- ===== HERO (FIXED CENTERING) ===== -->
<section class="min-h-screen flex items-center justify-center px-4 py-12 sm:px-6 sm:py-20">
<div class="max-w-6xl mx-auto w-full">
<div class="flex flex-col md:flex-row items-center gap-6 md:gap-12">
<div class="flex-1 text-center md:text-left">
<div class="fade-up mt-3 md:mt-4">
<h1 class="text-base sm:text-xl md:text-2xl text-gray-300 mono">$> Run Python in your browser – no backend, no bullshit</h1>
</div>
<div class="fade-up mt-2">
<span class="badge-term"><i class="fas fa-bolt text-accent mr-1"></i> Lightweight alternative to PyScript & Flask</span>
</div>
<div class="fade-up mt-3">
<p class="text-gray-400 max-w-lg mx-auto md:mx-0 leading-relaxed text-sm sm:text-base">
A zero‑config <strong>15KB JavaScript library</strong> that lets you embed <strong>Python code</strong> directly in your <strong>HTML</strong>.
Handles <code class="text-accent">print()</code>, <code class="text-accent">input()</code>, and errors – live, in the browser.
<span class="block mt-1 text-xs text-gray-500">No server. No heavy frameworks. Just <code class="text-accent"><py></code> and go.</span>
</p>
</div>
<div class="fade-up mt-5 flex flex-wrap gap-2 sm:gap-3 justify-center md:justify-start">
<a href="https://nodex-ar.github.io/Pytml/demo.html" target="_blank" class="btn-term"><i class="fas fa-play"></i> Live Demo</a>
<a href="#compare" class="btn-term"><i class="fas fa-balance-scale"></i> Compare</a>
<a href="#code" class="btn-term"><i class="fas fa-code"></i> See Code</a>
<a href="https://github.com/NodeX-AR/Pytml" target="_blank" class="btn-term"><i class="fab fa-github"></i> GitHub</a>
</div>
<div class="fade-up mt-4 flex flex-wrap gap-2 justify-center md:justify-start">
<span class="badge-term"><i class="fas fa-check-circle mr-1"></i> NITI Frontier Tech</span>
<span class="badge-term"><i class="fas fa-weight-hanging mr-1"></i> 15KB wrapper</span>
</div>
</div>
<!-- FIXED: added items-center and mx-auto to ensure dead-center on mobile -->
<div class="flex-1 flex justify-center items-center hero-img-wrap">
<div class="relative w-40 h-40 sm:w-60 sm:h-60 md:w-72 md:h-72 flex items-center justify-center mx-auto">
<div class="absolute inset-0 rounded-full border border-[var(--accent)] opacity-20 pulse-ring"></div>
<img src="/android-chrome-192x192.png" alt="Pytml" class="w-28 h-28 sm:w-40 sm:h-40 md:w-56 md:h-56 object-contain" style="filter: drop-shadow(0 0 30px rgba(59,130,246,0.2));" loading="lazy">
</div>
</div>
</div>
</div>
</section>
<!-- ===== WHAT IS PYTML? (unchanged) ===== -->
<section class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-5xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-3"><span class="text-accent">//</span> The Lazy Bridge</h2>
</div>
<div class="grid sm:grid-cols-2 gap-6 sm:gap-8 mt-8">
<div class="fade-up space-y-4 text-gray-300 leading-relaxed text-sm sm:text-base">
<p><strong>Pytml</strong> is a minimal <strong>JavaScript library</strong> that lets you write <span class="text-accent font-bold">Python inside your HTML</span> – no server, no setup.</p>
<p>It wraps <span class="text-accent">Pyodide</span> (Python compiled to <strong>WebAssembly</strong>) and automatically redirects <code class="text-accent">print()</code> to a nice terminal box, and turns <code class="text-accent">input()</code> into a live form.</p>
<p>Built by <span class="text-accent">Aswanth R (NodeX‑AR)</span> – a Class 12 student who wanted a lazy way to show <strong>Python projects</strong> live on the web.</p>
</div>
<div class="fade-up card">
<h3 class="text-base sm:text-lg font-bold font-heading mb-2">Why it exists</h3>
<ul class="space-y-2 text-gray-400 text-xs sm:text-sm mono">
<li><span class="text-accent">➜</span> No Flask, no Django, no server</li>
<li><span class="text-accent">➜</span> Just <span class="text-white"><py>code</py></span></li>
<li><span class="text-accent">➜</span> Works offline after first load</li>
<li><span class="text-accent">➜</span> Less than 15KB of JS</li>
</ul>
</div>
</div>
</div>
</section>
<!-- ===== HONEST COMPARISON (FIXED MOBILE SCROLL) ===== -->
<section id="compare" class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-5xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-3"><span class="text-accent"></span>Comparison</h2>
<p class="text-gray-400 max-w-2xl mx-auto text-sm sm:text-base">Just real trade‑offs. Pytml is <strong>not</strong> a Flask replacement for backends, and it's <strong>not</strong> as feature‑heavy as PyScript. But for <strong>static pages, demos, and education</strong>, it wins on speed, size, and simplicity.</p>
</div>
<div class="fade-up mt-8 card overflow-x-auto compare-table-wrap">
<table class="compare-table min-w-[420px]">
<thead>
<tr>
<th>Feature</th>
<th>Pytml</th>
<th>PyScript</th>
<th>Flask</th>
</tr>
</thead>
<tbody>
<tr>
<td class="highlight">Setup time</td>
<td><span class="check">✔</span> 1 min (1 tag)</td>
<td><span class="cross">~</span> 5 min (config)</td>
<td><span class="cross">~</span> 10+ min (env)</td>
</tr>
<tr>
<td class="highlight">Server required</td>
<td><span class="check">✔</span> No (static)</td>
<td><span class="check">✔</span> No (static)</td>
<td><span class="cross">✘</span> Yes (backend)</td>
</tr>
<tr>
<td class="highlight">Wrapper size</td>
<td><span class="check">✔</span> <strong>~15 KB</strong></td>
<td><span class="cross">~</span> Larger bundle</td>
<td><span class="cross">—</span> N/A</td>
</tr>
<tr>
<td class="highlight">Pyodide load</td>
<td><span class="check">✔</span> Lazy</td>
<td><span class="cross">✘</span> Eager</td>
<td><span class="cross">—</span> N/A</td>
</tr>
<tr>
<td class="highlight">Configuration</td>
<td><span class="check">✔</span> Zero (<code><py></code>)</td>
<td><span class="cross">~</span> <code><py-config></code></td>
<td><span class="cross">~</span> Full structure</td>
</tr>
<tr>
<td class="highlight">Best for</td>
<td><span class="check">✔</span> Demos, education</td>
<td><span class="check">✔</span> Complex browser apps</td>
<td><span class="check">✔</span> Full‑stack apps</td>
</tr>
</tbody>
</table>
<p class="text-xs text-gray-500 mt-4 text-center">* Pyodide (~6MB) loaded from CDN – same for both. Pytml adds a <strong>~15KB</strong> wrapper + lazy loading.</p>
</div>
</div>
</section>
<!-- ===== HOW IT WORKS (unchanged) ===== -->
<section id="code" class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-5xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-6"><span class="text-accent">#</span> How It Works</h2>
</div>
<div class="grid sm:grid-cols-2 gap-6 sm:gap-8">
<div class="fade-up space-y-3 text-gray-300 leading-relaxed mono text-xs sm:text-sm">
<div class="flex gap-3"><span class="text-accent font-bold">1.</span> Loads <strong>Pyodide</strong> (WebAssembly) from CDN</div>
<div class="flex gap-3"><span class="text-accent font-bold">2.</span> Overrides <code>print()</code> and <code>input()</code></div>
<div class="flex gap-3"><span class="text-accent font-bold">3.</span> Finds all <code>py script</code> or <code><script type="text/python"></code> tags</div>
<div class="flex gap-3"><span class="text-accent font-bold">4.</span> Runs Python, catches output and errors</div>
<div class="flex gap-3"><span class="text-accent font-bold">5.</span> Displays everything in a styled terminal</div>
</div>
<div class="fade-up code-box">
<!DOCTYPE html>
<html>
<head>
<script src="https://pytml.vercel.app/pytml.js"></script>
</head>
<body>
<py>
print("Hello, world!")
name = input("Your name? ")
print(f"Hi {name}!")
</py>
</body>
</html>
</div>
</div>
</div>
</section>
<!-- ===== FEATURES (your original 4 cards) ===== -->
<section id="features" class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-6xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-6"><span class="text-accent"></span> Features</h2>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4">
<div class="fade-up card text-center"><i class="fas fa-bolt text-accent text-2xl mb-2"></i><p class="text-sm font-semibold">Zero config</p><p class="text-xs text-gray-500">Just a script tag</p></div>
<div class="fade-up card text-center"><i class="fas fa-terminal text-accent text-2xl mb-2"></i><p class="text-sm font-semibold">Real I/O</p><p class="text-xs text-gray-500">print() and input() work</p></div>
<div class="fade-up card text-center"><i class="fas fa-mobile-alt text-accent text-2xl mb-2"></i><p class="text-sm font-semibold">Any device</p><p class="text-xs text-gray-500">Works on phones too</p></div>
<div class="fade-up card text-center"><i class="fas fa-code text-accent text-2xl mb-2"></i><p class="text-sm font-semibold">Open source</p><p class="text-xs text-gray-500">Apache 2.0</p></div>
</div>
</div>
</section>
<!-- ===== USE CASES ===== -->
<section class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-6xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-3"><span class="text-accent"></span> When to Use Pytml</h2>
<p class="text-gray-400 max-w-2xl mx-auto mb-8 text-sm sm:text-base">Be honest – Pytml shines here, not everywhere.</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div class="fade-up card">
<h3 class="text-sm font-bold">Education & Tutorials</h3>
<p class="text-xs text-gray-400 mt-1">Embed live Python in courseware. Students run code without installing anything – instant feedback.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">Technical Blogs</h3>
<p class="text-xs text-gray-400 mt-1">Interactive code snippets – readers tweak and run Python right in the article. No server costs.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">Data Science Demos</h3>
<p class="text-xs text-gray-400 mt-1">Show visualisations or data processing with Python, all client‑side. Perfect for portfolio projects.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">Rapid Prototyping</h3>
<p class="text-xs text-gray-400 mt-1">Test Python logic in the browser without spinning up a Flask app. Great for hackathons.</p>
</div>
<div class="fade-up card sm:col-span-2 text-center border-accent/20">
<p class="text-xs text-gray-400"><span class="text-accent font-bold">Not for:</span> Heavy backend processing, database operations, or production APIs – use Flask for that. Pytml is client‑side only.</p>
</div>
</div>
</div>
</section>
<!-- ===== TECH STACK MARQUEE (unchanged) ===== -->
<section class="py-12 sm:py-16 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-6xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-xl sm:text-2xl font-bold font-heading mb-4"><span class="text-accent">🧩</span> Built With</h2>
</div>
<div class="marquee">
<div class="marquee-track">
<span class="skill-tag"><i class="fab fa-python"></i> Python</span>
<span class="skill-tag"><i class="fab fa-js"></i> JavaScript</span>
<span class="skill-tag"><i class="fas fa-globe"></i> WebAssembly</span>
<span class="skill-tag"><i class="fas fa-database"></i> Pyodide</span>
<span class="skill-tag"><i class="fas fa-code"></i> ES6</span>
<span class="skill-tag"><i class="fab fa-html5"></i> HTML5</span>
<span class="skill-tag"><i class="fas fa-terminal"></i> Bash</span>
<span class="skill-tag"><i class="fab fa-github"></i> GitHub</span>
<span class="skill-tag"><i class="fas fa-cloud"></i> Vercel</span>
<span class="skill-tag"><i class="fas fa-shield-alt"></i> Apache 2.0</span>
<span class="skill-tag"><i class="fab fa-python"></i> Python</span>
<span class="skill-tag"><i class="fab fa-js"></i> JavaScript</span>
<span class="skill-tag"><i class="fas fa-globe"></i> WebAssembly</span>
<span class="skill-tag"><i class="fas fa-database"></i> Pyodide</span>
<span class="skill-tag"><i class="fas fa-code"></i> ES6</span>
<span class="skill-tag"><i class="fab fa-html5"></i> HTML5</span>
<span class="skill-tag"><i class="fas fa-terminal"></i> Bash</span>
<span class="skill-tag"><i class="fab fa-github"></i> GitHub</span>
<span class="skill-tag"><i class="fas fa-cloud"></i> Vercel</span>
<span class="skill-tag"><i class="fas fa-shield-alt"></i> Apache 2.0</span>
</div>
</div>
</div>
</section>
<!-- ===== UPDATED FAQ (actually useful) ===== -->
<section id="faq" class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-4xl mx-auto">
<div class="fade-up text-center">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-6"><span class="text-accent"></span> Frequently Asked Questions</h2>
</div>
<div class="space-y-4">
<div class="fade-up card">
<h3 class="text-sm font-bold">What is the actual bundle size of Pytml?</h3>
<p class="text-xs text-gray-400 mt-1">The Pytml wrapper itself is <strong>~15KB</strong> minified. The Pyodide runtime (~6MB) is loaded lazily from CDN only when you actually run Python code, so initial page load isn't blocked.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">Can I use Pytml with React, Vue, or other JS frameworks?</h3>
<p class="text-xs text-gray-400 mt-1">Yes. Pytml is framework-agnostic. You can drop the script tag in any HTML page, including those generated by React or Vue. It scans the DOM for <code><py></code> tags after the framework renders.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">What Python packages are supported?</h3>
<p class="text-xs text-gray-400 mt-1">Any pure-Python package available on Pyodide's repository – including NumPy, Pandas, Matplotlib, SciPy, and scikit-learn. C-extensions are not supported unless compiled to WebAssembly.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">How does Pytml handle errors and debugging?</h3>
<p class="text-xs text-gray-400 mt-1">Python tracebacks are captured and rendered directly in the browser terminal box. Syntax errors, runtime exceptions, and import errors all appear with line numbers and stack traces, just like a local Python REPL.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">Is there any server-side component or data sent to a backend?</h3>
<p class="text-xs text-gray-400 mt-1">No. Everything runs client-side in WebAssembly. No Python code, input, or output ever leaves your browser. This makes Pytml ideal for privacy-sensitive demos and educational tools.</p>
</div>
<div class="fade-up card">
<h3 class="text-sm font-bold">What are the performance limitations?</h3>
<p class="text-xs text-gray-400 mt-1">Pytml runs Python in a WebAssembly sandbox. It's roughly <strong>2-5x slower</strong> than native CPython for CPU-bound tasks, and memory is limited to the browser's tab allocation (usually 2-4GB). Heavy number crunching may be slower than server-side Python, but for demos, data viz, and scripting, it's perfectly fine.</p>
</div>
</div>
</div>
</section>
<!-- ===== TESTIMONIALS – REMOVED (no fake reviews) ===== -->
<!-- ===== LIVE DEMO (unchanged) ===== -->
<section id="demo" class="py-16 sm:py-20 px-4 sm:px-6 border-t border-white/5">
<div class="max-w-4xl mx-auto text-center">
<div class="fade-up">
<h2 class="text-2xl sm:text-3xl md:text-4xl font-bold font-heading mb-3"><span class="text-accent">[</span> Try It <span class="text-accent">]</span></h2>
</div>
<div class="fade-up">
<p class="text-gray-300 max-w-xl mx-auto mb-6 sm:mb-8 text-sm sm:text-base">See Pytml in action – run <strong>Python code</strong> live in your browser.</p>
</div>
<div class="fade-up flex flex-wrap justify-center gap-2 sm:gap-3 md:gap-5">
<a href="https://nodex-ar.github.io/Pytml/demo.html" target="_blank" class="btn-term"><i class="fas fa-globe"></i> Live Demo</a>
<a href="https://github.com/NodeX-AR/Pytml" target="_blank" class="btn-term"><i class="fab fa-github"></i> GitHub Repo</a>
<a href="https://dev.to/nodex-ar/pytml-running-python-in-the-browser-without-a-backend-1nn4" target="_blank" class="btn-term"><i class="fas fa-pen"></i> DEV Article</a>
<a href="https://devpost.com/software/pytml" target="_blank" class="btn-term"><i class="fas fa-trophy"></i> Devpost</a>
</div>
<div class="fade-up mt-8 sm:mt-10 text-xs sm:text-sm text-gray-500 mono">
Made from <span class="text-accent">Laziness</span> of
<a href="https://a-r.is-a.dev" target="_blank" class="text-accent hover:underline">Aswanth R (NodeX-AR)</a>
</div>
</div>
</section>
</main>
<!-- ===== FOOTER ===== -->
<footer class="py-6 sm:py-8 px-4 sm:px-6 border-t border-white/5 text-center text-xs text-gray-600">
<p>
<a href="https://a-r.is-a.dev" target="_blank" class="footer-link">Aswanth R (NodeX-AR)</a> ·
<a href="https://github.com/NodeX-AR/Pytml" target="_blank" class="footer-link">GitHub</a> ·
<a href="https://nodex-ar.github.io/Pytml/demo.html" target="_blank" class="footer-link">Live Demo</a> ·
<a href="https://github.com/NodeX-AR/Pytml/blob/main/README.md" target="_blank" class="footer-link">Docs</a>
</p>
<p class="mt-1 text-gray-700">Open-source under Apache 2.0 · 2026</p>
</footer>
<!-- ========== SCRIPTS (unchanged) ========== -->
<script>
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => { if (entry.isIntersecting) entry.target.classList.add('visible'); });
}, { threshold: 0.1 });
document.querySelectorAll('.fade-up').forEach(el => observer.observe(el));
document.querySelector('a[href="#code"]')?.addEventListener('click', (e) => {
e.preventDefault();
document.getElementById('code').scrollIntoView({ behavior: 'smooth' });
});
document.querySelectorAll('nav a[href^="#"]').forEach(link => {
link.addEventListener('click', (e) => {
const target = document.querySelector(link.getAttribute('href'));
if (target) {
e.preventDefault();
target.scrollIntoView({ behavior: 'smooth' });
}
});
});
</script>
</body>
</html>