命令行工具和用于与toggl的API交互的Python包装类集合
项目描述
Toggl CLI
命令行工具和用于与toggl的API交互的Python包装类集合
安装
安装此软件包的最简单方法是使用PyPi
$ pip install togglCli
用法
要全面了解Toggl CLI的功能,请参阅完整文档。
命令行工具
在首次运行命令时,您将被问及几个问题以启动默认配置文件(仅支持UNIX-like系统;对于Windows用户,已创建示例配置文件,您需要手动设置)。
要查看所有命令和选项的概述,请使用--help
选项。还可以查看子命令的帮助页面!
一些命令示例
# Starts tracking new time entry
$ toggl start
# Displays/enable modifications of currently running time entry
$ toggl now
# Lists all projects
$ toggl projects ls
API包装器
Toggl CLI附带一组Python的类包装器,其模式与Django ORM类似。
这些包装器依赖于配置对象,如果没有提供,则使用默认配置文件(例如~/.togglrc
)。
Toggl CLI 使用 pendulum
进行日期时间管理,但与 Python 的原生日期时间兼容,所以如果您想使用的话也可以。
from toggl import api, utils
import pendulum
new_entry = api.TimeEntry(description='Some new time entry', start=pendulum.now() - pendulum.duration(minutes=15), stop=pendulum.now())
new_entry.save()
list_of_all_entries = api.TimeEntry.objects.all()
current_time_entry = api.TimeEntry.objects.current()
# Custom config from existing file
config = utils.Config.factory('./some.config')
# Custom config without relying on any existing config file
config = utils.Config.factory(None) # Without None it will load the default config file
config.api_token = 'your token'
config.timezone = 'utc' # Custom timezone
project = api.Project.object.get(123, config=config)
project.name = 'Some new name'
project.save()
贡献
请随时参与,欢迎贡献!打开问题或提交 PR。
有关 PR,请参阅贡献指南。
许可证
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码发行版
togglCli-3.0.2.tar.gz (114.1 kB 查看哈希值)
构建发行版
togglCli-3.0.2-py2.py3-none-any.whl (87.1 kB 查看哈希值)
关闭
togglCli-3.0.2.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2066dded9831d68be11d585e1c9d465c462584ac60a55455995a4dd978e7ea65 |
|
MD5 | a4fddfbda6608e27a07e8c2bc06247d8 |
|
BLAKE2b-256 | 3264e2764a269bac05ca292b8fc2d78c2235568de8bfdd8f05d59c51d7142243 |
关闭
togglCli-3.0.2-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | db57157036785ad769ee29bac7f1e5c7a7ff7d9d290204bc7e2c85eebc3a252b |
|
MD5 | 30887333f065a45dbb4d312a5c206385 |
|
BLAKE2b-256 | 16a16ecd7dc7cd66a960bbe7fc00dc55940cb55260feb7f9de0bcee365145131 |