as per man tar (a long reading)
--transform=EXPRESSION, --xform=EXPRESSION
Use sed replace EXPRESSION to transform file names.
I used
find . -name \*.py -print | xargs tar cf tmp7/test-py.tar --transform=s:./.*/:: -
all files were on same level.
#sed expression
sed expression
s:./.*/::: (greedy) replace./.*/by nothing.
#bonus:
bonus:
find . -name \*.py -print | sed -e s:./.*/:: | awk 'a[$1]++ { print ; }'
will print dupplicate filename.