| published by | Software Crafts |
|---|---|
| in blog | Software Crafts |
| original entry | Django or Python package to save API responses |
One of the tedious (and time consuming) parts of testing or creating a demo environment is creating realistic test data, that remains up to date with the latest code and database schema.
As part of this new project I am about to start, the system will be consuming a fair few third-party API's to create the product. I would like to create a demo environment from day zero as this will have a couple of benefits, namely illustrating the value to leads and letting us iterate on the frontend features faster.
I'm wondering if a package exists to accomplish this goal? If not, then it's going to be on my todo list fairly soon. I'm there will be a script element to run generate data and have it saved in files or do some code generation that will generate factory methods to create the necessary data by creating model instances or call the APIs to get the data and then save that data, or perhaps code gen to create demo API clients.
As I'm writing this, there are two distinct problems, first is data held in the database, this is more defined as libraries exist to help with this. The second problem is data coming from API's. Here there is more custom code, unless OpenAPI can help (assuming the third-parties using Open API spec)? I'm not sure what exists in this space, I'll write when I find out! Or could the data be saved as I'm doing development?
Lots of questions, that will have answers in the coming months. This will be a tool I create for this project. Let me know if you have any tools for demo data creation or is it all too specific to a single project to be useful?