An ocean data asset ID parser developed and used by [Axiom Data Science](http://axiomdatascience.com)
## Installation
##### Stable
pip install assetid
##### Development
pip install git+https://github.com/axiom-data-science/assetid.git
### IOOS URNs
[More Information](https://geo-ide.noaa.gov/wiki/index.php?title=IOOS_Conventions_for_Observing_Asset_Identifiers)
###### URN Normalization
Examples:
```python
from assetid.urn import IoosUrn
u = IoosUrn(asset_type='station', authority='axiom', label='station1')
print(u.__dict__)
# {'asset_type': 'station',
# 'authority': 'axiom',
# 'component': None,
# 'label': 'station1',
# 'discriminant': None}
print(u.urn)
# 'urn:ioos:station:axiom:station1'
```
```python
from assetid.urn import IoosUrn
u = IoosUrn.from_string('urn:ioos:station:axiom:station1')
print(u.__dict__)
# {'asset_type': 'station',
# 'authority': 'axiom',
# 'component': None,
# 'label': 'station1',
# 'discriminant': None}
print(u.urn)
# 'urn:ioos:station:axiom:station1'
```
```python
from assetid.urn import IoosUrn
# NetCDF variable attributes from a "sensor" urn
print(IoosUrn.from_string('urn:ioos:sensor:axiom:station1').attributes())
# {'standard_name': 'wind_speed'}
print(IoosUrn.from_string('urn:ioos:sensor:axiom:foo:lwe_thickness_of_precipitation_amount#cell_methods=time:mean,time:variance;interval=pt1h').attributes())
# {'standard_name': 'lwe_thickness_of_precipitation_amount',
# 'cell_methods': 'time: mean time: variance (interval: PT1H)'}
# URN from `dict` of variable attributes
attributes = {'standard_name': 'wind_speed',
'cell_methods': 'time: mean (interval: PT24H)'}
print(IoosUrn.from_dict('authority', 'label', attributes).urn)
# 'urn:ioos:sensor:authority:label:wind_speed#cell_methods=time:mean;interval=pt24h'
# URN from a `netCDF4` Variable object
nc = netCDF4.Dataset('http://thredds45.pvd.axiomalaska.com/thredds/dodsC/grabbag/USGS_CMG_WH_OBS/WFAL/9001rcm-a.nc')
print(IoosUrn.from_dict('authority', 'label', nc.variables['T_28'].dict).urn)
# 'urn:ioos:sensor:authority:label:sea_water_temperature'
```
Metadata
Release files for assetid 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| assetid-1.0.0.tar.gz | 6.9 kB | Without provenance | Details for assetid-1.0.0.tar.gz |
Release files / assetid-1.0.0.tar.gz
| Download URL | assetid-1.0.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af4970d6daa47d6c2dc56e51f6a165969e8ef3ffce9c47d3bb04224c7423e2c0
|
|
BLAKE2b-256 checksum How to use checksums |
3d260718ee8eacd2574b8a84295f3664371cb9c6ecabf04ef569301d68be8fb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for assetid 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.