semvec/pypi-packages huggingface dataset:
aiohglib 1.5
Mercurial Python asynchronous library
License: MIT
Requires Python: >=3.6

# aiohglib

The aiohglib is an asynchronous variant of [hglib](https://www.mercurial-scm.org/wiki/PythonHglib), which is library with a fast, convenient interface to Mercurial. It uses Mercurial's command server for communication with hg.

The code itself takes advantage of asyncio library and async/await syntax.

Another difference against standard hglib is suport for timezones and changesets details like p1, p2 and extras.

## Basic usage

```python
import asyncio
import aiohglib

async def main():
    async with aiohglib.open(path) as client:
        log = await client.log(revrange="tip")
        print(log)

# Depending on your Python version you need to run one of those:

# Python 3.7 or newer
asyncio.run(main())

# Python 3.6
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

# Python 3.6 on Windows
loop = asyncio.ProactorEventLoop()
loop.run_until_complete(main())
loop.close()
```

## Dependencies ##

* Python 3.6
* [pytz](https://pypi.org/project/pytz/)
* [chardet](https://pypi.org/project/chardet/) (optional)

## Changelog ##

### 1.5 ###

* Changed string decoding and codec detection to be more safe.

### 1.4 ###

* Fixed await syntax in client.py
* Fixed redundant \_\_bool\_\_ in util.py
* Optional detection of encoding for changeset's author and description via chardet module
* Optional safe\_template is now *not* used by default


## Licence ##

MIT

## Contact ##

Michal Šiška <michal.515k4@gmail.com>
gl-snippet 0.1.7.0
"Fetch snippet to local file"
License: MIT
Requires Python: >=2.7

Gitlab Snippet
==============

This tool is used to download a snippet from Gitlab to a local file.

It is primarily intended for use within a Gitlab CI/CD pipeline, but may be used
as a standalone tool elsewhere. When used in a pipeline the `--gl-url``, ``--proj_id``
and ``token`` are already defined by Gitlab.

Installation
------------

From Pypi:

.. code-block:: bash

    pip install gl-snippet

Usage
-----

.. code-block::

    Usage: gl-snippet [OPTIONS] SNIP_ID TARGET

      Fetch a snippet contents from Gitlab.

      This is used to fetch the contents of a snippet and save it to a file.
      Note that the snippet must be a single-file snippet. Gitlab supports
      snippets with multiple files (but their python-gitlab API doesn't really
      handle multi-file snippets very well.)

      The parameters --gl-url, --proj_id and --token may be specified directly
      or as environment variables. These use the standard Gitlab CI/CD pipeline
      variables.

      A use-case for this is to store the contents for .pypirc or pip.conf in a
      snippet to fetch for a Gitlab pipeline step.

    Options:
      --gl-url TEXT      URL to Gitlab server (CI_SERVER_URL)
      --proj_id INTEGER  Project ID (CI_PROJECT_ID)
      -t, --token TEXT   API access token (CI_JOB_TOKEN)
      --help             Show this message and exit.

Each snippet in Gitlab needs to be a single-file snippet (due to the limited way the
`gitlab-python` snippet API works). A snipped may be a "global" or a project snippet. To
access a "global" snippet from within a Gitlab pipeline supply ``--proj_id ""``

Example from a ``.gitlab-ci.yml``:

.. code-block:: yaml

    before_script:
      - pip install gl-snippet
      - gl-snippet 25 ~/.pypirc

Example from desktop:

.. code-block:: bash

    $ pip install gl-snippet
    $ gl-snippet --gl-url https://gitlab.com --proj_id 529 --token <your_api_token> 25 ~/.pypirc

Release Notes
-------------

0.1.6.0
~~~~~~~

* Build as "--universal"

0.1.5.0
~~~~~~~

* Creates target directory if not already created
* Default ``--proj_id`` to 0 for "global" snippets