{"library":"metadata-please","title":"Metadata Please","description":"metadata-please is a Python library designed for simple extraction of metadata from Python distribution artifacts. It supports extracting metadata from source distributions (sdists), wheel files, and project directories containing `pyproject.toml` or `setup.py`. The current version is 0.2.1, with releases occurring on an as-needed basis for improvements and bug fixes.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install metadata-please"],"cli":null},"imports":["from metadata_please import get_metadata"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from metadata_please import get_metadata\nfrom pathlib import Path\nimport tempfile\nimport shutil\n\n# Create dummy files for demonstration\ndef create_dummy_sdist(path):\n    path.mkdir(parents=True, exist_ok=True)\n    with open(path / 'setup.py', 'w') as f:\n        f.write(\"from setuptools import setup; setup(name='dummy_sdist', version='0.1.0')\")\n    # In a real scenario, you'd run `python setup.py sdist`\n    # For this example, we'll just point to the dir as if it were an sdist source\n\ndef create_dummy_pyproject_toml(path):\n    path.mkdir(parents=True, exist_ok=True)\n    with open(path / 'pyproject.toml', 'w') as f:\n        f.write('[project]\\nname = \"dummy-toml\"\\nversion = \"0.2.0\"')\n\nwith tempfile.TemporaryDirectory() as tmpdir:\n    tmp_path = Path(tmpdir)\n\n    # Example 1: Project directory with setup.py (simplified as source dir)\n    sdist_source_dir = tmp_path / \"dummy_sdist_project\"\n    create_dummy_sdist(sdist_source_dir)\n    metadata_sdist = get_metadata(sdist_source_dir)\n    print(f\"sdist project Name: {metadata_sdist.name}, Version: {metadata_sdist.version}\")\n\n    # Example 2: Project directory with pyproject.toml\n    pyproject_source_dir = tmp_path / \"dummy_toml_project\"\n    create_dummy_pyproject_toml(pyproject_source_dir)\n    metadata_toml = get_metadata(pyproject_source_dir)\n    print(f\"pyproject.toml project Name: {metadata_toml.name}, Version: {metadata_toml.version}\")\n\n    # Note: For actual .tar.gz (sdist) or .whl (wheel) files,\n    # you would replace the paths with your actual artifact files.\n    # Creating real sdist/wheel files dynamically for a quickstart is complex.\n    # The library is designed to work with these file types directly.\n    # Example (conceptual for artifact files):\n    # real_sdist_path = Path(\"path/to/your_package-1.0.0.tar.gz\")\n    # metadata_real_sdist = get_metadata(real_sdist_path)\n    # print(f\"Real sdist Name: {metadata_real_sdist.name}\")\n","lang":"python","description":"The `get_metadata` function is the primary entry point for `metadata-please`. It takes a `Path` object pointing to a Python artifact (sdist, wheel) or a project source directory (containing `pyproject.toml` or `setup.py`) and returns a metadata object. The example demonstrates usage for project source directories.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"0.2.1","pypi_latest":"0.2.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.9,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.9,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"20.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.1,"import_time_s":null,"mem_mb":null,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"12.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.8,"import_time_s":null,"mem_mb":null,"disk_size":"13M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"12.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"13M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"18.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"metadata-please","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2,"import_time_s":null,"mem_mb":null,"disk_size":"19M"}]}}