Axiom数据科学开发和使用的海洋数据资产ID解析器
项目描述
# assetid [](https://travis-ci.org/axiom-data-science/assetid)
Axiom数据科学开发和使用的海洋数据资产ID解析器
## 安装
##### 稳定版本
pip安装assetid
##### 开发版本
pip install git+https://github.com/axiom-data-science/assetid.git
### IOOS URNs
[更多信息](https://geo-ide.noaa.gov/wiki/index.php?title=IOOS_Conventions_for_Observing_Asset_Identifiers)
###### URN标准化
示例
```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变量属性来自一个“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来自`dict`变量属性
attributes = {'standard_name': 'wind_speed',
'cell_methods': 'time: mean (interval: PT24H)'}
打印(IoosUrn.from_dict('authority', 'label', attributes).urn)
# 'urn:ioos:sensor:authority:label:wind_speed#cell_methods=time:mean;interval=pt24h'
# 来自`netCDF4`变量对象的URN
nc = netCDF4.Dataset('http://thredds45.pvd.axiomalaska.com/thredds/dodsC/grabbag/USGS_CMG_WH_OBS/WFAL/9001rcm-a.nc')
打印(IoosUrn.from_dict('authority', 'label', nc.variables['T_28'].dict).urn)
# 'urn:ioos:sensor:authority:label:sea_water_temperature'
```
Axiom数据科学开发和使用的海洋数据资产ID解析器
## 安装
##### 稳定版本
pip安装assetid
##### 开发版本
pip install git+https://github.com/axiom-data-science/assetid.git
### IOOS URNs
[更多信息](https://geo-ide.noaa.gov/wiki/index.php?title=IOOS_Conventions_for_Observing_Asset_Identifiers)
###### URN标准化
示例
```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变量属性来自一个“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来自`dict`变量属性
attributes = {'standard_name': 'wind_speed',
'cell_methods': 'time: mean (interval: PT24H)'}
打印(IoosUrn.from_dict('authority', 'label', attributes).urn)
# 'urn:ioos:sensor:authority:label:wind_speed#cell_methods=time:mean;interval=pt24h'
# 来自`netCDF4`变量对象的URN
nc = netCDF4.Dataset('http://thredds45.pvd.axiomalaska.com/thredds/dodsC/grabbag/USGS_CMG_WH_OBS/WFAL/9001rcm-a.nc')
打印(IoosUrn.from_dict('authority', 'label', nc.variables['T_28'].dict).urn)
# 'urn:ioos:sensor:authority:label:sea_water_temperature'
```
项目详情
关闭
assetid-1.0.0.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | af4970d6daa47d6c2dc56e51f6a165969e8ef3ffce9c47d3bb04224c7423e2c0 |
|
MD5 | 2ac26e7da677719d62bc78b179b1b641 |
|
BLAKE2b-256 | 3d260718ee8eacd2574b8a84295f3664371cb9c6ecabf04ef569301d68be8fb1 |