Dataform packages are collections of code that help other analysts work with data. Some packages help model specific datasets (for example the Segment package), and other packages make helpful utility functions available for others to use (soon, watch this space).
To see how packages work, watch this short video.
Creating a package
Clone the base package repo
This repo contains the building blocks of a package:
To get started, clone this repo into a location of your choice. Make sure the repo is public (if you'd like to share it with others).
Optional: Import the cloned repo to Dataform Web
To make development of your package easier, you may want to import it to Dataform web. This will give you real-time errors and warnings, and a visual representation of the data catalog and dependency graph.
To import the repo, follow this link.
Update the base repo to add your packages functionality
The base package repo creates a simple dependency graph with one declaration and two chained tables reading from that declaration. Explore the files in the package to get an idea of how it's put together. Then, start making the changes to create the functionality you'd like to create in your package. At a minimum, you should update:
If you're not quite sure how to set your package up, you may want to explore the code respoitories for other Dataform packages. Alternatively, ask the community in our Slack channel.
Connect to a data warehouse and test it out
Once you're done, it's a good idea to connect to a data warehouse and make sure it's doing what you expected.
Release to the community!
On behalf of the Dataform community, thanks in advance for your contribution!