Package: labels
labelsCLI app for managing GitHub labels for Python 3.6 and newer. 📝Installationlabelsis available for download fromPyPIviapip:pip install labelsVersions followCalendar Versioningusing aYY.MINOR.MICROscheme. 🗓AuthenticationThe labels CLI connects to the GitHub API to modify labels for a GitHub
repository. Pleasecreate your own personal API tokenand
choose the correct token scope based on whether you want to manage issue
labels for a public or a private repository. Then set up two environment
variables in your terminal:exportLABELS_USERNAME="<GITHUB_USERNAME>"exportLABELS_TOKEN="<GITHUB_TOKEN>"UsageOnce you've installedlabelsand set up the environment variables, you're
ready to use thelabelsCLI to manage labels for a GitHub repository. The
CLI comes with two commands:fetchandsync. Both commands require
the name of the owner and the name of the GitHub repository to fetch from or
sync to. By default,labelstries to load this information from your
local Git repository based on the URL for theoriginremote repository.For example, if you runlabelsfrom your local clone of theearthrepository withoriginset togit@github.com:hackebrot/earth.gitowner will behackebrotand repo will
beearth. 🌍You can override one or both of these values manually using the following CLI
options:-o, --owner TEXT     GitHub owner name
-r, --repo TEXT      GitHub repository nameFetchWhen you uselabelsfor the first time, you will start by fetching
information about the existing labels for your GitHub project. The CLI will
then write aTOMLfile to your computer with the retrieved
information. The default name for this file islabels.tomlin your
current working directory and can be changed by passing the-f, --filename PATHoption followed by the path to where you want to write to.labels fetch -o hackebrot -r pytest-emoji[bug]color="ea707a"description="Bugs and problems with pytest-emoji"name="bug"["code quality"]color="fcc4db"description="Tasks related to linting, coding style, type checks"name="code quality"[dependencies]color="43a2b7"description="Tasks related to managing dependencies"name="dependencies"[docs]color="2abf88"description="Tasks to write and update documentation"name="docs"["good first issue"]color="bfdadc"description="Tasks to pick up by newcomers to the project"name="good first issue"SyncNow that you have a file on your computer that represents your GitHub labels,
you can edit this file and then runlabels syncto update the remote
repository. But first let's look into how that works... 🔍Representation of a GitHub label in the written TOML file:[docs]color="2abf88"description="Tasks to write and update documentation"name="docs"The section name ([docs]in the example above) represents the name of the
label for that repository and is identical to thenamefield when runninglabels fetch. Do not edit the section name of existing labels yourself!The fieldscolor,descriptionandnameare parameters that you
can edit with thelabelsCLI.name- The name of the labeldescription- A short description of the labelcolor- The hexadecimal color code for the label without the leading#You can make the following changes to labels for your repo:You candeletea label by removing the corresponding section from the
labels file 🗑You canedita label by changing the value for one or more parameters for
that label 🎨You cancreatea new label by adding a new section with your desired
parameters 📝When creating labels choose a section name identical to thenameparameter.Check your label changes before syncing by using thedryrunCLI option:-n, --dryrun         Do not modify remote labelsExample usage:labels sync -n -o hackebrot -r pytest-emojiThis would delete the following labels:
  - dependencies
This would update the following labels:
  - bug
  - good first issue
This would create the following labels:
  - duplicate
This would NOT modify the following labels:
  - code quality
  - docsRunninglabels syncwithout thedryrunoption also updates the labels
file, so that section names match thenameparameter.Iflabelsencounters any errors while sending requests to the GitHub API,
it will print information about the failure and continue with the next label
until it has processed all of the labels.CommunityPlease check out thegood first issuelabel for tasks,
that are good candidates for your first contribution tolabels. Your contributions are greatly
appreciated! Every little bit helps, and credit will always be given! 👍Please note thatlabelsis released with aContributor Code of
Conduct. By participating in this project you agree to
abide by its terms.LicenseDistributed under the terms of the MIT license,labelsis free and open
source software.