CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/features/python.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Layout } from "antd";
7
8
import { Icon } from "@cocalc/frontend/components/icon";
9
import Code from "components/landing/code";
10
import Content from "components/landing/content";
11
import Footer from "components/landing/footer";
12
import Head from "components/landing/head";
13
import Header from "components/landing/header";
14
import Info from "components/landing/info";
15
import LaTeX from "components/landing/latex";
16
import Pitch from "components/landing/pitch";
17
import Publishing from "components/landing/publishing";
18
import SignIn from "components/landing/sign-in";
19
import Snapshots from "components/landing/snapshots";
20
import { Paragraph, Title } from "components/misc";
21
import A from "components/misc/A";
22
import { Customize } from "lib/customize";
23
import withCustomize from "lib/with-customize";
24
25
import CommandLineTerminal from "public/features/cocalc-frame-editor-python.png";
26
import FormatGIF from "public/features/cocalc-jupyter-format-python.gif";
27
import SideChatImage from "public/features/cocalc-jupyter-python-sidechat.png";
28
import CoCalcLaTeXPythonTex from "public/features/cocalc-latex-pythontex.png";
29
import CocalcPythonJupyter from "public/features/cocalc-python-jupyter.png";
30
import CollabRTC from "public/features/cocalc-real-time-jupyter.png";
31
import FrameEditorPython from "public/features/frame-editor-python.png";
32
import PythonLogo from "public/features/python-logo.svg";
33
34
const component = "Python";
35
const title = `Run ${component} Online`;
36
37
export default function Octave({ customize }) {
38
return (
39
<Customize value={customize}>
40
<Head title={title} />
41
<Layout>
42
<Header page="features" subPage="python" runnableTag="py" />
43
<Layout.Content>
44
<Content
45
landing
46
startup={component}
47
body={PythonLogo}
48
title={title}
49
subtitle={
50
<>
51
<div>
52
Run {component} scripts,{" "}
53
<A href="/features/jupyter-notebook">Jupyter notebooks</A>, or
54
even a <A href="/features/x11">graphical application</A> in a
55
full, remote {component} environment.
56
</div>
57
</>
58
}
59
subtitleBelow={true}
60
image={FrameEditorPython}
61
/>
62
63
<Pitch
64
col1={
65
<>
66
<Title level={2}>
67
<Icon name="global" /> CoCalc covers all the bases
68
</Title>
69
<Paragraph>
70
<ul>
71
<li>
72
<strong>Data Science and Machine Learning</strong>:{" "}
73
<A href="https://doc.cocalc.com/howto/upload.html">
74
Upload
75
</A>{" "}
76
your datafiles and analyze them using{" "}
77
<A href="https://www.tensorflow.org/">Tensorflow</A>,{" "}
78
<A href="https://scikit-learn.org/stable/">
79
scikit-learn
80
</A>
81
, <A href="https://keras.io/">Keras</A>, ... including an{" "}
82
<A href="https://www.anaconda.com/distribution/">
83
Anaconda
84
</A>{" "}
85
environment.
86
</li>
87
<li>
88
<strong>Mathematics</strong>:{" "}
89
<A href="https://www.sympy.org">SymPy</A>,{" "}
90
<A href="https://www.sagemath.org">SageMath</A>, ...
91
</li>
92
<li>
93
<strong>Statistics</strong>:{" "}
94
<A href="https://pandas.pydata.org/">pandas</A>,{" "}
95
<A href="https://www.statsmodels.org/">statsmodels</A>,{" "}
96
<A href="https://rpy2.github.io/">rpy2 (R bridge)</A>, ...
97
</li>
98
<li>
99
<strong>Visualization</strong>:{" "}
100
<A href="https://matplotlib.org/">matplotlib</A>,{" "}
101
<A href="https://plot.ly/python/plotly-fundamentals/">
102
plotly
103
</A>
104
, <A href="https://seaborn.pydata.org/">seaborn</A>, ...
105
</li>
106
<li>
107
<strong>Teaching</strong>: learn Python online or teach a
108
course.
109
</li>
110
</ul>
111
</Paragraph>
112
<Paragraph>
113
Find more details in the{" "}
114
<A href="/software/python">
115
list of installed Python libraries
116
</A>
117
.
118
</Paragraph>
119
</>
120
}
121
col2={
122
<>
123
<Title level={2}>
124
<Icon name="lightbulb" /> Zero setup
125
</Title>
126
<Paragraph>
127
<ul>
128
<li>
129
Immediately start working by creating or{" "}
130
<A href="https://doc.cocalc.com/howto/upload.html">
131
uploading
132
</A>
133
,{" "}
134
<A href="/features/jupyter-notebook">Jupyter Notebooks</A>{" "}
135
or Python scripts.
136
</li>
137
<li>
138
No need to download and install{" "}
139
<A href="https://www.python.org">Python</A>,{" "}
140
<A href="https://www.anaconda.com/distribution/">
141
Anaconda
142
</A>
143
, or other Python environments.
144
</li>
145
<li>
146
CoCalc already{" "}
147
<A href="/software/python">provides many packages</A> for
148
you.
149
</li>
150
<li>
151
The <A href="/features/latex-editor">LaTeX editor</A> is
152
already integrated with{" "}
153
<A href="https://ctan.org/pkg/pythontex">PythonTeX</A> and{" "}
154
<A href="https://ctan.org/pkg/sagetex">SageTeX</A>.
155
</li>
156
</ul>
157
</Paragraph>
158
</>
159
}
160
/>
161
162
<SignIn startup={component} />
163
164
<Info.Heading
165
description={
166
<>There are many ways to use {component} online via CoCalc.</>
167
}
168
>
169
Feature Overview
170
</Info.Heading>
171
172
<Info
173
title="Collaborative workspaces"
174
icon="users"
175
image={CollabRTC}
176
anchor="a-collaboration"
177
alt="Editing a Jupyter notebook in two windows at the same time"
178
>
179
<Paragraph>
180
As the name suggests, CoCalc's strength is{" "}
181
<strong>online code collaboration</strong>. Collaboration applies
182
to editing plain Python files,{" "}
183
<A href="https://doc.cocalc.com/sagews.html">Sage Worksheets</A>,{" "}
184
<A href="/features/jupyter-notebook">Jupyter Notebooks</A>, and
185
much more.
186
</Paragraph>
187
<Paragraph>
188
This enables you to work more effectively as a team to solve the
189
challenges of data science, machine learning and statistics. Every
190
collaborator is always looking at the most recent state of files,
191
and they experience and inspect the same Python state.
192
</Paragraph>
193
<Paragraph>
194
You can{" "}
195
<A href="https://doc.cocalc.com/chat.html">create chatrooms</A>{" "}
196
and get help via{" "}
197
<A href="https://doc.cocalc.com/chat.html">side chat</A> by
198
@mentioning collaborators.
199
</Paragraph>
200
</Info>
201
202
<Info
203
title="Python in Jupyter Notebooks"
204
icon="ipynb"
205
image={CocalcPythonJupyter}
206
anchor="a-jupyternotebook"
207
wide
208
alt="Plotting using Matplotlib and Numpy in a Jupyter notebook"
209
>
210
<Paragraph>
211
CoCalc offers a{" "}
212
<strong>
213
<A href="/features/jupyter-notebook">complete rewrite</A>
214
</strong>{" "}
215
of the classical{" "}
216
<A href="http://jupyter.org/">Jupyter notebook</A> interface. It
217
is tightly integrated into CoCalc and adds realtime collaboration,{" "}
218
<A href="http://doc.cocalc.com/jupyter.html">
219
TimeTravel history and much more
220
</A>
221
.
222
</Paragraph>
223
<Paragraph>
224
The user interface is very similar to Jupyter classic. It uses the
225
same underlying Jupyter notebook file format, so you can download
226
your <Code>*.ipynb</Code> file at any time and continue working
227
locally.
228
</Paragraph>
229
<Paragraph>
230
There are several{" "}
231
<A href="/software/python">Python environments available</A>.
232
</Paragraph>
233
<Paragraph>
234
You can also easily run{" "}
235
<A href="https://doc.cocalc.com/jupyter.html#classical-versus-cocalc">
236
Jupyter Classical
237
</A>{" "}
238
and JupyterLab in any CoCalc project.
239
</Paragraph>
240
</Info>
241
242
<SignIn startup={component} />
243
244
<Info
245
title={
246
<>
247
<LaTeX /> support for PythonTeX/SageTeX
248
</>
249
}
250
icon="tex-file"
251
image={CoCalcLaTeXPythonTex}
252
anchor="a-latex"
253
alt="Using PythonTex with LaTeX"
254
wide
255
below={
256
<>
257
<Paragraph>
258
Combined, this means you can do{" "}
259
<strong>your entire workflow online on CoCalc</strong>:
260
</Paragraph>
261
<Paragraph>
262
<ol>
263
<li>
264
<A href="https://doc.cocalc.com/howto/upload.html">
265
Upload
266
</A>{" "}
267
or fetch your datasets,
268
</li>
269
<li>
270
Use <A href="#a-jupyternotebook">Jupyter Notebooks</A> to
271
explore the data, process it, and calculate your results,
272
</li>
273
<li>
274
<A href="#a-chat">Discuss</A> and{" "}
275
<A href="#a-collaboration">collaborate</A> with your
276
research team,
277
</li>
278
<li>Write your research paper in a LaTeX document,</li>
279
<li>
280
<A href="#a-publishing">Publish</A> the datasets, your
281
research code, and the PDF of your paper online, all
282
hosted on CoCalc.{" "}
283
</li>
284
</ol>
285
</Paragraph>
286
</>
287
}
288
>
289
<Paragraph>
290
The fully integrated{" "}
291
<A href="/features/latex-editor">CoCalc latex editor</A> covers
292
all your basic needs for working with <Code>.tex</Code> files
293
containing{" "}
294
<A href="https://github.com/gpoore/pythontex">PythonTeX</A> or{" "}
295
<A href="http://doc.sagemath.org/html/en/tutorial/sagetex.html">
296
SageTeX
297
</A>{" "}
298
code. The document is synchronized with your collaborators in
299
real-time and everyone sees the very same compiled PDF.
300
</Paragraph>
301
<Paragraph>In particular, this LaTeX editor</Paragraph>
302
<Paragraph>
303
<ul>
304
<li>
305
<strong>
306
Manages the entire compilation pipeline for you
307
</strong>
308
: it automatically calls <Code>pythontex3</Code> or{" "}
309
<Code>sage</Code> to pre-process the code,
310
</li>
311
<li>
312
Supports <strong>forward and inverse search</strong> to help
313
you navigating in your document,
314
</li>
315
<li>
316
Captures and shows you{" "}
317
<strong>where LaTeX or Python errors happen</strong>,
318
</li>
319
<li>
320
and via{" "}
321
<A href="https://doc.cocalc.com/time-travel.html">
322
TimeTravel
323
</A>{" "}
324
you can go back in time to see your latest edits in order to{" "}
325
<strong>easily recover from a recent mistake</strong>.
326
</li>
327
</ul>
328
</Paragraph>
329
</Info>
330
331
<Info
332
title={"Code formatting"}
333
icon="network-wired"
334
image={FormatGIF}
335
anchor="a-codeformatting"
336
alt="Video of formatting Python code in a Jupyter notebook with 1 click"
337
>
338
<Paragraph>
339
<strong>
340
CoCalc has one-click code formatting for Jupyter notebooks and
341
code files!
342
</strong>
343
</Paragraph>
344
<Paragraph>
345
Your python code is formatted in a clean and consistent way using{" "}
346
<A href="https://github.com/google/yapf#yapf">yapf</A>.
347
</Paragraph>
348
<Paragraph>
349
This reduces cognitive load reading source code, and ensures all
350
code written by your team has a consistent and beautiful style.
351
</Paragraph>
352
<Paragraph>
353
Python code formatting works with{" "}
354
<strong>
355
pure <code>.py</code> files
356
</strong>{" "}
357
and <strong>Jupyter Notebooks running a Python kernel</strong>.
358
</Paragraph>
359
</Info>
360
361
<Info
362
title={"Command line support"}
363
icon="terminal"
364
image={CommandLineTerminal}
365
anchor="a-commandline"
366
alt="Using scikit learn from the command line to run Python code"
367
>
368
<Paragraph>
369
Your existing Python scripts run on CoCalc. Either open a{" "}
370
<A href="https://doc.cocalc.com/terminal.html">Terminal</A> in the
371
code editor, or click the "Shell" button to open a Python command
372
line.
373
</Paragraph>
374
<Paragraph>
375
Terminals also give you access to{" "}
376
<A href="https://www.git-scm.com">git</A> and{" "}
377
<A href="/software/executables">many more utilities</A>.
378
</Paragraph>
379
<Paragraph>
380
Regarding collaboration, terminals can be used{" "}
381
<strong>by multiple users at once</strong>. This means you can
382
work with your coworkers in the same session at the same time.
383
Everyone sees the same output, and coordinate via{" "}
384
<A href="https://doc.cocalc.com/chat.html">side chat</A> next to
385
the terminal.
386
</Paragraph>
387
<Paragraph>
388
You can also simultaneously work with many terminal sessions.
389
</Paragraph>
390
<Paragraph>
391
For long-running programs, you can even close your browser and
392
check on the result later.
393
</Paragraph>
394
</Info>
395
396
<Info
397
title={"Chatroom about your Python code"}
398
icon="comment"
399
image={SideChatImage}
400
anchor="a-chat"
401
alt="A Jupyter notebook with a chat window on the side"
402
>
403
<Paragraph>
404
Collaboration is a first class citizen on CoCalc. Use{" "}
405
<A href="https://doc.cocalc.com/chat.html">side chat</A> for each
406
file to discuss content with your colleagues or students.
407
</Paragraph>
408
<Paragraph>
409
Additionally, avatars give you{" "}
410
<strong>presence information</strong> about who is currently also
411
working on a file.
412
</Paragraph>
413
<Paragraph>
414
Collaborators who are not online will be notified about new
415
messages the next time they sign in.
416
</Paragraph>
417
<Paragraph>
418
<A href="https://doc.cocalc.com/chat.html">Chat</A> also supports
419
markdown formatting and <LaTeX /> formulas.
420
</Paragraph>
421
</Info>
422
423
<Publishing />
424
425
<Snapshots />
426
427
<SignIn startup={component} />
428
</Layout.Content>
429
<Footer />
430
</Layout>
431
</Customize>
432
);
433
}
434
435
export async function getServerSideProps(context) {
436
return await withCustomize({ context });
437
}
438
439