-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
258 lines (234 loc) · 8.67 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PythonMonkey - JavaScript meets Python</title>
<link rel="stylesheet" href="styles.css">
<meta name="description" content="PythonMonkey allows Python developers to use complex JavaScript libraries without awkward syntax or performance penalties.">
<meta property="og:title" content="PythonMonkey - JavaScript meets Python">
<meta property="og:description" content="PythonMonkey allows Python developers to use complex JavaScript libraries without awkward syntax or performance penalties.">
<meta property="og:image" content="https://pythonmonkey.io/images/pythonmonkey-site-preview.png">
<meta property="og:url" content="https://pythonmonkey.io/">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="PythonMonkey - JavaScript meets Python">
<meta name="twitter:description" content="PythonMonkey allows Python developers to use complex JavaScript libraries without awkward syntax or performance penalties.">
<meta name="twitter:image" content="https://pythonmonkey.io/images/pythonmonkey-site-preview.png">
<style type="text/css">
#gdpr-dialog A
{
color: #c4c5c6;
text-decoration: none;
}
#gdpr-dialog A:hover
{
text-decoration: underline;
}
A.no-show, SPAN.no-show
{
opacity: 0;
position: fixed;
top: 0;
left: 0;
height: 0;
width: 0;
}
DIV#gdpr-blocker
{
position: fixed;
overflow: hidden;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.7);
transition: all 450ms ease-out;
}
BODY[gdpr-query=complete] DIV#gdpr-blocker
{
opacity: 0;
pointer-events: none;
}
DIV#gdpr-dialog
{
position: fixed;
display: inline-block;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 5px;
border: 1px solid #666;
background-color: #1a1d21;
padding: 1em;
width: 80%;
max-width: 30em;
transition: all 150ms ease-in;
opacity: 0.9;
box-shadow: 0px 0px 100px black;
}
BODY[gdpr-query=complete] DIV#gdpr-dialog,
BODY[gdpr-query=complete] DIV#gdpr-dialog BUTTON
{
opacity: 0;
font-size: 0;
border: 0;
padding: 0;
color: #000;
}
DIV#gdpr-dialog
{
text-align: center;
}
DIV#gdpr-dialog P
{
text-align: left;
}
DIV#gdpr-dialog BUTTON
{
background-color: #102338;
color: #c4c5c6;
padding: 0.5em;
margin-bottom: 1em;
border: 1px solid black;
cursor: pointer;
}
DIV#gdpr-dialog BUTTON:hover
{
border: 1px solid #102338;
}
DIV#gdpr-dialog BUTTON.default-action
{
background-color: #fecd45;
color: #102338;
}
DIV#gdpr-dialog BUTTON.default-action:hover
{
border: 1px solid #fecd45;
}
DIV#gdpr-dialog BUTTON:active
{
position: relative;
top: 1px;
left: 1px;
filter: brightness(0.9);
}
</style>
</head>
<body>
<span class='no-show'>
PythonMonkey allows Python developers to use complex JavaScript libraries without awkward syntax or performance penalties.
This deep integration of JavaScript and Python is achieved by embedding a <a href="https://spidermonkey.dev/">SpiderMonkey</a>
runtime in the Python VM. PythonMonkey makes it possible to share data, functions, events, etc, across runtimes. Data sharing
respects host language idioms and shares memory between runtimes whenever possible.
</span>
<a class='no-show' href="https://github.com/Distributive-Network/PythonMonkey#pythonmonkey">Source Code</a>
<a class='no-show' href="https://pypi.org/project/pythonmonkey/">PyPI PIP package</a>
<div class="maincontent">
<header>
<div class="logo">
<a href="https://pypi.org/project/pythonmonkey/"><img src="./PythonMonkeyText.png" alt="PythonMonkey Logo"></a>
</div>
<nav>
<ul>
<li><a href="https://docs.pythonmonkey.io/">Documentation</a></li>
<li><a href="https://github.com/Distributive-Network/PythonMonkey/">GitHub</a></li>
<li><a href="https://github.com/Distributive-Network/PythonMonkey/issues">Issues</a></li>
<li><a href="#blog">Blog</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
</header>
<main>
<div class="central-logo">
<a href="https://pypi.org/project/pythonmonkey/"><img src="./pythonmonkey-icon.png" alt="PythonMonkey Logo"></a>
<h1>
Seamless interop between<br>
Python and JavaScript.
</h1>
</div>
<div class="cta">
<pre>$ pip install pythonmonkey</pre>
</div>
<div class="code-snippet">
<pre>
<span class="yellow">>>> import pythonmonkey as pm</span>
<span class="yellow">>>> hello = pm.eval(" 'Hello World'.toUpperCase(); ")</span>
<span class="yellow">>>> print(hello)</span>
<span class="yellow">'HELLO WORLD'</span>
</pre>
</div>
</main>
</div>
<!-- About Section -->
<section id="about">
<h2>About PythonMonkey</h2>
<p>
PythonMonkey embeds <a href="https://spidermonkey.dev/">Mozilla's SpiderMonkey JavaScript/WebAssembly</a> Engine in Python with high level bindings. It enables Python developers to leverage the JavaScript ecosystem through Python with ease and excellent CPU/memory performance.
</p>
<br>
<p>
Pythonmonkey was built by <a href="https://www.linkedin.com/posts/will-pringle_javascript-python-activity-7176357433257156608-HBBP?utm_source=share&utm_medium=member_desktop">a team</a> at <a href="https://distributive.network/">Distributive</a> in order to port complex JavaScript libraries to Python while only having to maintain one codebase. PythonMonkey powers <a href="https://github.com/Distributive-Network/bifrost2">Distributive's Python SDK for DCP</a>.
</p>
</section>
<!-- Blog Section -->
<section id="blog">
<h2>Blog</h2>
<ul>
<li><a href="https://distributive.network/jobs/python-monkey">High-Level SpiderMonkey Bindings to Python with PythonMonkey</a></li>
<li><a href="https://thenewstack.io/python-meets-javascript-wasm-with-the-magic-of-pythonmonkey/">Python Meets JavaScript, Wasm With the Magic of PythonMonkey</a></li>
<li><a href="https://medium.com/@willkantorpringle/executing-rust-in-python-using-webassembly-d361eb5583da">Executing Rust in Python using PythonMonkey and WebAssembly</a></li>
<li><a href="https://medium.com/@willkantorpringle/calling-c-function-from-python-using-webassembly-63a305248951">Executing C in Python using PythonMonkey and WebAssembly</a></li>
<br>
<iframe width="560" height="315" src="https://www.youtube.com/embed/UmlSryXsh30?si=bGj9QgxCOdUolhYl" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</ul>
</section>
<script>
'use strict';
const gtagHTML = `
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-F6ZF7J18CR"></sc${''}ript>
<script>
</sc${''}ript>
`;
function setTracking(allow)
{
document.body.setAttribute('gdpr-query', 'complete');
window.localStorage.setItem('gdpr-query', JSON.stringify(allow));
window.setTimeout(() => {
console.log('allow-tracking=', allow);
if (allow)
{
const gaScript = document.createElement('SCRIPT');
gaScript.setAttribute('type', 'text/javascript');
gaScript.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=G-F6ZF7J18CR');
gaScript.onload = function gaScript$onload() {
console.debug('loaded google analytics');
window.dataLayer = window.dataLayer || [];
function gtag()
{
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-F6ZF7J18CR');
};
gaScript.onerror = console.error;
document.body.appendChild(gaScript);
}
}, 30);
}
if (window.localStorage.getItem('gdpr-query'))
{
const trackingAllowed = JSON.parse(window.localStorage.getItem('gdpr-query'));
if (trackingAllowed)
setTracking(true);
}
</script>
<div id="gdpr-blocker">
<div id="gdpr-dialog">
<p>This site uses cookies to track unique visitors via Google Analytics. <a href="https://distributive.network">Distributive</a> does not and will not share this data with anyone.</p>
<button onclick='setTracking(false)'>Do Not Track</button>
<button onclick='setTracking(true)' class='default-action'>Allow Cookies</button>
</div>
</div>
</body>
</html>