Project description
githyperlink
Get a link to the hosted html version of a git-tracked file or directory.
This is relevant only for git remotes that serve html, like github and gitlab.
Usage
$ gethyperlink [ PATH]
(Note the spelling here: get hyperlink).
If PATH
is not specified, a link for the current directory is given.
Example
$ cd my-pretty-repo/subdir
$ gethyperlink somefile.jl
https://github.com/yourname/my-pretty-repo/blob/main/subdir/somefile.jl
You might want to define an alias, for example, in ~/.bashrc
:
alias gl = "gethyperlink" # Or maybe 'gurl' (get url) 💅
Direct usage in Python
from githyperlink import get_hyperlink
print ( get_hyperlink ( __file__ ))
# → https://gitlab.com/you/my_scripts/blob/main/this_script.py
The argument to get_hyperlink
can be a string, as above, or a pathlib.Path
.
Installation
pip install githyperlink
This will get you the
,
and makes the command-line tool gethyperlink
globally available.
To upgrade an existing installation to the version above, use pip install -U githyperlink
.
Requires Python ≥ 3.9.
Features
git
is called directly, in a subprocess: this is faster than the default usage of
GitPython
, and spares a dependency. (Currently, we only depend on click
).
Not many features.
This makes the source code easier to grok, and easier to modify for your own purposes.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages .
Source Distribution
Built Distribution
File details
Details for the file githyperlink-0.1.tar.gz
.
File metadata
Download URL:
githyperlink-0.1.tar.gz
Upload date: Mar 3, 2022
Size: 4.6 kB
Tags: Source
Uploaded using Trusted Publishing? No
Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Hashes for githyperlink-0.1.tar.gz
Algorithm
Hash digest
SHA256
f412cec542ddfff9bef003d31ed5b4b62b8c08324ee2da14bf8555fc79a95954
Copy
MD5
ef1d81ade1ff2ea7d8d3a6f526888a52
Copy
BLAKE2b-256
72d6c7e2e56fb0e9cbf8e79b9d6104e4110e119c4e44b3fa4d9f2ea7b608f051
Copy
See more details on using hashes here.
File details
Details for the file githyperlink-0.1-py3-none-any.whl
.
File metadata
Download URL:
githyperlink-0.1-py3-none-any.whl
Upload date: Mar 3, 2022
Size: 5.0 kB
Tags: Python 3
Uploaded using Trusted Publishing? No
Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Hashes for githyperlink-0.1-py3-none-any.whl
Algorithm
Hash digest
SHA256
6bf22a5ebc62c1586151361c57eb1b3ae85255fdce5096e35c0ae73642d506f1
Copy
MD5
2f0ca1a3ed8818892851353cda8fa9ff
Copy
BLAKE2b-256
85789c1c52c8ea0c1c6467fd9de7f16d45a0e527d9d1258f2a53d13077901016
Copy
See more details on using hashes here.