What is a data resource?
In the previous sections, we have seen how to create and manage package metadata for our data package. In this section, we will explore how we can add data files and manage its metadata (e.g. documenting the type of data in each column). In a Data Package, data files are referred to as data resources, each containing a conceptually distinct set of data. We refer to the metadata for a data resource as “resource metadata”.
Creating a data resource
Creating a data resource requires that your data is in the correct format. Usually, generated or collected data starts out in a “raw” shape that needs to be cleaned and organized into so called “tidy data” before it can become a data resource. How to tidy data will differ from dataset to dataset and is outside the scope of Sprout, so we will not cover the procedure in detail here. Ideally you would use a Python package such as Polars. to tidy your data, so that you have a record of the steps taken to clean and transform the data. After cleaning, your data should follow the specification outlined in our documentation, specifically that it needs to be a Polars DataFrame.
For this guide, we have a fake dataset on the diabetes patients that is already tidy. You save any raw and/or downloaded data into the raw/ folder, so that we can keep the original “raw” data separate from the processed data. For this file, it will be called patients.csv.
The raw/patients.csv file includes data about patients with diabetes, which look like this: