八达通能源python服务实用程序
xocto的Python项目详细描述
#xocto-python服务的实用程序
此回购协议包含了octopus energy的python服务的各种共享实用程序。
[![Circleci](https://circleci.com/gh/octenergy/xocto/tree/master.svg?style=svg)(https://circleci.com/gh/octoenergy/xocto/tree/master)
这些将作为json
记录到名为“events”的记录器中。
示例用法:
``python
from xocto import events
events.publish(
event=“account.created”,
params={
'name':'barry chuckle',
'quote-id':'xyz123',
},
meta={
'account-id':'a-12312312345'
},
account=account,#可选
请求=请求,可选
)
```
```python
``python
时间事件使用xocto import events
with events.timer()作为t:
``do some things
events.publish(
event=“something.happed”,
meta={
“duration-in-u-ms”:t.duration-in-u-ms
>
```
`
`
`
` `
` ` ` ` `
<
meta={
“duration-in-ms;t.duration;t.duration-in-in-ms
meta=>meta
“duration-in-in-in-in-in-ms
/><发布新版本
发布到pypi:
1。在'setup.py'
>2中碰撞版本。正在更新“changelog.md”
>3。提交
$git commit-am“bump version to v…”
>4。运行:
$make publish
此回购协议包含了octopus energy的python服务的各种共享实用程序。
[![Circleci](https://circleci.com/gh/octenergy/xocto/tree/master.svg?style=svg)(https://circleci.com/gh/octoenergy/xocto/tree/master)
这些将作为json
记录到名为“events”的记录器中。
示例用法:
``python
from xocto import events
events.publish(
event=“account.created”,
params={
'name':'barry chuckle',
'quote-id':'xyz123',
},
meta={
'account-id':'a-12312312345'
},
account=account,#可选
请求=请求,可选
)
```
```python
``python
时间事件使用xocto import events
with events.timer()作为t:
``do some things
events.publish(
event=“something.happed”,
meta={
“duration-in-u-ms”:t.duration-in-u-ms
>
```
`
`
`
` `
` ` ` ` `
<
meta={
“duration-in-ms;t.duration;t.duration-in-in-ms
meta=>meta
“duration-in-in-in-in-in-ms
/><发布新版本
发布到pypi:
1。在'setup.py'
>2中碰撞版本。正在更新“changelog.md”
>3。提交
$git commit-am“bump version to v…”
>4。运行:
$make publish