I'm migrating some of old bash scripts to python, both for utilitar and educational purposes. In Bash i'd use something like
cat dir/*csv|split -n5 -d --filter="gzip -c - >$FILE.gz" -L20000 - combined/part-
and get directory with number of archived files with correct number of records each.
I'm wondering what library or approach in Python would behave in a similar way to gnu split?