How do you copy layer metadata to another layer?

I need to copy just the layer metadata from one layer to another, how do I do that with the Sdf API?

Imagine I have a layer like this:

# usda 1.0
(
some = “stuff”
more = 123.4
upAxis = “Z”
)

And I want to get a handle to that Sdf.Layer in Python and then copy its data, raw, to another Sdf.Layer. How do I do it? I can only think of TransferContent but that copies everything (layer metadata, PrimSpecs, etc), not just the data that I needed.

UsdUtils.CopyLayerMetadata() should already do what you want, or you can examine its implementation!

I should’ve thought to check UsdUtils. I’ve gotten rusty. Thanks spiff!