geometamaker 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geometamaker/__init__.py +2 -2
- geometamaker/cli.py +137 -31
- geometamaker/config.py +3 -4
- geometamaker/geometamaker.py +357 -130
- geometamaker/models.py +317 -114
- {geometamaker-0.1.1.dist-info → geometamaker-0.2.0.dist-info}/METADATA +44 -43
- geometamaker-0.2.0.dist-info/RECORD +12 -0
- {geometamaker-0.1.1.dist-info → geometamaker-0.2.0.dist-info}/WHEEL +1 -1
- geometamaker-0.1.1.dist-info/RECORD +0 -12
- {geometamaker-0.1.1.dist-info → geometamaker-0.2.0.dist-info}/entry_points.txt +0 -0
- {geometamaker-0.1.1.dist-info → geometamaker-0.2.0.dist-info/licenses}/LICENSE.txt +0 -0
- {geometamaker-0.1.1.dist-info → geometamaker-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: geometamaker
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: metadata creation for geospatial data
|
|
5
5
|
Maintainer: Natural Capital Project Software Team
|
|
6
6
|
License:
|
|
@@ -225,16 +225,34 @@ Classifier: Topic :: Scientific/Engineering :: GIS
|
|
|
225
225
|
Requires-Python: >=3.9
|
|
226
226
|
Description-Content-Type: text/markdown
|
|
227
227
|
License-File: LICENSE.txt
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
Requires-Dist: aiohttp
|
|
229
|
+
Requires-Dist: click
|
|
230
|
+
Requires-Dist: fsspec
|
|
231
|
+
Requires-Dist: GDAL
|
|
232
|
+
Requires-Dist: frictionless>=5.10.0
|
|
233
|
+
Requires-Dist: numpy
|
|
234
|
+
Requires-Dist: platformdirs
|
|
235
|
+
Requires-Dist: Pydantic>=2.0
|
|
236
|
+
Requires-Dist: pygeoprocessing>=2.4.5
|
|
237
|
+
Requires-Dist: pyyaml
|
|
238
|
+
Requires-Dist: requests
|
|
239
|
+
Dynamic: license-file
|
|
240
|
+
|
|
241
|
+
## Introduction
|
|
242
|
+
|
|
243
|
+
GeoMetaMaker is a Python library for creating human and machine-readable
|
|
244
|
+
metadata for geospatial, tabular, and other data formats.
|
|
230
245
|
|
|
231
246
|
Supported datatypes include:
|
|
232
247
|
* everything supported by GDAL
|
|
233
248
|
* tabular formats supported by `frictionless`
|
|
234
249
|
* compressed formats supported by `frictionless`
|
|
235
250
|
|
|
251
|
+
## Installation
|
|
252
|
+
|
|
253
|
+
`mamba install -c conda-forge geometamaker`
|
|
236
254
|
|
|
237
|
-
|
|
255
|
+
## Basic Usage
|
|
238
256
|
|
|
239
257
|
This library comes with a command-line interface (CLI) called `geometamaker`.
|
|
240
258
|
Many of the examples below show how to use the Python interface, and then
|
|
@@ -271,6 +289,8 @@ resource.set_band_description(
|
|
|
271
289
|
|
|
272
290
|
resource.write()
|
|
273
291
|
```
|
|
292
|
+
For a complete list of methods and attributes:
|
|
293
|
+
https://geometamaker.readthedocs.io/en/latest/index.html
|
|
274
294
|
|
|
275
295
|
##### CLI
|
|
276
296
|
```
|
|
@@ -282,22 +302,30 @@ user-input. If you create a metadata document with the CLI, you may wish
|
|
|
282
302
|
to add these values manually by editing the
|
|
283
303
|
`watershed_gura.shp.yml` file in a text editor.
|
|
284
304
|
|
|
285
|
-
### Creating metadata for a
|
|
305
|
+
### Creating metadata for a collection of files:
|
|
306
|
+
Users can create a single metadata document to describe a directory of
|
|
307
|
+
files, with the option of excluding some files using a regular expression,
|
|
308
|
+
or limiting the number of subdirectory levels to traverse using the
|
|
309
|
+
`depth` or `-d` flag.
|
|
286
310
|
|
|
287
311
|
#### Python
|
|
288
312
|
```python
|
|
289
|
-
import os
|
|
290
|
-
|
|
291
313
|
import geometamaker
|
|
292
314
|
|
|
293
|
-
|
|
294
|
-
geometamaker.
|
|
315
|
+
collection_path = 'invest/data/invest-sample-data'
|
|
316
|
+
metadata = geometamaker.describe_collection(collection_path,
|
|
317
|
+
depth=2,
|
|
318
|
+
exclude_regex=r'.*\.json$',
|
|
319
|
+
describe_files=True)
|
|
320
|
+
metadata.write()
|
|
295
321
|
```
|
|
296
322
|
|
|
297
323
|
#### CLI
|
|
298
324
|
```
|
|
299
|
-
geometamaker describe -
|
|
325
|
+
geometamaker describe -d 2 --exclude .*\.json$ data/invest-sample-data
|
|
300
326
|
```
|
|
327
|
+
These examples will create `invest-sample-data-metadata.yml` as well as
|
|
328
|
+
create individual `.yml` documents for each dataset within the directory.
|
|
301
329
|
|
|
302
330
|
### Validating a metadata document:
|
|
303
331
|
If you have manually edited a `.yml` metadata document,
|
|
@@ -317,7 +345,7 @@ print(error)
|
|
|
317
345
|
geometamaker validate data/watershed_gura.shp.yml
|
|
318
346
|
```
|
|
319
347
|
|
|
320
|
-
### Validating all metadata documents in a directory
|
|
348
|
+
### Validating all metadata documents in a directory:
|
|
321
349
|
|
|
322
350
|
##### Python
|
|
323
351
|
```python
|
|
@@ -341,13 +369,10 @@ to all datasets they describe. Profiles can include `contact` information
|
|
|
341
369
|
and/or `license` information.
|
|
342
370
|
|
|
343
371
|
A profile can be saved to a configuration file so that it will be re-used
|
|
344
|
-
everytime you use `geometamaker`.
|
|
345
|
-
during runtime, which takes precedence over a profile in the config file.
|
|
372
|
+
everytime you use `geometamaker`.
|
|
346
373
|
|
|
347
|
-
|
|
374
|
+
##### Python
|
|
348
375
|
```python
|
|
349
|
-
import os
|
|
350
|
-
|
|
351
376
|
import geometamaker
|
|
352
377
|
from geometamaker import models
|
|
353
378
|
|
|
@@ -362,32 +387,11 @@ license = {
|
|
|
362
387
|
profile = models.Profile(contact=contact) # keyword arguments
|
|
363
388
|
profile.set_license(**license) # `set_*` methods
|
|
364
389
|
|
|
365
|
-
data_path = 'data/watershed_gura.shp'
|
|
366
|
-
# Pass the profile to the `describe` function
|
|
367
|
-
resource = geometamaker.describe(data_path, profile=profile)
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
#### Store a Profile in user-configuration
|
|
371
|
-
|
|
372
|
-
##### Python
|
|
373
|
-
```python
|
|
374
|
-
import os
|
|
375
|
-
|
|
376
|
-
import geometamaker
|
|
377
|
-
from geometamaker import models
|
|
378
|
-
|
|
379
|
-
contact = {
|
|
380
|
-
'individual_name': 'bob'
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
profile = models.Profile(contact=contact)
|
|
384
390
|
config = geometamaker.Config()
|
|
385
391
|
config.save(profile)
|
|
386
392
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
# need to be passed to `describe`. It is always applied.
|
|
390
|
-
resource = geometamaker.describe(data_path)
|
|
393
|
+
# The saved profile will automatically be applied during `describe`:
|
|
394
|
+
resource = geometamaker.describe('data/watershed_gura.shp')
|
|
391
395
|
```
|
|
392
396
|
|
|
393
397
|
##### CLI
|
|
@@ -396,6 +400,3 @@ geometamaker config
|
|
|
396
400
|
```
|
|
397
401
|
This will prompt the user to enter their profile information.
|
|
398
402
|
Also see `geometamaker config --help`.
|
|
399
|
-
|
|
400
|
-
### For a complete list of methods:
|
|
401
|
-
https://geometamaker.readthedocs.io/en/latest/api/geometamaker.html
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
geometamaker/__init__.py,sha256=fs8_0Wj-NfHHyK-wd5UHzMnCK2HxI0uWR_KtSbb8xXs,405
|
|
2
|
+
geometamaker/cli.py,sha256=FGwrwBxJV269G509w2qvNNVbdMpxKHZv671M5ojeryE,10339
|
|
3
|
+
geometamaker/config.py,sha256=KrDOFm_Wa15iZAmDxpy_yizBW3oIf0irqAVirFGWGLY,1964
|
|
4
|
+
geometamaker/geometamaker.py,sha256=EuI1Nwgh6L1cNwNeyJhUm59JXWiqbc9XHKw7zpEWYLs,28344
|
|
5
|
+
geometamaker/models.py,sha256=TF47XNKBhnSUScNXC3jk1Op_Icu7otLahApF3Kv0Hz0,27232
|
|
6
|
+
geometamaker/utils.py,sha256=RLFtobLdUAeJEKBnzsQmC2h-eJTYn22tjNPAq261EhE,932
|
|
7
|
+
geometamaker-0.2.0.dist-info/licenses/LICENSE.txt,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
|
|
8
|
+
geometamaker-0.2.0.dist-info/METADATA,sha256=-tSGY0ik9gLL_Lc0RpEf_RiPNRQoL41CP9MKZ53SrzE,19090
|
|
9
|
+
geometamaker-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
geometamaker-0.2.0.dist-info/entry_points.txt,sha256=fY8nmpxmOO5kA47EBpKBKzaq3uZ1tWPA1sBgRJKvVU4,54
|
|
11
|
+
geometamaker-0.2.0.dist-info/top_level.txt,sha256=cm34aKGvrHyEgqNXi3Cx9LTU1Sm79r1RkpQZpy9MoxA,13
|
|
12
|
+
geometamaker-0.2.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
geometamaker/__init__.py,sha256=b3nR9UoJ7mWbD4z87B9BbrcnswpWEHgh9tC2SBvDYy4,391
|
|
2
|
-
geometamaker/cli.py,sha256=87-ZDiReWuqyWPGkRMedJVWmIhcMC41TUtgiqqz6E1k,6277
|
|
3
|
-
geometamaker/config.py,sha256=6xsBkU57QJlmehP0PcHL-f8Ev0KmYdrBrDb9IW5z99U,1974
|
|
4
|
-
geometamaker/geometamaker.py,sha256=JQpsNXo7EU_J11aZnN1RSPufw7L3DDf_nAvoevPLRJA,18522
|
|
5
|
-
geometamaker/models.py,sha256=aANY0vCKAz2gx4vIH0qnGicIhPXLTLZgXnByWOg-ER8,19054
|
|
6
|
-
geometamaker/utils.py,sha256=RLFtobLdUAeJEKBnzsQmC2h-eJTYn22tjNPAq261EhE,932
|
|
7
|
-
geometamaker-0.1.1.dist-info/LICENSE.txt,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
|
|
8
|
-
geometamaker-0.1.1.dist-info/METADATA,sha256=4fqXeDNFxQT_X_JWkpKqXjH0_-SayMdf2fta57ubLNc,18674
|
|
9
|
-
geometamaker-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
-
geometamaker-0.1.1.dist-info/entry_points.txt,sha256=fY8nmpxmOO5kA47EBpKBKzaq3uZ1tWPA1sBgRJKvVU4,54
|
|
11
|
-
geometamaker-0.1.1.dist-info/top_level.txt,sha256=cm34aKGvrHyEgqNXi3Cx9LTU1Sm79r1RkpQZpy9MoxA,13
|
|
12
|
-
geometamaker-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|