{"id":13477400,"url":"https://github.com/hackebrot/labels","last_synced_at":"2025-05-06T23:46:03.126Z","repository":{"id":47168944,"uuid":"137772441","full_name":"hackebrot/labels","owner":"hackebrot","description":"CLI app for managing GitHub labels for Python 3.6 and newer. 📝","archived":false,"fork":false,"pushed_at":"2024-04-05T12:14:30.000Z","size":95,"stargazers_count":71,"open_issues_count":13,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:41:51.186Z","etag":null,"topics":["cli","github","python","python3"],"latest_commit_sha":null,"homepage":"https://raphael.codes/","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/hackebrot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2018-06-18T15:45:09.000Z","updated_at":"2025-02-01T18:55:42.000Z","dependencies_parsed_at":"2024-01-16T06:17:17.459Z","dependency_job_id":"6450e1d3-a0d2-4721-97a2-b8822c7b0b10","html_url":"https://github.com/hackebrot/labels","commit_stats":{"total_commits":124,"total_committers":5,"mean_commits":24.8,"dds":"0.17741935483870963","last_synced_commit":"2a36720c3fd924e010cc49810057d50f8adf552a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackebrot%2Flabels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackebrot%2Flabels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackebrot%2Flabels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackebrot%2Flabels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackebrot","download_url":"https://codeload.github.com/hackebrot/labels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252788404,"owners_count":21804280,"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":["cli","github","python","python3"],"created_at":"2024-07-31T16:01:42.238Z","updated_at":"2025-05-06T23:46:03.106Z","avatar_url":"https://github.com/hackebrot.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# labels\n\nCLI app for managing GitHub labels for Python 3.6 and newer. 📝\n\n## Installation\n\n**labels** is available for download from [PyPI][PyPI] via [pip][pip]:\n\n```text\npip install labels\n```\n\nVersions follow [Calendar Versioning][calver] using a `YY.MINOR.MICRO` scheme. 🗓\n\n## Authentication\n\nThe labels CLI connects to the GitHub API to modify labels for a GitHub\nrepository. Please [create your own personal API token][create token] and\nchoose the correct token scope based on whether you want to manage issue\nlabels for a public or a private repository. Then set up two environment\nvariables in your terminal:\n\n```bash\nexport LABELS_USERNAME=\"\u003cGITHUB_USERNAME\u003e\"\nexport LABELS_TOKEN=\"\u003cGITHUB_TOKEN\u003e\"\n```\n\n## Usage\n\nOnce you've installed **labels** and set up the environment variables, you're\nready to use the **labels** CLI to manage labels for a GitHub repository. The\nCLI comes with two commands: ``fetch`` and ``sync``. Both commands require\nthe name of the owner and the name of the GitHub repository to fetch from or\nsync to. By default, **labels** tries to load this information from your\nlocal Git repository based on the URL for the `origin` remote repository.\n\nFor example, if you run **labels** from your local clone of the [earth\n][earth_repo] repository with `origin` set to\n`git@github.com:hackebrot/earth.git` owner will be `hackebrot` and repo will\nbe `earth`. 🌍\n\nYou can override one or both of these values manually using the following CLI\noptions:\n\n```text\n-o, --owner TEXT     GitHub owner name\n-r, --repo TEXT      GitHub repository name\n```\n\n### Fetch\n\nWhen you use **labels** for the first time, you will start by fetching\ninformation about the existing labels for your GitHub project. The CLI will\nthen write a [TOML][toml] file to your computer with the retrieved\ninformation. The default name for this file is ``labels.toml`` in your\ncurrent working directory and can be changed by passing the ``-f, --filename\nPATH`` option followed by the path to where you want to write to.\n\n```text\nlabels fetch -o hackebrot -r pytest-emoji\n```\n\n```toml\n[bug]\ncolor = \"ea707a\"\ndescription = \"Bugs and problems with pytest-emoji\"\nname = \"bug\"\n\n[\"code quality\"]\ncolor = \"fcc4db\"\ndescription = \"Tasks related to linting, coding style, type checks\"\nname = \"code quality\"\n\n[dependencies]\ncolor = \"43a2b7\"\ndescription = \"Tasks related to managing dependencies\"\nname = \"dependencies\"\n\n[docs]\ncolor = \"2abf88\"\ndescription = \"Tasks to write and update documentation\"\nname = \"docs\"\n\n[\"good first issue\"]\ncolor = \"bfdadc\"\ndescription = \"Tasks to pick up by newcomers to the project\"\nname = \"good first issue\"\n```\n\n### Sync\n\nNow that you have a file on your computer that represents your GitHub labels,\nyou can edit this file and then run **labels sync** to update the remote\nrepository. But first let's look into how that works... 🔍\n\nRepresentation of a GitHub label in the written TOML file:\n\n```toml\n[docs]\ncolor = \"2abf88\"\ndescription = \"Tasks to write and update documentation\"\nname = \"docs\"\n```\n\nThe section name (``[docs]`` in the example above) represents the name of the\nlabel for that repository and is identical to the ``name`` field when running\n``labels fetch``. Do not edit the section name of existing labels yourself!\n\nThe fields ``color``, ``description`` and ``name`` are parameters that you\ncan edit with the **labels** CLI.\n\n- ``name`` - The name of the label\n- ``description`` - A short description of the label\n- ``color`` - The hexadecimal color code for the label without the leading ``#``\n\nYou can make the following changes to labels for your repo:\n\n- You can **delete** a label by removing the corresponding section from the\nlabels file 🗑\n- You can **edit** a label by changing the value for one or more parameters for\nthat label 🎨\n- You can **create** a new label by adding a new section with your desired\nparameters 📝\n\nWhen creating labels choose a section name identical to the ``name``\nparameter.\n\nCheck your label changes before syncing by using the ``dryrun`` CLI option:\n\n```text\n-n, --dryrun         Do not modify remote labels\n```\n\nExample usage:\n\n```text\nlabels sync -n -o hackebrot -r pytest-emoji\n```\n\n```text\nThis would delete the following labels:\n  - dependencies\nThis would update the following labels:\n  - bug\n  - good first issue\nThis would create the following labels:\n  - duplicate\nThis would NOT modify the following labels:\n  - code quality\n  - docs\n```\n\nRunning ``labels sync`` without the ``dryrun`` option also updates the labels\nfile, so that section names match the ``name`` parameter.\n\nIf **labels** encounters any errors while sending requests to the GitHub API,\nit will print information about the failure and continue with the next label\nuntil it has processed all of the labels.\n\n## Community\n\nPlease check out the [good first issue][good first issue] label for tasks,\nthat are good candidates for your first contribution to\n**labels**. Your contributions are greatly\nappreciated! Every little bit helps, and credit will always be given! 👍\n\nPlease note that **labels** is released with a [Contributor Code of\nConduct][code of conduct]. By participating in this project you agree to\nabide by its terms.\n\n## License\n\nDistributed under the terms of the MIT license, **labels** is free and open\nsource software.\n\n[PyPI]: https://pypi.org/project/labels/\n[calver]: https://calver.org\n[code of conduct]: https://github.com/hackebrot/labels/blob/main/CODE_OF_CONDUCT.md\n[contributing]: https://github.com/hackebrot/labels/blob/main/.github/CONTRIBUTING.md\n[create token]: https://blog.github.com/2013-05-16-personal-api-tokens/\n[earth_repo]: https://github.com/hackebrot/earth\n[good first issue]: https://github.com/hackebrot/labels/labels/good%20first%20issue\n[pip]: https://pypi.org/project/pip/\n[toml]: https://github.com/toml-lang/toml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackebrot%2Flabels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackebrot%2Flabels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackebrot%2Flabels/lists"}