提供对JavaScript编写的opening_hours.js库访问权限的Python模块。
项目描述
提供对opening_hours.js库的访问权限的Python模块,该库用JavaScript编写。
此python库目前仅实现了opening_hours.js的简单API(没有可选参数)。
安装
使用pip简单安装pyopening_hours
pip install pyopening_hours
用法
import pyopening_hours
try:
oh = pyopening_hours.OpeningHours(u'Lun-')
except pyopening_hours.ParseException as error:
print(error.message)
value = u'Mon,Tu,Th,Fr 12:00-18:00; Samstag 12:00-17:00 "I ❤ unicode"; Th[3] OFF; Th[-1] off'
oh = pyopening_hours.OpeningHours(value)
print(u"Parsing complex value: {}".format(value))
print(u"Is{} week stable".format('' if oh.isWeekStable() else ' not'))
print(u"Facility is {}".format(oh.getStateString()))
print(u"Next change in UTC: {}".format(oh.getNextChange().strftime('%Y-%m-%d %H:%M:%S')))
print(u"Warnings:")
for line in oh.getWarnings():
print(' ' + line)
开发
只需使用以下命令克隆仓库
git clone https://github.com/ypid/pyopening_hours
并在仓库内安装其依赖项(在仓库内执行)
make dependencies-get
其他项目使用
此库在以下项目中使用
其他模块
osm-opening-hours(纯Python实现)
项目详情
关闭
pyopening_hours-0.3.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 01c397a447ba97ccaf4eb10a2ba5acd268f348beee76a7a019108118063e7f1b |
|
MD5 | 409121e4cbc22e6f0d56b1220e51295d |
|
BLAKE2b-256 | 91ff6fcfc1120b0192c57d3d9267b208bea7d0d403e4b45da30116fa81e5f786 |