File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # package_validator
2- PLANMAP packages validation framework
1+ # PLANMAP package validator
2+
3+ This tool validates the structure and content of a Planmap package.
4+
5+ The validator gets as input the path to a (PM) package and then
6+ run a series of checks following a package/data model.
7+
8+ ## To run the validator
9+
10+ Since I'm trying different methods to have this validator steps running together, there are different ways to run _ a_ validator.
11+
12+ * Pytest:
13+
14+ ``` bash
15+ $ pytest --pkgpath ' path/to/geopackage.gpkg'
16+ ```
17+
18+ * Custom (python pipeline):
19+
20+ ` ` ` bash
21+ $ python validate.py < path>
22+ ` ` `
23+
24+ # # Where are the models
25+
26+ # # How to modify the models
Original file line number Diff line number Diff line change 1- import gpt
1+ import os
22import check
33
44if __name__ == '__main__' :
5- import sys
5+ import argparse
6+ parser = argparse .ArgumentParser (description = "Validate Geopackages" )
67
7- if len (sys .argv ) < 2 :
8- print ("\n Usage: {} <path/to/geopackage>" .format (sys .argv [0 ]))
9- sys .exit (1 )
8+ parser .add_argument ('gpkg' , type = str ,
9+ help = "File/path to Geopackage" )
10+
11+ args = parser .parse_args ()
12+
13+ filename = args .gpkg
14+ assert os .path .isfile (filename ), f"Filename '{ filename } ' does not exist"
1015
11- filename = sys .argv [1 ]
1216 check .geopackage (filename )
You can’t perform that action at this time.
0 commit comments