Anvil is a platform for building full-stack web apps with nothing but Python. In this article we recap Anvil’s best bits from 2020.
The Best of Anvil This Year
2020 has been a weird year, but it’s been a big one for the team at Anvil. We’ve released more product improvements and content than ever before. It’s been hard to keep up, so this post is a roundup of all the best bits from Anvil in 2020.
- Product releases
- Highlights from our blog
- Anvil apps from the Anvil team
- Anvil apps from the Anvil community
We’ve shipped a lot of new features this year alongside speed improvements and other minor updates. Here are a few of our favorite releases.
Open source app server
In May we open-sourced a core part Anvil when we released the Anvil runtime and Anvil app server - available on github.
Anvil takes all the hassle out of deploying apps online with one-click deployment, however, there are some situations where you want to host apps yourself.
Perhaps you’re serving a remote medical facility without good Internet access. Perhaps you’re building an IoT device with your Raspberry Pi. Or perhaps you just want to be safe if a meteorite hits our datacentre.
Don’t worry! We’ve got you covered with the Anvil open-source app server, which allows you to host your apps on any machine.
After we open-sourced the Anvil runtime and app server, we kept getting asked, “Why did you open-source such a core part of your product?“. It’s a good question and one which Meredydd answered in his hugely popular blog post ‘Why We Open Sourced the Anvil App Server’.
Protecting against password compromise – via phishing or data breaches – is increasingly important. That’s why earlier this year we were happy to announce that Anvil now comes with two factor authentication, protecting your app’s users even if their passwords are compromised!
Authentication is a fundamental part of keeping your users’ data safe. The problem is, getting it correct is a minefield. It requires time and deep understanding, and any slip-up can lead to disaster.
That’s why we built Anvil’s Users Service, a one-stop service for all of your authentication needs. The Users Service makes user management painless – it handles signup, login, email confirmation, password resets and more, using either your own user accounts or external providers such as Google, Facebook or Microsoft.
This year, we made the Users Service even better. We added Two-Factor Authentication, so that an attacker needs more than a compromised password. Like the rest of the Users Service, adding Two-Factor Authentication to your application is as easy as ticking a box:
The biggest strength of Anvil is that you can build your whole web app in Python. You’re using the same language in the browser as on the server, and you can even share code between the two.
This year, we made Anvil even more powerful, by allowing you to define your own classes and pass them between client and server code.
Just create a Module – that’s Python code that’s available both in the browser and on the server.
That’s just scratching the surface of what you can do with our new Portable Classes. You can control how your objects are transmitted, customise permissions, and more.
Highlights from our blog
We’ve ramped up the Anvil blog this year posting an array of useful articles, here are some of our highlights.
Plotting in Python
How do I make plots in Python? This question used to have a simple answer: Matplotlib was the only way. Nowadays, Python is the language of Data Science and there’s a lot more choice. Which should you use?
Back in February Shaun published a guide to help you decide. In it he shows you how to use each of the four most popular Python plotting libraries, plus a couple of great up-and-comers.
The most popular Python plotting libraries are Matplotlib, Plotly, Seaborn, and Bokeh. However, Shaun went above and beyond to include some underrated gems that you should definitely consider: Altair, with its expressive API, and Pygal, with its beautiful SVG output. He even found time to take a look at the very convenient plotting API provided by Pandas.
Python objects speak for themselves
Plotting in Python was far from Shaun’s only contribution to the blog this year! His Introspection in Python blog post was widely shared and is a great resource for beginner and advanced Python users alike.
In his post he investigates how you can use built-in Python tools to both:
- find out exactly what any module can do, and
- find out exactly how Python will execute your code.
He goes on to demonstrate how this makes debugging in Python much easier than in other programming languages. He shows how you can ask any object what it does and what data it holds.
Generating PDFs with Python
One of Brooke’s many contributions to the blog this year was publishing a fantastic guide to producing PDFs with Python and Anvil.
The tutorial demonstrates how easy it is to generate, download and email PDF documents in Anvil. Brooke builds a simple web app where users can register for an event and download their ticket as a PDF. Follow along with the tutorial which includes clone links for you to try out the finished app:
Anvil apps from the Anvil team
We love building apps with Anvil. We use Anvil for everything from demonstrating Python modules to building the internal tools we use as a company.
In 2020 we resolved to release as many example apps as possible, showing the world what is possible with Anvil
Fully featured ticketing system
In March, Bridget published her fully featured ticketing app. Demonstrating how Anvil makes it simple to build large-scale, shippable new products with Python.
In the post you can read all about how Bridget built the app and the Anvil features she used the most.
Clockify in 1 day
As part of our one-day minimum viable product series, Stu asked what you could build in one working day with Anvil?
The answer, a clone of Clockify, the hugely popular time tracking app. This walk-through documents his process from inception to time tracking application, all in 24 hours.
Stu managed to build a multi-user time tracker with data, reports, projects - and it’s not bad looking, either! Find out more with the following link:
Edgar Allen Poe
For Halloween this year, Brooke decided to write a spooky story in the style of Edgar Allan Poe. But then she had a better idea. Why write a story when she can train a text generator to write one for her?
Brooke’s blog post explores how she created her dataset, fine tuned GPT-2 and turned her work into a web app for everyone to use.
Dubbing the finished model GPoeT-2, Brooke put the model to work rewriting Poe’s classic The Pit and the Pendulum. The result:
I WAS sick, sick unto death with that long agony; and when they at length unbound me, and I was permitted to sit, I felt that my senses were leaving me. I writhed with rage, and trembled with pain. I raged and shrieked, and rivalled, and wrung, and screamed and swore, and staggered and reeking, and reared again. In a state of anxiety, I called to my bed, and buried myself in an incubus of some substance which had escaped my body; then, my eyes became lost in an ague. When the first faint and vivid thought entered me, I again reeled, and struggled to utter it. With a shudder, I dwelt upon an even more ghastly horror; and, on the margin of my comfortable bed and lofty chair, there flitted a thousand fancies about me. A lamp swung low on the bed as if on purpose. Its glare was bright red-hot, and, with an air of horror still burning, sat upon my brain, as if from some singular cause…..
Check out the blog post for full spooky version!
The source awakens
Do you like Star Wars but struggle to tell your X-wings from your A-wings? Don’t worry, Hannah has got you covered with her Star Wars ship classifier!
Inspired by a fabulous talk by Celia Cintas from PyCon UK, about using deep learning to classify Star Wars ships, Hannah set about creating a web app based on Celia’s notebook to help us all classify Star Wars ships.
In this blog post Hannah builds a fun web app and provides a great introduction to neural networks.
The star wars puns are also top quality!
Trolling your colleagues
Python gives you superpowers - you can even
import antigravity. Like all superpowers, it’s up to you whether you use them for good or evil. In this post Shaun uses them for evil.
Imagine your colleague made the elementary mistake of forgetting to lock their screen. Do you need a more imaginative way to punish them than connecting a different mouse or setting their background to an image of their desktop? You should try haunting their keyboard. Shaun shows you how with his trolling your colleagues with Python blog post.
This post isn’t just about trolling or inflicting maximum confusion without getting fired, it’s about teaching your colleagues a valuable engineering skill - Root Cause Analysis (RCA).
Check our Shauns blog post to learn more than one valuable lesson through the art of trolling.
Anvil apps from the Anvil community
One of the most satisfying things about creating programming tools is seeing what your tools are used for. This year is no exception and we have seen some great things being built with Anvil. From small passion projects to commercial apps, here are a few of our favourites.
Creating a digital product catalogue sounds like a reasonably straightforward task - get product information from your suppliers, store it in a database, and create a simple web application to browse the catalogue. Unfortunately, this is far from the reality. Kevin Dalias has spent years working to improve a system that’s fundamentally broken. He’s using Anvil to build Ruchomi, an app designed simplify the complex process of working with retail product data, making product catalogues as simple as they should be, and accessible to sales staff on the shop floor.
Ruchomi receives catalogue data in all sorts of formats (PDF, malformatted CSV…) from a number of manufacturers. With a little help from Python and machine learning, they wrangle the data into a sensible format, label and categories each product, and then aggregate the data into a digital product catalogue that sales staff can access right on the shop floor.
With Anvil, I can actually write the code myself and write the interactions myself. It lets me put industrial expertise into the product itself rather than [paying to develop] some third party product that I have no control over.
I built the MVP app in about two weeks. It would have taken 6 months in any other format.
Founder & CEO, Ruchomi
Iron dog snow racing
Every February, a few dozen hardy folks mount their snowmobiles and set off into the wilderness of Alaska, covering over two thousand miles of rugged terrain in 35 hours of racing. They are followed on this journey by thousands of spectators from all over the world.
The Iron Dog team built their Live Race tracker with Anvil. With the race tracker, users can:
- view racers’ progress by viewing them on a GPS map
- view the current leaderboard
- view team information
- view team progress at each checkpoint
Tech Lead, Iron Dog
FairShake: Fighting for Consumer Rights
Since 2011, it’s been harder for consumers in the US to pursue big companies for compensation when things go wrong. Class action suits were effectively abolished in favour of a company-funded court system called “private arbitration".
After a ridiculous series of events that turned a holiday flight from an 11 hour hop into a 72 hour ordeal, Teel Lidow decided something had to change. So he founded FairShake: a consumer rights service that’s levelling the playing field between everyday people and big companies.
Earlier this year Meredydd spoke to Teel Lidow, founder of FairShake, and Brian Herrera, FairShake’s tech lead, about how much a non-coding lawyer could accomplish with Anvil.
Links for information on FairShake
- FairShake’s homepage
- The New York Times article about FairShake and the arbitration system
- Lifehacker wrote a guide on how to use FairShake to claim back your gym membership fees, while gyms are closed during the coronavirus shutdown.
On to next year
That’s it for our 2020 roundup. We’ve really enjoyed meeting so many of you throughout this year and seeing what everyone has built with Anvil.
We’ve got a lot planned for 2021 - watch this space!
Happy new year everyone!
Build your own app with Anvil
If you’re new here, welcome! Anvil is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks – just build it all in Python.
Want to build an app of your own? Get started with one of our tutorials:
Build Database-Backed Apps
Build a Simple Feedback Form
Build a data-entry app, and learn the techniques fundamental to building any Anvil app. In this tutorial, you will:
- Build your User Interface
- Write client-side Python
- Write server-side Python
- Store data in a database
- Deploy your app