Validator and linter for Portolan catalogs
Project description
rashid
Validator and linter for Portolan catalogs. The name comes from the Arabic root ر ش د, whose participles رَاشِدٌ and رَشِيدٌ mean "taking, or following, a right way or course or direction".
rashid reads a catalog directory and reports every rule it breaks.
Install
uv tool install rashid
The data pass reads asset bytes and needs a geospatial stack. Install the extra when you plan to run it.
uv tool install "rashid[data]"
Check a catalog
rashid check path/to/catalog
An exit code of 0 means the catalog broke no MUST. An exit code of 1 means it broke at least one.
Three passes are off by default.
rashid check path/to/catalog --schema --data --live
Each of those reaches the network, and --data also needs rashid[data]. Add --json for a machine-readable report.
What it checks
Validation runs as five separable passes.
Metadata. Every spec requirement rashid can check from the catalog's JSON, without reading asset bytes.
Structural. STAC 1.1.0 core validity, delegated to stac-validator. Only the core schema applies. Declared extensions belong to the metadata pass, which keeps an unpublished extension schema from failing the tree.
Schema. The published Portolan profile schema, applied to every object. rashid also implements those requirements in code, which yields precise messages and fix hints. Running both catches drift between them, at the cost of reporting some defects twice. Opt in with --schema.
Data. Asset bytes, local files and remote https URLs alike, checked against the declared metadata and the format rules. rashid recomputes checksum and size, confirms media type by magic number, and enforces storage rules a metadata reader cannot see. Expect a real catalog to fail here on rules its metadata satisfies, because this pass is stricter than what current tooling emits. Opt in with --data.
Live hosting. The servers behind remote https assets, probed for HTTP range support and CORS. Those are properties of the server rather than of any file. Range and CORS cost one probe per host, and each asset costs one HEAD. Opt in with --live.
A pass that cannot run reports a warning rather than passing quietly.
Use it as a library
from rashid import validate
report = validate("path/to/catalog")
for finding in report.errors:
print(finding.message)
validate() runs the metadata pass alone. The keyword arguments structural, schema, data, and live add the others. Note that the CLI runs the structural pass by default while the library does not, since it reaches the network.
RulesConfig skips rules or changes their severity.
from rashid import RulesConfig, Severity, validate
config = RulesConfig(
disabled=frozenset({"PTL-VIZ-004"}),
severity_overrides={"PTL-TTL-002": Severity.ERROR},
)
report = validate("path/to/catalog", config=config)
Report also carries passed, warnings, infos, and to_dict().
Rules
Every finding carries a stable id shaped PTL-GROUP-NNN, a severity, a message, and the file path. MUST requirements become errors, and SHOULD requirements become warnings.
docs/rules.md lists the rule groups, the severity exceptions, and the codes rashid emits when a pass degrades.
Contributing
docs/contributing.md covers hook setup, the two-stage gate, and how to run the tests.
SPEC_REF records the portolan-spec commit the vendored fixtures were built from. A nightly workflow re-vendors them and opens a pull request when the spec moves.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rashid-0.1.0.tar.gz.
File metadata
- Download URL: rashid-0.1.0.tar.gz
- Upload date:
- Size: 348.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc084894703293201921fbe99bca8e77cdf005c5031a41e05106cb5c533453af
|
|
| MD5 |
d11e7a2b5f9f9adf6e85001a92fa1f9f
|
|
| BLAKE2b-256 |
ec1d9be1a64d8b9e40b38e06129e8fc1cf5c3abf404b663388f544f03db5986d
|
Provenance
The following attestation bundles were made for rashid-0.1.0.tar.gz:
Publisher:
publish.yml on portolan-sdi/rashid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rashid-0.1.0.tar.gz -
Subject digest:
cc084894703293201921fbe99bca8e77cdf005c5031a41e05106cb5c533453af - Sigstore transparency entry: 2259474609
- Sigstore integration time:
-
Permalink:
portolan-sdi/rashid@f356388f2c5c9a5d415379a467fd0f9617c3bffd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/portolan-sdi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f356388f2c5c9a5d415379a467fd0f9617c3bffd -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rashid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rashid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 83.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b346096a47b4ae9a849aa6b5d333ed017730046a1b4eea7fce86414340b93ea
|
|
| MD5 |
e454ef3b69f29ede03111b9d44e834f1
|
|
| BLAKE2b-256 |
699fcb8ea72e3265c555cae9d3d9be83544b71af29a29e05aeda753ecd5ce07f
|
Provenance
The following attestation bundles were made for rashid-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on portolan-sdi/rashid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rashid-0.1.0-py3-none-any.whl -
Subject digest:
5b346096a47b4ae9a849aa6b5d333ed017730046a1b4eea7fce86414340b93ea - Sigstore transparency entry: 2259474889
- Sigstore integration time:
-
Permalink:
portolan-sdi/rashid@f356388f2c5c9a5d415379a467fd0f9617c3bffd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/portolan-sdi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f356388f2c5c9a5d415379a467fd0f9617c3bffd -
Trigger Event:
workflow_dispatch
-
Statement type: