用于以编程方式获取数据并将数据提交给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如何比较二维交错数组中列中元素的长度   java依赖javafx是安全的。util。回电话?   用于格式化二进制数的正则表达式,在Java中,从右到左每4个字符使用空格   java我应该在基于Springboot的后端使用headless模式吗?   java Hibernate获取数据。list()已去润滑,表未映射。怎么办?   java Spring引导存储库,包括示例、规范和页面   java使用UUID。randomUUID()和多次调用方法?   每个客户端请求的Java DatagramSocket不同线程   字符串中的java表达式到arraylist   数组循环遍历word文档和图像,并存储到SQL java   java wsimport Xauthfile错误   java在适配器中返回相同的片段   charAt()方法如何从字符串中提取数字并将其放入Java中的新字符串中?   java我想在两部手机之间建立hfp连接   java如何添加priceAfterDiscount的公共方法,该方法返回折扣后的价格