ISTS3核心库
istsos的Python项目详细描述
#ISTSOS3
在这个存储库中,您可以找到ISTSOS3 python3模块。
按照说明,您将能够在计算机上运行并使用ISTSOS3的核心。
对于完整的打包版本,请转到(todo:dowload页的链接)。
要安装ISTSO3,可以使用pip:
`` bash
pip3安装ISTSO
````
《开发者安装指南》
如果您认为对开发有贡献,请在正式存储库中创建一个fork,然后将fork克隆到您的工作站上。
不是为了做一些测试,你可以直接克隆官方的存储库。
``bash
git clone https://github.com/istsos/istsos3.git
``````
install all the dependencies
``bash
sudo apt get install postgresql postgis python3 pip
````
特性:
``bash
sudo pip3 install lxml\
jsonschema\
python dateutil\
tornado\
psycopg2\
aiopg\
pytest
```
SQL文件
(postgresql 9.4\u istsos3.0.0.0.sql)可以在
`` istsos3/assets``文件夹中找到。
`` bash
sudo-u postgres createdb-e utf8 istsos3
sudo-u postgres psql-postsos3-a\
-f istsos3/istsos/istsos/assets/postgresql9.4\u istsos3.0.0.0.sql br/>```
设置postgres用户密码
``bash
sudo-u postgres psql
alter user postgres password'postgres';
````
ctrl-d退出psql控制台
根据加载程序属性创建配置文件。
``bash
cd istsos3
cp config-example.json config.json
```
编辑配置文件:
``json
{
"type":"aiopg"、
"host":"localhost"、
"port":"5432"、
"user":"postgres"、
"password":"postgres"、
"database":"istsos3"
}
```
使用[Townado网站](http://www.tornadowweb.org)进行网上试用[Townado网站](http://www.tornadowweb.http://www.tornadowweb.http://www.tornadowweb.org)进行网上试用
`` bash
python3实例/server-trando.py
`` ` `
收听http://localhost:8887/sos
lib使用:http://docs.pytest.org/en/latest/
/>//////////////////////todo-empoemprove this]
//是的st/folder在那里执行了与
相同的测试。
若要运行单个测试,请从
>终端执行此操作:
``bash
py test-s istsos/test/actions/actions/servers/sos-2-u 0/test-getcapabilitiesop.py
```
<>
``bash
``bash
``pytest-s istsos/test/actions/servers/sos-2-u 0/test/test-descibesensorop.py
`
` ` `
` ` `
基准
[要改进这个]
您还可以使用[示例/速度](示例/速度)文件夹中的文件进行一些基本的基准测试。
也许我们可以看一下这个工具:https://github.com/wg/wrk
``bash
``python curl.py http://localhost/sos
`````
使用curl:
``bash
curl-s-w'\n time廑namelookup=%{time廑namelookup}\ntime廑pretransfer=%{time廑pretransfer}\ntime廑startttransfer=%{time廑startttransfer}\ntime廑total=%{time廑total}\n\n'-o/dev/null"http://the.request?to=test"
```
```documentation
itlab.com/features/gitlab ci cd/
测试在远程存储库的每次提交时自动执行。
测试在Docker环境中执行。
e在本地测试,按照以下步骤进行:
``bash
sudo add apt repository"deb[arch=amd64]https://download.docker.com/linux/ubuntu$(lsb_release-cs)stable"
`````
install docker
``bash
sudo apt get update
sudo apt get install docker ce
```
sudo-usermod-ag docker${user}
su-${user}
```````
\\\\\\\\\安装gitlab ci runner
从以下网址下载正确的deb(gitlab-ci-multi-runner-gitlab-ci-multi-runner-amd64.deb)地址:
```bash
https://gitlab-ci-multi-runner-multi-runner-runner-multi-runner-amd64.deb)地址:
http://gitlab-lablablab-ci-ci--多用途Ti-runner\u amd64.deb
```````
>安装Gitlab Ci Runner:
```bash
>sudo dkpg-i gitlab-ci-multi-runner\u amd64.deb
`````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` br/>cd git root
gitlab runner exec docker[测试名称]
`````
始终必须包含脚本关键字。
如果测试失败,作业将停止。
操作系统/测试/操作/服务器/休息/测试材料.py
-py test-s ist s os/测试/操作/服务器/休息/测试方法.py
-pytest-s istsos/测试/操作/服务器/休息/测试提供.py
-pytest-s istsos/测试/操作/服务器/休息/测试样品.py
```````
SOS3 lib用法
用法示例:
[有待改进]
``python
import asyncio
from istsos.application import server
from istsos.entity.httprequest import httprequest
@asyncio.coroutine
def execute():
server=yield from servicer.create()
request=httprequest(
"get"、
"sos"、
参数={
"service":"sos"、
"version":"2.0.0"、
"request":"getobservation"、
"offering":"t_lugano"、
"temporalfilter":(
"OM:PhenomenonTime,"
"2009-01-01t00:00+0100/"
"2009-01-02t00:00+0100"
)
}
)
response=yield from server.execute_http_request(request,stats=true)
print("\nloaded%s observations"%len(响应['observations'])
loop=asyncio.get_event_loop()
loop.run_直到完成(
asyncio.gather(execute())
loop.close()
````
将在给定路径中创建新的配置文件(默认为config.pickle)。
``python
"type":"aiopg",
"host":"localhost",
"port":"5432",
"user":"postgres",
"password":"postgres",
"database":"istsos3"
}
}
}
)
```
在这个存储库中,您可以找到ISTSOS3 python3模块。
按照说明,您将能够在计算机上运行并使用ISTSOS3的核心。
对于完整的打包版本,请转到(todo:dowload页的链接)。
要安装ISTSO3,可以使用pip:
`` bash
pip3安装ISTSO
````
《开发者安装指南》
如果您认为对开发有贡献,请在正式存储库中创建一个fork,然后将fork克隆到您的工作站上。
不是为了做一些测试,你可以直接克隆官方的存储库。
``bash
git clone https://github.com/istsos/istsos3.git
``````
install all the dependencies
``bash
sudo apt get install postgresql postgis python3 pip
````
特性:
``bash
sudo pip3 install lxml\
jsonschema\
python dateutil\
tornado\
psycopg2\
aiopg\
pytest
```
SQL文件
(postgresql 9.4\u istsos3.0.0.0.sql)可以在
`` istsos3/assets``文件夹中找到。
`` bash
sudo-u postgres createdb-e utf8 istsos3
sudo-u postgres psql-postsos3-a\
-f istsos3/istsos/istsos/assets/postgresql9.4\u istsos3.0.0.0.sql
设置postgres用户密码
``bash
sudo-u postgres psql
alter user postgres password'postgres';
````
ctrl-d退出psql控制台
根据加载程序属性创建配置文件。
``bash
cd istsos3
cp config-example.json config.json
```
编辑配置文件:
``json
{
"type":"aiopg"、
"host":"localhost"、
"port":"5432"、
"user":"postgres"、
"password":"postgres"、
"database":"istsos3"
}
```
使用[Townado网站](http://www.tornadowweb.org)进行网上试用[Townado网站](http://www.tornadowweb.http://www.tornadowweb.http://www.tornadowweb.org)进行网上试用
`` bash
python3实例/server-trando.py
`` ` `
收听http://localhost:8887/sos
lib使用:http://docs.pytest.org/en/latest/
/>//////////////////////todo-empoemprove this]
//是的st/folder在那里执行了与
相同的测试。
若要运行单个测试,请从
>终端执行此操作:
``bash
py test-s istsos/test/actions/actions/servers/sos-2-u 0/test-getcapabilitiesop.py
```
<>
``bash
``bash
``pytest-s istsos/test/actions/servers/sos-2-u 0/test/test-descibesensorop.py
`
` ` `
` ` `
基准
[要改进这个]
您还可以使用[示例/速度](示例/速度)文件夹中的文件进行一些基本的基准测试。
也许我们可以看一下这个工具:https://github.com/wg/wrk
``bash
``python curl.py http://localhost/sos
`````
使用curl:
``bash
curl-s-w'\n time廑namelookup=%{time廑namelookup}\ntime廑pretransfer=%{time廑pretransfer}\ntime廑startttransfer=%{time廑startttransfer}\ntime廑total=%{time廑total}\n\n'-o/dev/null"http://the.request?to=test"
```
```documentation
itlab.com/features/gitlab ci cd/
测试在远程存储库的每次提交时自动执行。
测试在Docker环境中执行。
e在本地测试,按照以下步骤进行:
``bash
sudo add apt repository"deb[arch=amd64]https://download.docker.com/linux/ubuntu$(lsb_release-cs)stable"
`````
install docker
``bash
sudo apt get update
sudo apt get install docker ce
```
sudo-usermod-ag docker${user}
su-${user}
```````
\\\\\\\\\安装gitlab ci runner
从以下网址下载正确的deb(gitlab-ci-multi-runner-gitlab-ci-multi-runner-amd64.deb)地址:
```bash
https://gitlab-ci-multi-runner-multi-runner-runner-multi-runner-amd64.deb)地址:
http://gitlab-lablablab-ci-ci--多用途Ti-runner\u amd64.deb
```````
>安装Gitlab Ci Runner:
```bash
>sudo dkpg-i gitlab-ci-multi-runner\u amd64.deb
`````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` br/>cd git root
gitlab runner exec docker[测试名称]
`````
始终必须包含脚本关键字。
如果测试失败,作业将停止。
操作系统/测试/操作/服务器/休息/测试材料.py
-py test-s ist s os/测试/操作/服务器/休息/测试方法.py
-pytest-s istsos/测试/操作/服务器/休息/测试提供.py
-pytest-s istsos/测试/操作/服务器/休息/测试样品.py
```````
SOS3 lib用法
用法示例:
[有待改进]
``python
import asyncio
from istsos.application import server
from istsos.entity.httprequest import httprequest
@asyncio.coroutine
def execute():
server=yield from servicer.create()
request=httprequest(
"get"、
"sos"、
参数={
"service":"sos"、
"version":"2.0.0"、
"request":"getobservation"、
"offering":"t_lugano"、
"temporalfilter":(
"OM:PhenomenonTime,"
"2009-01-01t00:00+0100/"
"2009-01-02t00:00+0100"
)
}
)
response=yield from server.execute_http_request(request,stats=true)
print("\nloaded%s observations"%len(响应['observations'])
loop=asyncio.get_event_loop()
loop.run_直到完成(
asyncio.gather(execute())
loop.close()
````
将在给定路径中创建新的配置文件(默认为config.pickle)。
``python
"type":"aiopg",
"host":"localhost",
"port":"5432",
"user":"postgres",
"password":"postgres",
"database":"istsos3"
}
}
}
)
```