Automate Domo administration from Python¶
crew-dcs is a Python library for people who run Domo and are tired of clicking. It calls the same APIs the Domo UI calls, so you can script the things you now do by hand: look up DataSets, manage users and groups, trigger dataflows, and repeat them across hundreds of objects or several instances.
I'm assuming you know Domo well and Python a little. Python terms get a short explanation the first time they show up.
A first look¶
This prints the name of one DataSet. Swap in your own instance, access token and DataSet ID, and it runs as pasted:
import asyncio
import os
from crew_dcs.auth import DomoTokenAuth
from crew_dcs.routes import dataset as dataset_routes
async def main():
auth = DomoTokenAuth(
domo_instance="mycompany", # mycompany.domo.com
domo_access_token=os.environ["DOMO_ACCESS_TOKEN"],
)
res = await dataset_routes.get_dataset_by_id(
dataset_id="your-dataset-id", auth=auth
)
print(res.response["name"])
asyncio.run(main())
To run it, set DOMO_ACCESS_TOKEN in your terminal (an access token comes from
Admin → Authentication → Access tokens in Domo; Install
and Authenticating to Domo cover both) and
run it with uv run python my_script.py.
What the pieces are:
- A route is a function that makes one Domo API call, here
get_dataset_by_id. This is the layer I teach first, because one call that does one thing is easy to read. Classes such asDomoDatasetsit on top of routes and come after. res.responseis what Domo sent back, as a Python dictionary. Itsnameis the DataSet's name.- Every call is async: it runs inside
async def main()and gets started byasyncio.run(main()). That is what lets a script make many calls at once. You can copy that wrapper into every script and not think about it. - The access token is read from an environment variable (a named value your terminal hands to programs) instead of being typed into the file. Do not put your credentials on the internet, and that includes a script you commit.
Get it¶
crew-dcs is a private package. To install it:
- Register on datacrew.space.
- Create a
dc_token for your account. - Point
uv(orpip) at the package index with that token.
Every registered user is entitled to the package. Install walks through all of it, including how to set up Python if you don't have it yet.
Requirements¶
- Python 3.13 or newer.
- Async only. There is no blocking version of any call.
- A Domo instance and an access token or other credential you can use on it.
Where to go next¶
- Install: get Python, get a token, install the package.
- Authenticating to Domo: which credential to use, and how to check it works.
- API reference: every route and class, built from the code.
Using an AI agent¶
Working with Claude Code, Cursor or ChatGPT? Point it at
llms.txt, a plain-text index of
these docs. Using crew-dcs with an AI agent has an
instruction block to paste.
Where to ask¶
Stuck, or want to see something added? Ask in the Domo community Slack and I'll answer there.