Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at contact@anvil.works.

Blog

Upcoming Events
29th of January 2019

We’re on tour!

We’ll be speaking, giving workshops and talking about Anvil at a bunch of meetups and conferences in the next few months. Come and join us, learn more about Anvil, and maybe even take home some swag.

Invite Anvil to your event

Do you run a meetup group or conference? We’d love to present or run a workshop for you! Please drop us a line: events@anvil.works.

Wherever you are in the world, we can do remote presentations by video link, so do get in touch.

"IndyPy loved having Meredydd speak to our group. Very engaging, even across the Atlantic!"

— Calvin Hendryx-Parker, organiser of IndyPy

Upcoming Events

Here’s what’s in the calendar in the next couple of months:

  • Jan 29th: Sheffield, UK (Sheffield Python)
    Workshop: Come and try Anvil yourself, with friendly hands-on assistance.

  • Feb 5th: London, UK (TechHub Demo Night)
    Demo: See what Anvil can do, and how quickly! Meet the founders and ask questions afterwards.

  • Feb 21st: Oxford, UK (Oxford Python)
    Tech Talk: I’ll be demonstrating Anvil, and talking about how it works under the hood.

  • Mar 5th: Cambridge, UK (CamPUG)
    Tech Talk: I’ll be talking about how Anvil works under the hood.

  • Mar 19th: Cardiff, UK (PyDiff)
    Workshop: Come and try Anvil yourself, with friendly hands-on assistance.

  • Mar 22nd-24th: Bratislava, Slovakia (PyCon SK)
    We will be speaking about Anvil at PyCon SK, and leading a hands-on workshop so you can try it yourselves.

  • May 3rd-5th: Cleveland, OH, USA (PyCon)
    We’re already confirmed as sponsors for PyCon 2018 – find us in the exhibition hall, and meet up with other Anvil users.

  • May 24th-26th: Vilnius, Lithuania (PyCon LT)
    Come find us at PyCon Lithuania! We’ll be giving a talk and leading a hands-on workshop.

Escape Hatches and Ejector Seats
15th January 2019

When you need to escape an abstraction, how violent is your exit?

The Web is a hugely complicated system. If you’re writing a typical web app, your data will be in about 6 different forms:

  • Rows in an SQL table
  • Objects in your server code (eg Python)
  • JSON payloads on HTTP endpoints
  • Objects in Javascript
  • HTML DOM elements
  • Text on the screen

Translating these layers is tedious and repetitive, so we’ve invented a ton of frameworks to help us:

  • ORMs translate SQL rows into objects
  • REST frameworks turn objects into HTTP endpoints
  • Templating engines turn Javascript objects into HTML DOM elements
  • …and so on.

Each of these frameworks is a new layer of abstraction.

Every problem in computer science can be solved by another layer of indirection...
— David Wheeler
...except for the problem of too many layers of indirection.
— Anon.

All abstractions “leak”, requiring you to understand what’s happening underneath. Web frameworks leak all the time – you can’t effectively use Angular or React, for example, without understanding the DOM.

But today we’re asking about a worse situation – what happens when your abstraction just can’t do what you need?

Option 1: Go down with the ship

Still from the film Titanic, of lower class passengers being trapped behind metal gates

Let’s say you’ve written your app as a Windows desktop application, and now you need to use it on the web. Too bad – you’re going down with the ship. Your only choices are to rewrite your app on a new platform, or sit tight and hope that feature isn’t so critical after all.

My condolences.

Option 2: The Ejector Seat

If you’re lucky, your abstraction is more helpful than that.

Example: Create-react-app is a neat way to start a web app with React. It’s a black box that replaces your build manager, a Javascript transpiler, a minifier, and all the other build tools you need for modern web development.

Of course, sooner or later you’ll hit the limits of what create-react-app can do: you’ll need something it doesn’t support. The authors have thought of this situation, and there’s a button you can push: EJECT.

Picture of ejector seat firing

Ejecting from create-react-app opens up the black box. It writes out a set of build scripts representing the current state of your app. Now you can edit those scripts yourself – the hard way.

But create-react-app has given up. It protected you for a while – but as soon as you needed one advanced feature, you’ve been dropped in the Mojave desert with a parachute, a first-aid kit, and a copy of the Webpack manual.

Good luck!

It’s better than going down with the ship, of course. But should you have to discard an abstraction entirely when you touch its limits?

Option 3: The Escape Hatch

Man climbing out of a submarine escape hatch

It’s much more helpful to acknowledge that your system will always be incomplete, and make it usable even then. Ideally, your users can use complex external tools for the tricky corners of their project, without making the other 95% of their work more complicated. I call this pattern an “escape hatch”, rather than an “ejector seat” – you don’t need to jump all the way out at once.

The Rust programming language is a great example. Rust is a memory-safe low-level language: The compiler enforces rules that make sure your code can’t access memory it shouldn’t. But there are some things you can’t express within those rules. So Rust has an escape hatch, called unsafe. You mark a block of code unsafe, and you can break those rules. A few lines later, you return to writing the rest of your app – with compiler-guaranteed memory safety.

Anvil is an abstraction over all of web development. We provide a visual UI designer (no HTML/CSS), and you write your front-end and back-end code in Python (no JS, no REST frameworks). It’s even got an optional Python-native database (no SQL). This enables a data scientist, a sysadmin, or a developer in a hurry to build full-stack web apps with nothing but Python.

This is a pretty ambitious goal: The Web is a huge platform, with a large set of existing libraries, and the browser vendors add new features all the time. Let’s face it: Our new abstraction isn’t going to cover it all, any time soon.

We could have provided an ejector seat: “Export this Anvil app as a React+Flask app”. This, bluntly, would suck. The moment you edited the generated code, you’d lose all the benefits of Anvil’s abstractions!

So instead, we built escape hatches into every part of Anvil. For example:

  • If you want finer control over appearance, you can leave the drag-and-drop designer and edit the HTML template it uses. And then… flip right back to the drag-and-drop designer, where you can drop components into your new page layout.

  • If you need a browser feature we don’t support yet, you’ll need to use Javascript. You can call from Python to Javascript and back again. And then… wrap that code up as a Python component your colleagues can use. (Here’s an example using the Web Location API.)

  • If you want to use HTTP after all, that’s fine! You can consume HTTP APIs or make your own.

  • If you want to run code outside our serverless environment, it’s easy. Just install our Uplink library on your server, and run your code there. And then… call that code from your app, exactly the same as calling serverless code. Your server code can use all of Anvil’s server-side APIs. (Here’s an example with a Raspberry Pi.) Of course, if you need everything on site, you can get an on-site installation.

  • If you want to edit your code outside Anvil, just check it out in Git! Every Anvil app is a Git repository. Pull, make some changes, push it back. You can automate this, and integrate with whatever code review or CI/CD system you like. And then… jump right back into Anvil, and edit your app there.


The web is a complex platform – often too complex – but every single feature is there for a reason.

Are you building an abstraction? If so, think about your escape hatches: How can your users exploit features of the underlying platform, without ejecting into the wild blue yonder?

Anvil News - December
20th of December 2018

A happy holiday season to everybody! As the nights draw in and the temperatures drop*, we’ve been working hard to make Anvil even cooler.

* Temperature changes may vary by hemisphere. Consult your globe for more information.

Titles, logos and descriptions

Now you can customise the public face of your app using Titles and Logos. This configures search engine and social media previews as well as your app’s favicon and the title of the browser tab.

Look for Titles and Logos under the Gear menu Gear Menu Icon to brand your app!

Introducing the Anvil Library

There’s now a library of useful components to clone for free and use in your apps.

Click here to check it out

The components are implemented as Anvil apps, so they are composed of the standard atomic Anvil Toolbox components. This means you can see exactly how they work and modify them to suit your requirements.

The current list of components in the library is:

  • An input Form validation module
  • A translation module
  • A multi-select DropDown component
  • A progress bar
  • A sliding toggle switch
  • An input box that displays results as queries are typed

We’ll be adding more components as time goes on. If you have any requests, why not start a thread in the Forum?

Do you have a component to share? We welcome submissions. Contact us at contact@anvil.works!

A special thanks goes to David Wylie for his excellent Multi-Select DropDown and Toggle Switch/Progress Bar components, which are available for everybody in the library.

Even more ways to search our documentation

We’re constantly adding to our documentation search system. A single search box finds results from the Reference Docs, our tutorials and cookbooks, selected Forum posts, example apps to clone, and other specially-written hints and snippets.

Use the ‘How do I…’ search box in the top-right corner of the Anvil editor, or visit the Learning Centre or Knowledge Base pages for a bigger version.

Other updates

As usual, we’ve been working on the details too. Here are a few details you might have missed:

  • The Data Tables Service now tells you how many Rows are in your table.

  • Remembered user sessions are now stored in the Users table in Data Tables, so you can delete them to log users out.

  • There’s now a distinct URL associated with editing an app, so you can bookmark the Anvil editor with an app open.

Until next time, happy building! See you in the New Year.

Anvil News - November
30th of November 2018

Anvil On Tour: Upcoming Events

We will be presenting at a bunch of development- and Python-related meetups over the next few months. Come and join us!

(Want us at your local meetup? Get in touch, wherever you are: events@anvil.works)

Schedule
  • Nov 22nd: London, UK (London Python, pictured above)
    We had a great response at London Python, and a lot of interest afterwards. We’ve already been invited back!

  • Dec 4th: St Louis, MO, USA (STL Python)
    Stefano Menci will be leading a hands-on workshop in St Louis.

  • Jan 8th: Indianapolis, IN, USA (IndyPy)
    This is the Indianapolis pitch competition for PyCon Startup Row. Last year, we built the voting app for the competition, live on stage in London. This year, we’re giving a full-length talk.

  • Jan 10th: Frederick, MA, USA (Python Frederick)
    Meredydd Luff will be demonstrating Anvil, and talking about how it works under the hood.

  • Jan 17th: Manchester, UK (North West Python)
    Meredydd will be demonstrating Anvil, and talking about how it works under the hood.

  • Jan 29th: Sheffield, UK (Python Sheffield)
    Workshop time! Come and try Anvil yourself with friendly hands-on assistance.

  • Feb 21st: Oxford, UK (Oxford Python)
    Meredydd will be demonstrating Anvil, and talking about how it works under the hood.

  • May 3-5: Cleveland, OH, USA (PyCon)
    We’re already confirmed as sponsors for PyCon 2018 – find us in the exhibition hall, and meet up with other Anvil users.

Bring Anvil to your event

We’d love to present at your local Python, data science or development meetup – we do local or remote presentations all over the world. Drop us a line at events@anvil.works.

We can also offer help and materials if you’d like to lead an Anvil workshop yourself - just get in touch.

We hope to see you at an event soon!

Anvil News - September
26th of September 2018

Meetups, Security, Data Grids, and More

Do you attend a coding, Python or data-science meetup? Would you like Anvil to come and present there? We’re presenting at meetups across the UK, and events all over the world (including remote presentations). If you want us to stop by your event or user group, send an email to events@anvil.works and let us know!

Meanwhile, here’s what’s new in Anvil this month:

Data Grids

Of course, this month’s big news is the release of Data Grids. It’s our most-requested feature, and a massive help to anyone working with tabular data. Check out our announcement and the Getting Started tutorial.

Enforcing secure passwords for your users

Password security is more important than ever. That’s why we’ve just introduced the “Require Secure Passwords” option in Anvil’s user authentication service.

When you select “Require Secure Passwords”, Anvil prevents your users from re-using a password that’s too short, or has already been leaked in a data breach. We can check for data breaches without revealing passwords to anyone, thanks to the k-anonymity feature from Have I Been Pwned. You can learn more about how it works in this blog post from Cloudflare.

“Require Secure Passwords” is enabled by default for all new apps, and you should turn it on for your existing apps too!

Tooltips

Another much-requested feature: Now, almost every component has a tooltip property. Set it to display some extra text when you hover your mouse over the component!

On-Site Installation

Did you know that you can install Anvil on your own servers? You can now get an on-site trial instance running in 10 minutes or less, easier than ever before! To learn more about running Anvil on your corporate network, or on your own cloud servers, contact us at enterprise@anvil.works.


That’s it for this month. If you’ve got any questions, come and ask us on the Anvil user forum.

Happy coding!

Learn More

Get the best out of Anvil with our free email course.