用于以编程方式获取数据并将数据提交给Intertec TimePro的实用程序(timesheets.com.au)

timepro-timesheet的Python项目详细描述


Intertec TimePro实用程序

PyPI versionBuild statusCoveragePython versionsGithub license

说明

以编程方式获取时间表数据并将其提交给Intertec TimePro(timesheets.com.au)

安装

安装时使用pip

pip install timepro-timesheet

用法

命令行

获取数据

安装后,可以使用cli将时间表数据获取为json。

$ timepro get -c CUST -u john.doe -p password123
  {"2018-08-04": [{"customer_code": "EXAMPLE",
        "customer_description": "Example Company Pty Ltd",
        "project_code": "EX-123",
        "project_psid": "EX-123{:}1",
        "project_description": "EXAMPLE - EX-123 - SOW000 - Important Business Stuff - PO 123",
        "task_id": null,
        "task_description": null,
        "hours": 8}]}

您可以通过指定--start--end的日期,或者使用--this-week--this-month--last-week--last-month标志筛选时间表期间。默认情况下,将返回当前周的时间表条目。

发布数据

可以通过读取json文件提交数据。

$ timepro post -c CUST -u john.doe -p password123 -f timesheet_entries.json

$ cat timesheet_entries.json | timepro post -c CUST -u john.doe -p password123

Python

fromtimepro_timesheet.apiimportTimesheetAPI# Log into timesheets.com.au via the TimesheetAPI classapi=TimesheetAPI()api.login(customer_id='CUST',username='john.doe',password='password123')# Get timesheet (defaults to current month)timesheet=api.get_timesheet()# Get timesheet for a given datetimesheet=api.get_timesheet(start_date=date(2018,6,1),end_date=date(2018,6,25))# Output timesheettimesheet.json()timesheet.row_entries()timesheet.date_entries()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用jackson序列化/反序列化具有不同属性的子属性   javascript驱动程序。getTitle()从错误页面获取数据   java web应用程序的增量部署   java字符引用“&#x10”是无效的XML字符   java MyEclipse+Hibernate不按ID排序属性集?   找不到IBM Filenet P8更改预处理器Java实现   java比较器,用于按浮点参数对对象arraylist排序   java如何调试。来自eclipse或其他版本的bsh文件   不允许使用java rest api post方法   java如何在Servlet中打开弹出窗口,然后重定向页面   java的replaceAll方法对我不起作用我做错了什么?   我收到了javax。网ssl。SSLHandshakeException:握手期间远程主机关闭连接