{"id":13595017,"url":"https://github.com/tldr-pages/tldr-python-client","last_synced_at":"2025-04-09T10:32:39.191Z","repository":{"id":14708785,"uuid":"17429141","full_name":"tldr-pages/tldr-python-client","owner":"tldr-pages","description":":snake: Python command-line client for tldr pages 📚","archived":false,"fork":false,"pushed_at":"2025-03-27T10:22:57.000Z","size":316,"stargazers_count":635,"open_issues_count":23,"forks_count":98,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-03-27T10:24:37.274Z","etag":null,"topics":["hacktoberfest","python","tldr","tldr-pages","tldr-python-client"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/tldr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tldr-pages.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"liberapay":"tldr-pages"}},"created_at":"2014-03-05T05:32:26.000Z","updated_at":"2025-03-27T09:27:47.000Z","dependencies_parsed_at":"2023-02-14T11:00:36.512Z","dependency_job_id":"50f241e4-4b5e-41ca-b8b0-a6ee1718acb7","html_url":"https://github.com/tldr-pages/tldr-python-client","commit_stats":{"total_commits":187,"total_committers":44,"mean_commits":4.25,"dds":0.5882352941176471,"last_synced_commit":"2d06e4a18c7e2d8dc635bfb24084648c113d0f36"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tldr-pages%2Ftldr-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tldr-pages%2Ftldr-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tldr-pages%2Ftldr-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tldr-pages%2Ftldr-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tldr-pages","download_url":"https://codeload.github.com/tldr-pages/tldr-python-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248020593,"owners_count":21034459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","python","tldr","tldr-pages","tldr-python-client"],"created_at":"2024-08-01T16:01:42.483Z","updated_at":"2025-04-09T10:32:34.181Z","avatar_url":"https://github.com/tldr-pages.png","language":"Python","readme":"# tldr-python-client\n\n[![PyPI Release](https://img.shields.io/pypi/v/tldr.svg)](https://pypi.python.org/pypi/tldr)\n[![Build](https://github.com/tldr-pages/tldr-python-client/workflows/Test/badge.svg?branch=main)](https://github.com/tldr-pages/tldr-python-client/actions?query=branch%3Amain)\n[![Snap Release](https://snapcraft.io/tldr/badge.svg)](https://snapcraft.io/tldr)\n\nPython command-line client for [tldr pages](https://github.com/tldr-pages/tldr).\n\n![Tldr Python client displaying the tar page](https://raw.github.com/tldr-pages/tldr-python-client/main/images/tldr-dark.png)\n\n## Installation\n\n\u003cdetails open\u003e\n  \u003csummary\u003eCheck Repology Packaging Status!\u003c/summary\u003e\n  \u003ca href=\"https://repology.org/project/tldr-python-client/versions\"\u003e\n      \u003cimg src=\"https://repology.org/badge/vertical-allrepos/tldr-python-client.svg\" alt=\"Packaging status\"\u003e\n  \u003c/a\u003e\n\u003c/details\u003e\n\n### from PyPI\n\n```bash\npip install tldr\n```\n\n### from Arch Linux repository\n\n```bash\nsudo pacman -S tldr\n```\n\n### from Fedora packages repository\n\n```bash\nsudo dnf install tldr\n```\n\n### from Snap Store\n\n```bash\nsudo snap install tldr\n```\n\n## Usage\n\n```txt\nusage: tldr command [options]\n\nPython command line client for tldr\n\npositional arguments:\n  command               command to lookup\n\noptions:\n  -h, --help            show this help message and exit\n  -v, --version         show program's version number and exit\n  --search \"KEYWORDS\"   Search for a specific command from a query\n  -u, --update, --update_cache\n                        Update the local cache of pages and exit\n  -p PLATFORM, --platform PLATFORM\n                        Override the operating system [android, freebsd, linux, netbsd, openbsd, osx, sunos, windows, common]\n  -l, --list            List all available commands for operating system\n  -s SOURCE, --source SOURCE\n                        Override the default page source\n  -c, --color           Override color stripping\n  -r, --render          Render local markdown files\n  -L LANGUAGE, --language LANGUAGE\n                        Override the default language\n  -m, --markdown        Just print the plain page file.\n  --print-completion {bash,zsh,tcsh}\n                        print shell completion script\n```\n\n## Configuration\n\nYou can configure the behavior and output of the `tldr` client by setting environment variables. For example, in the `.bashrc` file:\n\n```bash\nexport TLDR_COLOR_NAME=\"cyan\"\nexport TLDR_COLOR_DESCRIPTION=\"white\"\nexport TLDR_COLOR_EXAMPLE=\"green\"\nexport TLDR_COLOR_COMMAND=\"red\"\nexport TLDR_COLOR_PARAMETER=\"white\"\nexport TLDR_LANGUAGE=\"es\"\nexport TLDR_CACHE_ENABLED=1\nexport TLDR_CACHE_MAX_AGE=720\nexport TLDR_PAGES_SOURCE_LOCATION=\"https://raw.githubusercontent.com/tldr-pages/tldr/main/pages\"\nexport TLDR_DOWNLOAD_CACHE_LOCATION=\"https://tldr-pages.github.io/assets/tldr.zip\"\n```\n\n### Cache\n\nCache is downloaded from `TLDR_DOWNLOAD_CACHE_LOCATION` (defaults to the one described in [the client specification](https://github.com/tldr-pages/tldr/blob/main/CLIENT-SPECIFICATION.md#caching)), unzipped and extracted into the [local cache directory](#cache-location). Pages are loaded directly from `TLDR_PAGES_SOURCE_LOCATION` if `tldr \u003ccommand\u003e` is used.\n\n- `TLDR_CACHE_ENABLED` (default is `1`):\n  - If set to `1`, the client will first try to load from cache, and fall back to fetching from the internet if the cache doesn't exist or is too old.\n  - If set to `0`, the client will fetch from the internet, and fall back to the cache if the page cannot be fetched from the internet.\n- `TLDR_CACHE_MAX_AGE` (default is `168` hours, which is equivalent to a week): maximum age of the cache in hours to be considered as valid when `TLDR_CACHE_ENABLED` is set to `1`.\n\n#### Cache location\n\nIn order of precedence:\n\n- `$XDG_CACHE_HOME/tldr`\n- `$HOME/.cache/tldr`\n- `~/.cache/tldr`\n\nIf you are experiencing issues with *tldr*, consider deleting the cache files before trying other measures.\n\n#### Autocomplete\n\n[`shtab`](https://pypi.org/project/shtab) is required for autocompletion using the `--print-completion` argument.\n\n```bash\n# bash\ntldr --print-completion bash | sudo tee \"$BASH_COMPLETION_COMPAT_DIR\"/tldr\n# zsh (it is recommended to check where zsh/site-functions directory is located)\n## for macOS:\ntldr --print-completion zsh | sudo tee /usr/local/share/zsh/site-functions/_tldr\n## for Linux:\ntldr --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_tldr\n```\n\nSee the `shtab` [docs](https://pypi.org/project/shtab/#usage) for other installation methods and\nsupported shells.\n\nFor autocomplete in [`fish`](https://fishshell.com/), while it is not supported in `shtab` yet,\nplease see [#183](https://github.com/tldr-pages/tldr-python-client/issues/183) for manually adding\nan autocomplete for `tldr` for `fish`.\n\n### SSL Inspection\n\nFor networks that sit behind a proxy, it may be necessary to disable SSL verification for the client to function. Setting the following:\n\n- `TLDR_ALLOW_INSECURE=1`\n\nwill disable SSL certificate inspection. This __should be avoided__ unless absolutely necessary.\n\n### Colors\n\nValues of the `TLDR_COLOR_x` variables may consist of three parts:\n\n- Font color: `blue, green, yellow, cyan, magenta, white, grey, red`\n- Background color: `on_blue, on_cyan, on_magenta, on_white, on_grey, on_yellow, on_red, on_green`\n- Additional effects, which depend on the platform: `reverse, blink, dark, concealed, underline, bold`\n\nYou may specify as many additional effects as you want, while only one of font and background color.\n\nAny of the values above may be omitted. For example, you can do similar things as the following:\n\n- `TLDR_COLOR_NAME=\"\"` use default system font color with default background color without any effects\n- `TLDR_COLOR_DESCRIPTION=\"white\"` for white text on default system background color without any effects\n- `TLDR_COLOR_NAME=\"cyan dark\"` for dark cyan text on default system background color\n- `TLDR_COLOR_NAME=\"on_red\"` for default system font color on the red background color\n- `TLDR_COLOR_PARAMETER=\"red on_yellow underline\"` for underlined red text on yellow background\n- `TLDR_COLOR_NAME=\"bold underline\"` for default system font and background colors with underline and bolded effects\n\n### Language\n\nThe language that tldr will use is dependent on several factors. If you specify a language via the\n`--language` flag, tldr will attempt to use that language and only that language. Otherwise, it will\ntry to use the language specified by `TLDR_LANGUAGE`. If it is not set, or the page does not exist in that language,\nthen tldr will use the\nlanguage set using `LANGUAGE` and `LANG` (ignoring the values `C` and `POSIX`).\n\nIf neither is set, then tldr will always attempt to get the `en` page. Finally, if `LANG` is set, it uses `LANGUAGE`, if set,\nfirst, as the priority list to try languages in, followed by `LANG` if not included in `LANGUAGE`\nand `en` as a fallback (assuming it does not already appear somewhere in `LANGUAGE` or `LANG`).\n\nAll language values should be set to a value that follows [RFC 1766](https://tools.ietf.org/html/rfc1766.html),\nwith the special exceptions of `C` and `POSIX` which are ignored.\n\n### Remote source\n\nIf you wish to use your own instance of the tldr pages instead of the default repository, you\ncan either use the `--source` flag when using tldr or by specifying the following environment variables:\n\n- `TLDR_PAGES_SOURCE_LOCATION` to control where to get individual pages from.\n  - defaults to `https://raw.githubusercontent.com/tldr-pages/tldr/main/pages`.\n  - it can also point to a local directory using `file:///path/to/directory`.\n- `TLDR_DOWNLOAD_CACHE_LOCATION` to control where to pull a zip of all pages from.\n  - defaults to `https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip`.\n","funding_links":["https://liberapay.com/tldr-pages"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftldr-pages%2Ftldr-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftldr-pages%2Ftldr-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftldr-pages%2Ftldr-python-client/lists"}