geometamaker 0.1.2__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.2.dist-info → geometamaker-0.2.0.dist-info}/METADATA +32 -42
- geometamaker-0.2.0.dist-info/RECORD +12 -0
- {geometamaker-0.1.2.dist-info → geometamaker-0.2.0.dist-info}/WHEEL +1 -1
- geometamaker-0.1.2.dist-info/RECORD +0 -12
- {geometamaker-0.1.2.dist-info → geometamaker-0.2.0.dist-info}/entry_points.txt +0 -0
- {geometamaker-0.1.2.dist-info → geometamaker-0.2.0.dist-info/licenses}/LICENSE.txt +0 -0
- {geometamaker-0.1.2.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:
|
|
@@ -236,16 +236,23 @@ Requires-Dist: Pydantic>=2.0
|
|
|
236
236
|
Requires-Dist: pygeoprocessing>=2.4.5
|
|
237
237
|
Requires-Dist: pyyaml
|
|
238
238
|
Requires-Dist: requests
|
|
239
|
+
Dynamic: license-file
|
|
239
240
|
|
|
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.
|
|
241
245
|
|
|
242
246
|
Supported datatypes include:
|
|
243
247
|
* everything supported by GDAL
|
|
244
248
|
* tabular formats supported by `frictionless`
|
|
245
249
|
* compressed formats supported by `frictionless`
|
|
246
250
|
|
|
251
|
+
## Installation
|
|
252
|
+
|
|
253
|
+
`mamba install -c conda-forge geometamaker`
|
|
247
254
|
|
|
248
|
-
|
|
255
|
+
## Basic Usage
|
|
249
256
|
|
|
250
257
|
This library comes with a command-line interface (CLI) called `geometamaker`.
|
|
251
258
|
Many of the examples below show how to use the Python interface, and then
|
|
@@ -282,6 +289,8 @@ resource.set_band_description(
|
|
|
282
289
|
|
|
283
290
|
resource.write()
|
|
284
291
|
```
|
|
292
|
+
For a complete list of methods and attributes:
|
|
293
|
+
https://geometamaker.readthedocs.io/en/latest/index.html
|
|
285
294
|
|
|
286
295
|
##### CLI
|
|
287
296
|
```
|
|
@@ -293,22 +302,30 @@ user-input. If you create a metadata document with the CLI, you may wish
|
|
|
293
302
|
to add these values manually by editing the
|
|
294
303
|
`watershed_gura.shp.yml` file in a text editor.
|
|
295
304
|
|
|
296
|
-
### 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.
|
|
297
310
|
|
|
298
311
|
#### Python
|
|
299
312
|
```python
|
|
300
|
-
import os
|
|
301
|
-
|
|
302
313
|
import geometamaker
|
|
303
314
|
|
|
304
|
-
|
|
305
|
-
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()
|
|
306
321
|
```
|
|
307
322
|
|
|
308
323
|
#### CLI
|
|
309
324
|
```
|
|
310
|
-
geometamaker describe -
|
|
325
|
+
geometamaker describe -d 2 --exclude .*\.json$ data/invest-sample-data
|
|
311
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.
|
|
312
329
|
|
|
313
330
|
### Validating a metadata document:
|
|
314
331
|
If you have manually edited a `.yml` metadata document,
|
|
@@ -328,7 +345,7 @@ print(error)
|
|
|
328
345
|
geometamaker validate data/watershed_gura.shp.yml
|
|
329
346
|
```
|
|
330
347
|
|
|
331
|
-
### Validating all metadata documents in a directory
|
|
348
|
+
### Validating all metadata documents in a directory:
|
|
332
349
|
|
|
333
350
|
##### Python
|
|
334
351
|
```python
|
|
@@ -352,13 +369,10 @@ to all datasets they describe. Profiles can include `contact` information
|
|
|
352
369
|
and/or `license` information.
|
|
353
370
|
|
|
354
371
|
A profile can be saved to a configuration file so that it will be re-used
|
|
355
|
-
everytime you use `geometamaker`.
|
|
356
|
-
during runtime, which takes precedence over a profile in the config file.
|
|
372
|
+
everytime you use `geometamaker`.
|
|
357
373
|
|
|
358
|
-
|
|
374
|
+
##### Python
|
|
359
375
|
```python
|
|
360
|
-
import os
|
|
361
|
-
|
|
362
376
|
import geometamaker
|
|
363
377
|
from geometamaker import models
|
|
364
378
|
|
|
@@ -373,32 +387,11 @@ license = {
|
|
|
373
387
|
profile = models.Profile(contact=contact) # keyword arguments
|
|
374
388
|
profile.set_license(**license) # `set_*` methods
|
|
375
389
|
|
|
376
|
-
data_path = 'data/watershed_gura.shp'
|
|
377
|
-
# Pass the profile to the `describe` function
|
|
378
|
-
resource = geometamaker.describe(data_path, profile=profile)
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
#### Store a Profile in user-configuration
|
|
382
|
-
|
|
383
|
-
##### Python
|
|
384
|
-
```python
|
|
385
|
-
import os
|
|
386
|
-
|
|
387
|
-
import geometamaker
|
|
388
|
-
from geometamaker import models
|
|
389
|
-
|
|
390
|
-
contact = {
|
|
391
|
-
'individual_name': 'bob'
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
profile = models.Profile(contact=contact)
|
|
395
390
|
config = geometamaker.Config()
|
|
396
391
|
config.save(profile)
|
|
397
392
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
# need to be passed to `describe`. It is always applied.
|
|
401
|
-
resource = geometamaker.describe(data_path)
|
|
393
|
+
# The saved profile will automatically be applied during `describe`:
|
|
394
|
+
resource = geometamaker.describe('data/watershed_gura.shp')
|
|
402
395
|
```
|
|
403
396
|
|
|
404
397
|
##### CLI
|
|
@@ -407,6 +400,3 @@ geometamaker config
|
|
|
407
400
|
```
|
|
408
401
|
This will prompt the user to enter their profile information.
|
|
409
402
|
Also see `geometamaker config --help`.
|
|
410
|
-
|
|
411
|
-
### For a complete list of methods:
|
|
412
|
-
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.2.dist-info/LICENSE.txt,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
|
|
8
|
-
geometamaker-0.1.2.dist-info/METADATA,sha256=b2A4cOatxVrlv02MHxo66PrghdVgf5rx_rx_VxONIuI,18969
|
|
9
|
-
geometamaker-0.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
10
|
-
geometamaker-0.1.2.dist-info/entry_points.txt,sha256=fY8nmpxmOO5kA47EBpKBKzaq3uZ1tWPA1sBgRJKvVU4,54
|
|
11
|
-
geometamaker-0.1.2.dist-info/top_level.txt,sha256=cm34aKGvrHyEgqNXi3Cx9LTU1Sm79r1RkpQZpy9MoxA,13
|
|
12
|
-
geometamaker-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|