Python in the Browser: Free PyScript SaaS Launches
Anaconda is offering a free Pyscript software-as-a-service, Pyscript.com, starting today, nearly a year after launching the open source language project last April. It will allow developers to deploy Python to run in the browser, alongside other HTML content.
PyScript is essentially HTML, but with an ecosystem of Python libraries, according to PyScript.net, which was the original project launched last year. It leverages Pyodide, WASM, and web technologies to allow Python to run in the browser.
“Everything that you can do with Pyscript.com, you could do without it — pretty much like you could run your own Git server and access Git on your own,” Fabio Pliger, principal architect at Anaconda and PyScript creator, told The New Stack. “But GitHub provides you [with] a lot of niceties and good features for you [so] that it makes sense that just sign up and start using those. I think PyScript.com is in the same vein. Where do I find new plugins that people are creating? I could just go to Pyscript.com and look for them and have a list of which ones are available, what’s more popular, and whatnot.”
The original project at PyScript.net will still be maintained and will evolve, but PyScript.com incorporates an IDE on a free coding platform with Python-powered data interactivity and computation. The platform is now generally available for free as a software service, although there are plans to add paid tiers.
Developers will be able to develop a project on PyScript.com in the browser-based IDE and then — more significantly — deploy the app in the browser and share it via a url.
PyScript.com Goes from IDE to Launch
Previously, if a developer wanted to learn Python, they would have to download Python, configure an environment and install packets on a local machine, Pliger said.
“With PyScript, we tried to reduce that and say you just need to edit one txt file and we will build your environment and everything in the browser without you having to care about resources or installations or things like this,” he explained. “PyScript.com is basically a space where users can create, share, deploy and copy PyScript projects.”
Once developers log in and start a project, they’ll see an IDE that looks much like Visual Studio or other IDEs, with a “Hello World” script. PyScript.com will offer plugins as well, so, for instance, if a teacher wants to grade a slideshow, that teacher will be able to find a plug-in to enable that.
“We’re trying to carve out an experience that is easy and also suggest best practices to users,” Pliger said. “PyScript by design is very flexible in what you can do. So for instance, when I create a new project, I could choose this route, which is defining my Python files and things separately, or I could just say something like, print ‘Hello world’ and that would just work, which is great for novice users.”
The application is automatically deployed from the IDE.
“I can send you a link and you can see the application running — all of that within seconds,” he said. “Compared to one of the difficulties in Python is the question[of] once I have my application, how do I deploy that to my users?”
Like GitHub, PyScript.com allows users to copy projects from others and modify the program for a coder’s own modifications. Anaconda has also created templates to make it easier to add functionality.
“One of the concepts in PyScript is that you have your configuration file that allows you to set packages, that you’re using dependencies, plugins, and things like this,” he said. “This is just as easy as saying like, packages equals NumPy. And then here all of a sudden, I have a version that includes NumPy and I can use those as well.”
While the IDE will be familiar to developers, one thing the project did not want to do is create a super powerful editor that might overwhelm non-programmers. That’s because one of PyScript’s goals is to be a language for the 99% of web users who aren’t programmers, as Anaconda co-founder and CEO Peter Wang told The New Stack in July.
“The biggest thing I would say to people who are like, ‘I don’t see why this is necessary,’ is simply [that] it’s not about you,” Wang said. “It’s for all of the schoolchildren that you don’t spend your afternoons trying to teach how to build their first application.”
Future Features for PyScript.com
But developers are still a major consideration, of course. One addition that many developers will like is a planned command line interface for Pyscript.com that would enable developers to code on their own machine and then synchronize it in real-time with PyScript.com.
“If you’re a GitHub user, for instance, and you want to use that, we want to encourage this and say, keep using your tools, keep using everything and just use the features … that you need, like the ease of deployment or share-ability and things like that,” Pliger said.
There are also plans to add more social support, so that users can follow others to see what projects they’re working on and clone projects. Already, there are demos of games and other projects available from maintainers and other beta participants, he said. Pliger demoed a game that looked much like the original Super Mario Brothers and worked within the browser.
“I’ve been amazed by the things that people are doing,” he said. “Games are a channel for students and people who would like to program but they can’t, to catch their interest, right? If you go to a class of students and you tell them, ‘Today we’re going to learn Python and learn how to print things on the screen,’ […] you would lose their interest. But if you go and say, ‘Hey, we’re going to use Python to automate Minecraft and to create blocks and things like this,’ all of a sudden you catch their interest, and they actually want to learn how to use that for their own interest. I think it’s very powerful.”
On another practical note, teachers can run scripts on a page within the content that students are learning, so there’s no need for two pages — which makes for a powerful learning experience, he added.
There will be paid tiers for Pyscript.com, but for now, Anaconda wants to encourage “passionate individuals to help pave the future of PyScript,” the press release stated. It’s offering a Founder’s Package for a one-time fee of $150 for those who want to be more involved in the project. Founders will get early access to beta features, have a channel for direct feedback to the core developers, and get one year of unlimited access to new features as they get released. In addition, Founders will receive special edition apparel featuring PyScript’s new mascot, Rabbit.
Since its debut in 2022, PyScript’s GitHub has grown to more than 15,000 stars and monthly usage reached more than 20,000 web developers, data science practitioners, and learners.