Skip to content

Commit 9dcffef

Browse files
lwjohnst86signekb
andauthored
fix: ✏️ edits from review
Co-authored-by: Signe Kirk Brødbæk <signekb@clin.au.dk>
1 parent a204fcc commit 9dcffef

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

posts/published-check-datapackage/index.qmd

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ categories:
1212

1313
On November 27th, 2025, we published our second Python package to
1414
[PyPI](https://pypi.org/project/check-datapackage). This package forms
15-
the basis for ensuring that any metadata we create or edit for a [Data
15+
the basis for ensuring that any metadata created or edited for a [Data
1616
Package](https://decisions.seedcase-project.org/why-frictionless-data/)
1717
is correct and compliant with the [Data Package
18-
standard](https://datapackage.org). And since we are and will be working
18+
standard](https://datapackage.org). Since we are and will be working
1919
with and managing many Data Packages over the coming years, this is an
20-
important tool for us to have!
20+
important tool for us to have! Generally, this will be a helpful tool for anyone working with and managing Data Packages.
2121

2222
## What's `check-datapackage`?
2323

2424
As with all our packages and software tools, we have a dedicated website
2525
for
2626
[`check-datapackage`](https://check-datapackage.seedcase-project.org).
2727
So, rather than repeat what is already in that website, this post gives
28-
a very quick overview of what it is and why you might want to use it. It
28+
a very quick overview of what this package does and why you might want to use it. It
2929
can be summarised by its tagline:
3030

3131
> Ensure the compliance of your Data Package metadata
3232
33-
The "only" thing it does is checks the content of a `datapackage.json`
33+
The "only" thing `check-datapackage` does is to check the content of a `datapackage.json`
3434
file against the standard. Nothing fancy. But we designed it to be
3535
configurable, so that if you have specific needs for your Data Package,
36-
you can adjust the checks accordingly. For example, if you want to
37-
ensure that certain fields are always present in the metadata, you can
36+
you can adjust the checks accordingly. It's possible to both add checks on top of the standard or ignore certain checks from the standard. For example, if you want to
37+
ensure that certain fields that aren't required by the standard are always present in the metadata, you can
3838
set up the checks to enforce that.
3939

4040
For now, `check-datapackage` is only a few Python functions and classes
4141
that you can use within your own Python scripts. But in the future, we
4242
plan to develop a command-line interface (CLI) so that you can use it
4343
directly from your terminal without needing to write any code. Along
4444
with including a config file, we hope to incorporate `check-datapackage`
45-
into typical build tools or automated check workflows.
45+
into typical build tools and automated check workflows.
4646

4747
## Why use it?
4848

49-
We wanted this package to be incredibly simple and focused in its scope.
49+
We wanted this package to be incredibly simple and focused.
5050
If you install or use it, you know exactly what it does. It also doesn't
5151
include extra dependencies or features that you might not need. We
5252
wanted it lightweight and easy to use.
@@ -56,32 +56,33 @@ Packages, such as the
5656
[frictionless-py](https://pypi.org/project/frictionless/) package, we
5757
didn't want all the extras that came with these packages. Nor are these
5858
tools easy to configure for our needs. In this regard, there were no
59-
tools available that fit ours needs. So we built our own package that
60-
does exactly what we need. And hopefully it might be useful for you too!
59+
tools available that fit ours needs. So, we built our own package that
60+
does exactly what we need. Hopefully, it will be useful for other people too!
6161

6262
Eventually, when we develop `check-datapackage` as a CLI, you could
6363
include it as a [pre-commit hook](https://pre-commit.com/) or part of
6464
your [continuous
6565
integration](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration)
6666
workflow so that every time you make changes to your Data Package
6767
metadata, it is automatically checked for compliance. That way, you will
68-
always know that everything is good with your Data Package metadata. At
69-
least, good according to the standard and your specific needs!
68+
always know that your Data Package metadata lives up to the standard and
69+
your configuration.
7070

7171
### Example use
7272

7373
We have a detailed
7474
[guide](https://check-datapackage.seedcase-project.org/docs/guide/) on
7575
how to use `check-datapackage`. But I'll briefly show how you might use
76-
`check-datapackage`. The main function you would use is `check()`, which
76+
`check-datapackage`. The main function of the package is `check()`, which
7777
takes as input the properties of a Data Package (i.e., the contents of
78-
the `datapackage.json` file) as a Python dictionary.
78+
the `datapackage.json` file) as a Python dictionary and checks it against the standard.
7979

8080
``` python
8181
import check_datapackage as cdp
8282

8383
# Normally you'd read in the `datapackage.json` file, but we'll
84-
# show the actual contents here as a Python dict.
84+
# show the actual contents here as a Python dict. Can use
85+
# the `read_json()` helper function to read in `datapackage.json`
8586
properties = {
8687
"name": "woolly-dormice",
8788
"id": "123-abc-123",
@@ -115,17 +116,17 @@ parameter `error` to `True`:
115116
cdp.check(properties, error=True)
116117
```
117118

118-
If you wanted to exclude certain checks, you can do that by using the
119-
`Config` and `Exclusion` classes. For example, if you wanted to ignore
120-
all required checks, you could do:
119+
If you want to exclude certain checks, you can do that by using the
120+
`Config` and `Exclusion` classes. For example, if you want to exclude
121+
all required checks, you can define the exclusion, add it to the configuration, and pass it to the check function like so:
121122

122123
``` python
123124
exclusion_required = cdp.Exclusion(type="required")
124125
config = cdp.Config(exclusions=[exclusion_required])
125126
cdp.check(properties=package_properties, config=config)
126127
```
127128

128-
If you wanted the issues listed in a more human-friendly way, we have
129+
If you want the issues listed in a more human-friendly way, you can use
129130
the `explain()` function that takes the list of issues returned by
130131
`check()` and formats them nicely:
131132

@@ -134,7 +135,7 @@ issues = cdp.check(properties)
134135
cdp.explain(issues)
135136
```
136137

137-
There's many other things you can configure in `check-datapackage`, so
138+
There's many other checks you can configure with `check-datapackage`, so
138139
be sure to check out the
139140
[website](https://check-datapackage.seedcase-project.org) for more
140141
information!

0 commit comments

Comments
 (0)