How to get the source properties programmatically

If I obtain a source programmatically, is there a way to get the name of the source, if it is in “show” or “hide” mode, and the properties in general.

Example, I have

activeSource = GetActiveSource()
print(activeSource) 

I get
<paraview.servermanager.Transform object at 0x14c2d1d50>

How do I extract info from the object?

Here is a one-liner to do this:

[k for (k, v) in GetSources().items() if v == GetActiveSource()][0][0]

Background: The name is not an information property of the source - the server manager in ParaView keeps a dictionary from name/id to sources (and other proxies). This expression queries that dictionary.

Thanks a lot! That worked for getting the name.

But how can I get more info if a have an object like this:

<paraview.servermanager.Transform object at 0x14c2d1d50> ?

Info like for example, if the source is visible, it’s translate values, etc?

For properties of the source itself, you can use

s = GetActiveSource()
s.ListProperties()

The property names are returned in a list of strings. Each property can be accessed as an attribute of the source, e.g.

print(s.Radius)

To get display properties such as visibility, you have to get the representation of the source. You can list its properties the same way:

d = Show(s)
d.ListProperties()

Those properties are accessible as attributes as well.

The ParaView Guide covers a lot of this. For reference of specific source types, see the Python API docs and list of Available readers, sources, writers, filters and animation cues.

Great! Thanks.