Mueez Khan
Mueez Khan
Mueez Khan
This post is based on a blog post I wrote for datHere's blog.
ckanaction library abstracts away common code to call API endpoints and replaces it with builder functions. Consider the following two code snippets and how they differ. In both snippets we attempt to access the /api/3/action/package_list endpoint to list 5 datasets.
First, let's view the code without using the ckanaction crate:
ckanaction crate:
ckanaction abstracts away extra crate dependencies, helper functions, and less convenient code into builder functions. Doing so allows simplification of code in order to focus on interacting with the CKAN instance's API instead of boilerplate code.
You may get started with the ckanaction crate by running cargo add ckanaction in your Rust project to add it as a dependency.
You may also find further examples and documentation about ckanaction on GitHub or view the web app at ckanaction.dathere.com.
Updates made to this blog post over time.
Submit a comment about this post that may be shared.
Receive updates during my career.
Technical writing on work experiences, projects, and tools you may find useful.