Share a Python script with people who do not code
You have a Python script that works on your machine. Your colleagues or clients must run it too, and they must install nothing: no Python, no packages, no terminal. This Guide publishes your code on Abyss as a Widget. Then they open a link, fill in a form in their browser, press Run and download the outputs.
You can do the steps below yourself, or a coding agent can do them with the abyss-widget skill. Port an n8n flow into a Widget shows how the agent works. Its steps fit your code as well as they fit a flow.
What you have, and what they get
You have a folder of Python code. It reads some inputs, for example a file and a few values, and it writes a result. Today you run it from a terminal.
The people you share it with get a page with a form. They fill in the form and press Run. Abyss runs your code, and they read and download what it wrote. They never install Python or a package. How people run your Widget shows that page.
Your code fits when one run takes inputs, does one job and returns an output. Abyss is the wrong tool for code that must stay up between runs, for example a bot, a server or an app with accounts of its own.
Make your code a project
A Widget is a folder with run.py and requirements.txt at its root. The project says what each file holds, and Your first Widget in five minutes shows a whole Widget.
Change three things in your code. Keep the rest as it is.
- •Where the inputs come from. Your code reads each input from an environment variable, not from
sys.argv,input()or a fixed path. Inputs tells how. - •Where the outputs go. Your code writes each output into the
output/folder. Outputs tells how, and what makes a run fail. - •Where the keys come from. Your code reads each API key from an environment variable. You give its value to Abyss, never to your code. Environment variables tells how.
For example, this code adds up a sales export for each client:
import sys
import pandas as pd
sales = pd.read_csv(sys.argv[1])
sales.groupby("client")["amount"].sum().to_csv("totals.csv")As run.py, it reads the file from its Field and writes into output/:
import os
import pandas as pd
sales = pd.read_csv(os.environ["sales_file"])
sales.groupby("client")["amount"].sum().to_csv("output/totals.csv")Write each package that your code imports into requirements.txt, here pandas. Then try the project on your machine: set the variables, make an empty output/ folder, run python3 run.py from the project's folder, and read output/.
Your virtual environment and your .env can stay in the folder. What isn't uploaded says what the uploader leaves out.
Describe the inputs as Fields
Each input becomes a Field of the form: a text, a number, a choice, a date or a file. The name of a Field is the name of the variable that your code reads.
You make the Fields in one of two ways:
- •Write
interface.jsonin the folder. The uploader reads it and makes the Fields. - •Make them by hand in the form builder, after you upload.
For the example above, interface.json holds one File Field:
[
{ "type": "file", "name": "sales_file", "label": "Sales export", "mimes": ["csv"] }
]Field types lists each Field, what your code gets from it, and its keys. Write each label in the words of the people who run the Widget. They read the labels, not your code.
Run a Test Run, and set the Example Run
Press Publish in the navbar and drag the project's folder into the uploader. Then press Test Run, fill in the form, and read the outputs. The logs show what your code printed. Troubleshooting gives the fix for each common error.
Fix your code and test again until the outputs are correct. Test with inputs of the kind your colleagues or clients will give.
When you publish, your Test Run becomes the Example Run. The people who open the Widget see it before they run it, so it shows them what they will get. Use inputs that you can show to anyone: no client data and nothing personal. Test, publish, price says who sees it.
Publish the Widget
Fill in the listing: the title, the thumbnail, a tag, the price, and who can see the Widget. Name the title after the job, for example "Sales totals by client". Then press Publish, and the Widget is live. Test, publish, price says what Publish needs, and how to change the Widget later.
Share it
When you publish, you choose one of two ways to share the Widget:
- •PUBLIC. The Widget is listed on the Widgets page. Anyone can find it and run it.
- •PRIVATE. Only the people who have its Private Link can open it. Choose this for chosen people, for example one client or your team.
On the Widget's page, press Share. It copies the Widget's link, the public address or the Private Link, and opens the Widget's links. Send the link to the people who will run the Widget. If a Private Link reaches the wrong person, press Regenerate on its row. The old link then stops working.
With Pro, one Widget can have more Private Links, each with its own name. For example, give each client a link of their own.
Decide what they pay
The people who run the Widget pay for each Run in Byssium, from their own Abyss account. You set the price when you publish. Test, publish, price gives the range and says what you earn, and the pricing page says what Byssium costs.
- •A price of 0. Each Run of the Widget is free.
- •Free Runs. A paid Widget can give each person some Free Runs, so they can try it first. What is a Free Run? tells how they work.
- •You pay. With Pro, a Private Link can be free for whoever opens it. In the link's Settings, under Who pays, turn on You pay for every Run. The link then opens on a page with your Brand, and they run the Widget with no sign-in. Each of their Runs is paid from your account.
How is a Run paid? tells what the people who run the Widget see when they pay.
What they never see
The people who run your Widget get its form and its outputs. They never get your code or the values of your keys. Your code, keys and data says who can see what.
One thing is yours to watch. Whatever your code writes into output/ is shown to the people who run the Widget. So never write a key there. Outputs says who else can read it.