Skip to main content
Use client.protocol to manage UCP protocols programmatically: save them to a project, validate them, parse a vendor cycler file into UCP, and convert UCP back out to a cycler’s native format. For installation and authentication, see the Python API client page. To run a saved protocol, see the Python API page.

Saving a protocol to a project

Saved protocols are project-scoped and content-addressed: two protocols with the same body are the same record, so saving one that already exists returns the existing record instead of creating a duplicate.
Use create_or_get when you do not care whether this is the first time:

Listing and finding saved protocols

list also accepts name_exact, created_by_email, and the created_after / created_before / updated_after / updated_before date filters, plus limit and offset. Filtering and ordering are applied by the database, so total counts every match.
Protocols are deduplicated on their body, not their name, so a project can hold several protocols sharing one name. find_by_name raises ValueError in that case rather than returning an arbitrary one — use list when you need to choose between them.

Reading, renaming, and deleting

Parsing a vendor protocol file into UCP

parse_file turns a commercial cycler’s protocol file into UCP — the reverse of converting UCP to a vendor file.
A parsed protocol is not saved — pass parsed.ucp to create to store it. Drive cycles and subroutines the file referenced but did not embed are reported separately: those the parser recovered appear in available_drive_cycles / available_subroutines, and those still outstanding in required_drive_cycles / required_subroutines. Supply the required ones before simulating. If the file parsed only partially, parsed.error is set and parsed.ucp may be incomplete.

Validating a protocol

Finding input references

Find input[...] placeholders in a protocol string, useful for building experiment parameter forms.

Converting UCP to a vendor protocol file

Use client.protocol.convert to translate a UCP YAML protocol into the native file format used by a commercial cycler. This is the reverse of the commercial protocol upload flow — start from a protocol designed in Ionworks and produce a file you can run on hardware. Supported targets: maccor, arbin, neware, biologic_bttest, novonix.
For the neware target, pass nominal_capacity_ah (the rated cell capacity in amp-hours) whenever the protocol uses C-rate steps or cutoffs. Neware sets current in absolute mA and has no C-rate mode, so the rate cannot be resolved without a capacity. The other targets express C-rate natively and ignore this argument.
ConvertResult exposes:
  • primary_bytes — raw bytes of the primary protocol file.
  • text(encoding="utf-8") — decode primary_bytes to a string.
  • save(dir) — write every output file (primary plus any sidecars) into dir and return the list of paths written.
Maccor protocols that include drive-cycle steps produce one or more .MWF waveform files alongside the primary .000 file. Use result.save(dir) so every sidecar lands next to the primary protocol — handling only primary_bytes drops the waveform files and the protocol will not run on the cycler.
Some UCP features map cleanly across all formats, but each vendor has its own syntax and limitations (see Differences between commercial protocols). If a UCP construct can’t be expressed in the target format, the conversion returns an error naming the unsupported step (see Export-time validation for the specific features each target format rejects). Validate the output by reuploading it through the commercial protocol flow before running it on a real cycler.
You can find the ID for any resource from the Ionworks Studio web app. The ID is displayed in the URL when you navigate to a resource’s detail page.

Next steps

Universal Cycler Protocol

The UCP format reference — steps, modes, and end conditions.

Python API

Run simulations and pipelines against a saved protocol.

Commercial protocols

Upload a vendor protocol file and simulate it directly.

Protocol builder

Build a protocol visually in Ionworks Studio.