• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Dulwich: Dulwich 是一个 Git 文件格式和协议的纯Python实现,支持读取资源库内容、索 ...

原作者: [db:作者] 来自: Gitee 收藏 邀请

Dulwich

This is the Dulwich project.

It aims to provide an interface to git repos (both local and remote) thatdoesn't call out to git directly but instead uses pure Python.

Main website: <https://www.dulwich.io/>

License: Apache License, version 2 or GNU General Public License, version 2 or later.

The project is named after the part of London that Mr. and Mrs. Git live inin the particular Monty Python sketch.

Installation

By default, Dulwich' setup.py will attempt to build and install the optional Cextensions. The reason for this is that they significantly improve the performancesince some low-level operations that are executed often are much slower in CPython.

If you don't want to install the C bindings, specify the --pure argument to setup.py:

$ python setup.py --pure install

or if you are installing from pip:

$ pip install dulwich --global-option="--pure"

Note that you can also specify --global-option in arequirements.txtfile, e.g. like this:

dulwich --global-option=--pure

Getting started

Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").

For example, to use the lower level API to access the commit message of thelast commit:

>>> from dulwich.repo import Repo>>> r = Repo('.')>>> r.head()'57fbe010446356833a6ad1600059d80b1e731e15'>>> c = r[r.head()]>>> c<Commit 015fc1267258458901a94d228e39f0a378370466>>>> c.message'Add note about encoding.\n'

And to print it using porcelain:

>>> from dulwich import porcelain>>> porcelain.log('.', max_entries=1)--------------------------------------------------commit: 57fbe010446356833a6ad1600059d80b1e731e15Author: Jelmer Vernooij <[email protected]>Date:   Sat Apr 29 2017 23:57:34 +0000Add note about encoding.

Further documentation

The dulwich documentation can be found in docs/ and built by running makedoc. It can also be found on the web.

Help

There is a #dulwich IRC channel on the OFTC, anddulwich-announceand dulwich-discussmailing lists.

Contributing

For a full list of contributors, see the git logs or AUTHORS.

If you'd like to contribute to Dulwich, see the CONTRIBUTINGfile and list of open issues.

Supported versions of Python

At the moment, Dulwich supports (and is tested on) CPython 3.6 and later andPypy.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap