I'm currently involved in modifying some system setup scripts to use parted rather than sfdisk, and I'm not entirely sure how to convert those commands.
The existing sfdisk command is passed numeric partition-type identifiers; I'm reasonably sure it can only be 82 ("Linux swap") or 83 ("Linux native partition"). For example:
$ sfdisk /dev/sda << EOT
0,100,83,
100,200,82,
EOT
How would I express this configuration to parted? My best guess at the moment would be:
$ parted /dev/sda mkpart primary 0 100 mkpart primary linux-swap 100 200
A lot of my confusion stems from parted's seeming treatment of a Linux swap partition as a type of filesystem, while the fact that it has an assigned partition type ID seems to make it a type of partition.