Is it possible to write a python script that does source-filtering for source specific multicast?

is it possible to write a python script that does source-filtering for source specific multicast?

You provide insufficient information for a considered response.
What OS, etc?
Did you mean is it possible? Likely answer is YES.
Or did you mean how can I achieve this?