skillfed

python-hglib

Mercurial Python library

python-hglib v2.6.2 76.9K downloads/30d#14,578 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

python-hglib is a Python library that wraps Mercurial's command server to provide a programmatic interface to hg operations. Instead of shelling out to the hg command-line tool, it communicates directly with Mercurial's server mode, which the library describes as offering a fast and convenient way to interact with repositories from Python code.

The package is designed for developers who need to automate or script Mercurial workflows—for example, querying repository state, running commits, or managing branches programmatically. However, the package has been abandoned since its last release on 2020-11-17 and classifiers only list Python up to 3.4, making it a legacy tool unsuitable for new projects unless you are maintaining existing Mercurial-based infrastructure.

Use it for:

  • Automating Mercurial repository operations in build or deployment scripts that cannot use the command-line hg tool directly.
  • Writing tools that need to query Mercurial repository metadata or history programmatically.
  • Integrating Mercurial version control into Python applications that manage or monitor multiple repositories.
  • Legacy system maintenance where existing Python code depends on hglib for Mercurial interaction.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

python-hglib provides a Python interface to Mercurial version control by communicating with Mercurial's command server, enabling programmatic access to hg operations.

No, unless you are maintaining legacy code already using this package. The project is abandoned (last release 2020-11-17), classifiers only list Python up to 3.4, and high install friction suggests unresolved system dependencies. For new Mercurial automation, consider alternatives or direct command-line invocation.

Install

python-hglib on PyPI

pip

pip install python-hglib

uv

uv add python-hglib

poetry

poetry add python-hglib

Installing python-hglib

Before you install

Installation friction is high and maintenance is abandoned—the package has not been updated since 2020-11-17. No recent commits or repository activity are available. Caution is warranted for new projects.

License in practice

Licensed under MIT (permissive), so you may use, modify, and distribute the package freely with minimal restrictions.

Quickstart

pip install python-hglib

from hglib.client import hg

repo = hg.open('/path/to/repo')
log = repo.log()
repo.close()

Requires Mercurial to be installed and the hg command server to be available on the system; high install friction suggests potential compiled dependencies or system-level configuration.

Verify before relying

  • Whether the package works reliably with modern Python versions beyond 3.4, given its age and lack of maintenance.
  • Current compatibility with recent Mercurial releases and whether the command server protocol has changed.
  • Whether high install friction is due to compiled dependencies or other system-level requirements.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 2,096 days since the last release
First released
Downloads 76,923/month — #14,578 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python-hglib-2.6.2.tar.gz

Programming Language :: PythonProgramming Language :: Python :: 2.4Programming Language :: Python :: 2.5Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4

Tags

mercurial python interfacehg command server libraryversion control automationmercurial scriptinghglib python bindings
mercurialversion-controlabandoned

More Software Development packages