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

Calling functions remotely

You can call functions on your own machine (or anywhere else) using the Uplink, and you can call functions in your Anvil Server Modules from scripts on your own machine (or anywhere else).

Anvil -> your machine

To use the Anvil Uplink library in your Python project, first run pip install anvil-uplink on your machine.

Your local Python code can now do anything a Server Module can do.

Mark functions with @anvil.server.callable if you want to call them from your app.

# In a script on your own machine (or anywhere)

import anvil.server
anvil.server.connect("[YOUR UPLINK KEY]")

def get_file():
  # Return a file from this local machine
  return"./image.jpg", "image/jpeg")

If you connect multiple uplink programs that contain the same function name to the same app, then calls can be received by either uplink program.

Your machine -> Anvil

You can also call functions in your Anvil Server Modules from your uplinked code. This makes the Uplink a two-way connection.

# This is a simple program that makes a call to a server module.
import anvil.server

anvil.server.connect("[YOUR UPLINK KEY]")"store_number", 42)

This example does not register any @anvil.server.callable functions, and exits as soon as the call to store_number returns.