You can remove string.punctuation or provide any subset of characters via char_setkwarg.
As mentioned python's documentation:
secrets should be used instead of default pseudo-random number generator in
the random module, which is designed for modelling and simulation, not
security or cryptography.