metametameta


Namemetametameta JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/matthewdeanmartin/metametameta
SummaryGenerate __about__.py with dunder meta.
upload_time2024-01-20 20:16:04
maintainer
docs_urlNone
authorMatthew Martin
requires_python>=3.8
licenseMIT
keywords packagin metadata
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # metametameta

Generate dunder metadata file with `__title__`, `__author__`, etc. Also tools to discover these in other packages.

## Installation

```bash
pipx install metametameta
```

## Usage

```bash
metametameta --source pyproject.toml --target mypackage/__metadata__.py
```

## Motivation

There are many modern ways to get metadata about packages, as of
2024, [importlib.metadata](https://docs.python.org/3/library/importlib.metadata.html) and it's backports will get you
lots of metadata for yours and other packages.

The newest way is [PEP-621](https://peps.python.org/pep-0621/), see also [packaging.python.org](https://packaging.python.org/en/latest/specifications/pyproject-toml/#pyproject-toml-spec)

The oldest way to provide metadata was to use dunder variables in your package, e.g. `__author__`, `__version__`, etc.

The method was never strongly standardized, neither officially nor informally. [Here is one early proponent of this
sort of metadata](https://web.archive.org/web/20111010053227/http://jaynes.colorado.edu/PythonGuidelines.html#module_formatting).

- Metadata fields can appear in any or no python file in a project.
- Sometimes they are at the top of a single file python module, common locations for metadata:
  - `__init__.py`
  - `__meta__.py`
  - `__about__.py`
- Some metadata elements could reasonably be in every single file.
- There are no particular standards for the type of `__author__`. It could be a string, space delimited string, list
  or tuple. That is true for the other metadata elements as well.
- Sometimes the metadata values are code, e.g. `__version__` could be a string or some tuple or data class
  representing a version.

## Workflow

On each build, regenerate the `__about__.py`. Pick one source of your canonical metadata, e.g. `pyproject.toml`,
`setup.py`, `setup.cfg`.

## Using metadata

If you have a lot of packages and you are doing analytics or something with them, you could compile all the metadata
as declared in the source code. It could be different from the metadata that shows on the PyPI page. If you are
searching for contact info for a package maintainer, this might be useful.

Another marginal use case is in error logging. Error loggers gather up info from just about anywhere, anything can
be a clue including metadata of dependencies. So this is one more source of that. See `bug_trail` for a proof of
concept for this usage.

Another marginal use case is that is a folksonomy, a taxonomy created by the people. The official metadata is
governed by the Python Packaging Authority and the Python Software Foundation. If, say, you wanted to add a metadata
item for `__mailing_address__` you could easily do it with source code metadata.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/matthewdeanmartin/metametameta",
    "name": "metametameta",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "packagin,metadata",
    "author": "Matthew Martin",
    "author_email": "matthewdeanmartin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/bd/1a870f491f5a9084f741eef3d26237cd392128d0f93ebdd43657e150117a/metametameta-0.1.0.tar.gz",
    "platform": null,
    "description": "# metametameta\n\nGenerate dunder metadata file with `__title__`, `__author__`, etc. Also tools to discover these in other packages.\n\n## Installation\n\n```bash\npipx install metametameta\n```\n\n## Usage\n\n```bash\nmetametameta --source pyproject.toml --target mypackage/__metadata__.py\n```\n\n## Motivation\n\nThere are many modern ways to get metadata about packages, as of\n2024, [importlib.metadata](https://docs.python.org/3/library/importlib.metadata.html) and it's backports will get you\nlots of metadata for yours and other packages.\n\nThe newest way is [PEP-621](https://peps.python.org/pep-0621/), see also [packaging.python.org](https://packaging.python.org/en/latest/specifications/pyproject-toml/#pyproject-toml-spec)\n\nThe oldest way to provide metadata was to use dunder variables in your package, e.g. `__author__`, `__version__`, etc.\n\nThe method was never strongly standardized, neither officially nor informally. [Here is one early proponent of this\nsort of metadata](https://web.archive.org/web/20111010053227/http://jaynes.colorado.edu/PythonGuidelines.html#module_formatting).\n\n- Metadata fields can appear in any or no python file in a project.\n- Sometimes they are at the top of a single file python module, common locations for metadata:\n  - `__init__.py`\n  - `__meta__.py`\n  - `__about__.py`\n- Some metadata elements could reasonably be in every single file.\n- There are no particular standards for the type of `__author__`. It could be a string, space delimited string, list\n  or tuple. That is true for the other metadata elements as well.\n- Sometimes the metadata values are code, e.g. `__version__` could be a string or some tuple or data class\n  representing a version.\n\n## Workflow\n\nOn each build, regenerate the `__about__.py`. Pick one source of your canonical metadata, e.g. `pyproject.toml`,\n`setup.py`, `setup.cfg`.\n\n## Using metadata\n\nIf you have a lot of packages and you are doing analytics or something with them, you could compile all the metadata\nas declared in the source code. It could be different from the metadata that shows on the PyPI page. If you are\nsearching for contact info for a package maintainer, this might be useful.\n\nAnother marginal use case is in error logging. Error loggers gather up info from just about anywhere, anything can\nbe a clue including metadata of dependencies. So this is one more source of that. See `bug_trail` for a proof of\nconcept for this usage.\n\nAnother marginal use case is that is a folksonomy, a taxonomy created by the people. The official metadata is\ngoverned by the Python Packaging Authority and the Python Software Foundation. If, say, you wanted to add a metadata\nitem for `__mailing_address__` you could easily do it with source code metadata.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate __about__.py with dunder meta.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/matthewdeanmartin/metametameta/issues",
        "Change Log": "https://github.com/matthewdeanmartin/metametameta/blob/main/CHANGELOG.md",
        "Documentation": "https://matthewdeanmartin.github.io/metametameta/metametameta/index.html",
        "Homepage": "https://github.com/matthewdeanmartin/metametameta",
        "Repository": "https://github.com/matthewdeanmartin/metametameta"
    },
    "split_keywords": [
        "packagin",
        "metadata"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b67f24b7fd075c665b5b7269c52451498a554d0bdc5ef982756bf6d6292ed555",
                "md5": "11e8c2a0186b05d40e4e371f2dffa978",
                "sha256": "75519dfa58ac20a0d4cbe8693247f66e61b673e0afbe112b284ed78b332e89d5"
            },
            "downloads": -1,
            "filename": "metametameta-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "11e8c2a0186b05d40e4e371f2dffa978",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12047,
            "upload_time": "2024-01-20T20:16:02",
            "upload_time_iso_8601": "2024-01-20T20:16:02.635213Z",
            "url": "https://files.pythonhosted.org/packages/b6/7f/24b7fd075c665b5b7269c52451498a554d0bdc5ef982756bf6d6292ed555/metametameta-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "debd1a870f491f5a9084f741eef3d26237cd392128d0f93ebdd43657e150117a",
                "md5": "22591000b70cfa625adf909cead96717",
                "sha256": "6eb87f5d0718b8d3bf69d544cf802f68824dd5590c50da54d51267ef623ecc5c"
            },
            "downloads": -1,
            "filename": "metametameta-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "22591000b70cfa625adf909cead96717",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11247,
            "upload_time": "2024-01-20T20:16:04",
            "upload_time_iso_8601": "2024-01-20T20:16:04.066506Z",
            "url": "https://files.pythonhosted.org/packages/de/bd/1a870f491f5a9084f741eef3d26237cd392128d0f93ebdd43657e150117a/metametameta-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-20 20:16:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matthewdeanmartin",
    "github_project": "metametameta",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "metametameta"
}
        
Elapsed time: 0.17982s