用于与toggl的api交互的命令行工具和一组python包装类

togglCli的Python项目详细描述


toggl cli

PyPI versionPyPI - Python VersionPyPI - DownloadscodecovBuild StatusCodacy BadgeUpdates

Command line tool and set of Python wrapper classes for interacting with toggl's API

安装

安装此软件包的最简单方法是通过pypi:

$ pip install togglCli

用法

有关toggl cli功能的完整概述,请参见full documentation

cli工具

在第一次运行该命令时,您将被问到几个问题来引导默认配置文件 (仅支持类unix系统;对于window s用户,创建了虚拟配置文件,您必须手动设置该文件)。

要获得所有命令和选项的概述,请使用--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的模式。

包装器取决于配置对象,如果没有提供,则使用默认配置文件(eq.~/.togglrc)。

toggl cli使用pendulum进行日期时间管理,但它与python的本机日期时间兼容,因此如果愿意,可以使用它。

fromtogglimportapi,utilsimportpendulumnew_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 fileconfig=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 fileconfig.api_token='your token'config.timezone='utc'# Custom timezoneproject=api.Project.object.get(123,config=config)project.name='Some new name'project.save()

贡献

欢迎大家踊跃参与,踊跃投稿!Open an issue或提交prs。

有关prs,请参见contribution guideline

许可证

MIT © Adam Uhlir & D. Robert Adams

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

推荐PyPI第三方库


热门话题
使用Java将JSON转换为哈希映射   java如何通过使用MapStruct从源对象复制值来填充目标对象内部的映射?   注入泛型类型为@InjectGuice的类时发生java错误   字符串如何在JavaIDE中导入基本符号   在Java中将JSON转换为List<List<String>>   java Java9 HttpClient SSLHandshakeException   java jOOQ代码生成器   java如何调整图标(图像按钮),使其不会放大?   java我可以在使用Eclipse时安装2个或更多Android SDK吗   sqlite Java实现DAO   如何解决此错误?“java.lang.NoSuchFieldError:org.apache.http.conn.ssl.SSLConnectionSocketFactory上的实例。<clinit>。”   java Maven:将基于OSP的zip文件解压缩到WEBINF/lib   java如何在每次调用函数时获取当前gps位置?