{"id":22683747,"url":"https://github.com/wheelodex/entry-points-txt","last_synced_at":"2025-04-12T18:30:28.049Z","repository":{"id":57426571,"uuid":"281171527","full_name":"wheelodex/entry-points-txt","owner":"wheelodex","description":"Read \u0026 write entry_points.txt files","archived":false,"fork":false,"pushed_at":"2025-01-23T14:07:26.000Z","size":59,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T19:49:38.863Z","etag":null,"topics":["available-on-pypi","entry-points","python"],"latest_commit_sha":null,"homepage":"","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/wheelodex.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-07-20T16:37:40.000Z","updated_at":"2025-01-23T14:07:28.000Z","dependencies_parsed_at":"2023-01-31T01:55:13.975Z","dependency_job_id":"6bfe61f6-26c0-4a4a-8780-e42c625971d4","html_url":"https://github.com/wheelodex/entry-points-txt","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"7424d4ebe942ed966b75930a56f63b5837e2a8d0"},"previous_names":["wheelodex/entry-points-txt","jwodder/entry-points-txt"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheelodex%2Fentry-points-txt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheelodex%2Fentry-points-txt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheelodex%2Fentry-points-txt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheelodex%2Fentry-points-txt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wheelodex","download_url":"https://codeload.github.com/wheelodex/entry-points-txt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613066,"owners_count":21133433,"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":["available-on-pypi","entry-points","python"],"created_at":"2024-12-09T21:13:33.090Z","updated_at":"2025-04-12T18:30:28.029Z","avatar_url":"https://github.com/wheelodex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|repostatus| |ci-status| |coverage| |pyversions| |license|\n\n.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg\n    :target: https://www.repostatus.org/#active\n    :alt: Project Status: Active — The project has reached a stable, usable\n          state and is being actively developed.\n\n.. |ci-status| image:: https://github.com/wheelodex/entry-points-txt/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/wheelodex/entry-points-txt/actions/workflows/test.yml\n    :alt: CI Status\n\n.. |coverage| image:: https://codecov.io/gh/wheelodex/entry-points-txt/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/wheelodex/entry-points-txt\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/entry-points-txt.svg\n    :target: https://pypi.org/project/entry-points-txt/\n\n.. |license| image:: https://img.shields.io/github/license/wheelodex/entry-points-txt.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub \u003chttps://github.com/wheelodex/entry-points-txt\u003e`_\n| `PyPI \u003chttps://pypi.org/project/entry-points-txt/\u003e`_\n| `Issues \u003chttps://github.com/wheelodex/entry-points-txt/issues\u003e`_\n| `Changelog \u003chttps://github.com/wheelodex/entry-points-txt/blob/master/CHANGELOG.md\u003e`_\n\n``entry-points-txt`` provides functions for reading \u0026 writing\n``entry_points.txt`` files according to `the spec`_.  That is the one thing it\ndoes, and it endeavors to do it well.\n\n.. _the spec: https://packaging.python.org/specifications/entry-points/\n\nInstallation\n============\n``entry-points-txt`` requires Python 3.8 or higher.  Just use `pip\n\u003chttps://pip.pypa.io\u003e`_ for Python 3 (You have pip, right?) to install\n``entry-points-txt``::\n\n    python3 -m pip install entry-points-txt\n\n\nAPI\n===\n\n``EntryPoint``\n--------------\n\n.. code:: python\n\n    class EntryPoint(NamedTuple)\n\nA representation of an entry point as a namedtuple.  Instances have the\nfollowing attributes and methods:\n\n``group: str``\n   The name of the entry point group (e.g., ``\"console_scripts\"``)\n\n``name: str``\n   The name of the entry point\n\n``module: str``\n   The module portion of the attribute reference (the part before the colon)\n\n``attr: Optional[str]``\n   The attribute/object portion of the attribute reference (the part after the\n   colon), or ``None`` if not specified\n\n``extras: Tuple[str, ...]``\n   Extras required for the entry point\n\n``load() -\u003e Any``\n   Returns the object referred to by the entry point\n\n``to_line() -\u003e str``\n   Returns the representation of the entry point as a line in\n   ``entry_points.txt``, i.e., a line of the form ``name = module:attr\n   [extras]``\n\n``EntryPointSet``\n-----------------\n\n.. code:: python\n\n    EntryPointSet = Dict[str, Dict[str, EntryPoint]]\n\nAn alias for the return type of ``load()`` \u0026 ``loads()`` and the argument type\nof ``dump()`` \u0026 ``dumps()``.  Entry points are organized into a ``dict`` that\nmaps group names to sub-``dict``\\s that map entry point names to ``EntryPoint``\ninstances.\n\n``load()``\n----------\n\n.. code:: python\n\n    entry_points_txt.load(fp: IO[str]) -\u003e EntryPointSet\n\nParse a file-like object as an ``entry_points.txt``-format file and return the\nresults.\n\nFor example, the following input:\n\n.. code:: ini\n\n    [console_scripts]\n    foo = package.__main__:main\n    bar = package.cli:klass.attr\n\n    [thingy.extension]\n    quux = package.thingy [xtr]\n\nwould be parsed as:\n\n.. code:: python\n\n    {\n        \"console_scripts\": {\n            \"foo\": EntryPoint(group=\"console_scripts\", name=\"foo\", module=\"package.__main__\", attr=\"main\", extras=()),\n            \"bar\": EntryPoint(group=\"console_scripts\", name=\"bar\", module=\"package.cli\", attr=\"klass.attr\", extras=()),\n        },\n        \"thingy.extension\": {\n            \"quux\": EntryPoint(group=\"thingy.extension\", name=\"quux\", module=\"package.thingy\", attr=None, extras=(\"xtr\",)),\n        },\n    }\n\n``loads()``\n-----------\n\n.. code:: python\n\n    entry_points_txt.loads(s: str) -\u003e EntryPointSet\n\nLike ``load()``, but reads from a string instead of a filehandle\n\n``dump()``\n----------\n\n.. code:: python\n\n    entry_points_txt.dump(eps: EntryPointSet, fp: IO[str]) -\u003e None\n\nWrite a collection of entry points to a file-like object in\n``entry_points.txt`` format.  A ``ValueError`` is raised and nothing is written\nif the group or name key under which an ``EntryPoint`` is located does not\nmatch its ``group`` or ``name`` attribute.\n\n``dumps()``\n-----------\n\n.. code:: python\n\n    entry_points_txt.dumps(eps: EntryPointSet) -\u003e str\n\nLike ``dump()``, but returns a string instead of writing to a filehandle\n\n``dump_list()``\n---------------\n\n.. code:: python\n\n    entry_points_txt.dump_list(eps: Iterable[EntryPoint], fp: IO[str]) -\u003e None\n\nWrite an iterable of entry points to a file-like object in ``entry_points.txt``\nformat.  If two or more entry points have the same group \u0026 name, only the last\none will be output.\n\n``dumps_list()``\n----------------\n\n.. code:: python\n\n    entry_points_txt.dumps_list(eps: Iterable[EntryPoint]) -\u003e str\n\nLike ``dump_list()``, but returns a string instead of writing to a filehandle\n\n``ParseError``\n--------------\n\n.. code:: python\n\n    class ParseError(ValueError)\n\nException raised by ``load()`` or ``loads()`` when given invalid input\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheelodex%2Fentry-points-txt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwheelodex%2Fentry-points-txt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheelodex%2Fentry-points-txt/lists"}