Create a python3 program that:
Download a file from a given URL. Here some samples:
- small (10k lines) - small.csv
- medium (100k lines) - medium.csv
- large (1M lines) - large.csv
Then, split the downloaded file content by date from delivery_datetime and destination_country_code into different files of 10k lines maximum each.
source: small.csv
expected outputs:
20210210_DE.csv
20210210_FR.csv
20210210_UK.csv
...
Ensure following requirements on output data:
product_idvalue MUST be an integerproduct_idvalue MUST be 10001 (consider only thisproduct_id)destination_country_codeMUST be a valid Country ISO Code
- producer_id
- producer_name
- product_id
- product_name
- product_unit
- quantity
- specifications_id
- delivery_datetime
- destination_country_code
- A readable Python script
- No alteration of the downloaded file, as it could be provided by customers, you MUST NOT edit it.
- A pure-python solution: no external database engine (MySQL, Cassandra, etc...), no shell command executed from the Python script...
- A scalable solution: the script should work with small (10k lines), a medium (100k lines), a large file (1M lines), and a huge file (10M lines).
- A text file (Markdown, reStructured, text, ...) explaining how the code works and why you implemented it that way, keep it short if possible.
- Your code will be compatible with PEP8
- Writing tests