{"id":18683009,"url":"https://github.com/numbersprotocol/pyxmp","last_synced_at":"2025-11-07T18:30:24.100Z","repository":{"id":57458651,"uuid":"305942952","full_name":"numbersprotocol/pyxmp","owner":"numbersprotocol","description":"A Python XMP metadata injection tool based on py3exiv2","archived":false,"fork":false,"pushed_at":"2020-10-22T08:34:51.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T01:18:04.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numbersprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-21T07:28:53.000Z","updated_at":"2020-10-22T08:34:53.000Z","dependencies_parsed_at":"2022-09-09T23:12:38.368Z","dependency_job_id":null,"html_url":"https://github.com/numbersprotocol/pyxmp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fpyxmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fpyxmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fpyxmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fpyxmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numbersprotocol","download_url":"https://codeload.github.com/numbersprotocol/pyxmp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239534488,"owners_count":19654882,"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":[],"created_at":"2024-11-07T10:13:28.389Z","updated_at":"2025-11-07T18:30:24.058Z","avatar_url":"https://github.com/numbersprotocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyxmp\nA Python XMP metadata injection tool based on py3exiv2\n\n## Installation\n\n```\npython -m pip install pyxmp\n```\n\n## Usage\n\nTo inject XMP metadata to the image, the input metadata should be a list of dict following the format below, with `provider`, `name` and `value` as keys.\n\n```\n[\n    {\n        \"provider\": \"InfoSnapshot\",\n        \"name\": \"Brand\",\n        \"value\": \"My Service\"\n    },\n    {\n        \"provider\": \"InfoSnapshot\",\n        \"name\": \"Current GPS Accuracy\",\n        \"value\": \"14.589\"\n    },\n    {\n        \"provider\": \"InfoSnapshot\",\n        \"name\": \"Current GPS Latitude\",\n        \"value\": \"25.045234\"\n    },\n    {\n        \"provider\": \"InfoSnapshot\",\n        \"name\": \"Current GPS Longitude\",\n        \"value\": \"121.530795\"\n    },\n    {\n        \"provider\": \"InfoSnapshot\",\n        \"name\": \"Current GPS Timestamp\",\n        \"value\": \"2020-09-15T13:50:25.143Z\"\n    },\n    {\n        \"provider\":\"InfoSnapshot\",\n        \"name\":\"Timestamp\",\n        \"value\":\"2020-09-15T13:50:30.203Z\"\n    }\n]\n```\n\nThen the metadata could be injected like the following example:\n\n\n```\nimport pyxmp\n\nmetadata = {...} # Prepare the metadata like the above example\n\nxmp_injected_image = pyxmp.inject(\n    original_image_bytes,\n    metadata,\n    'http://numbersprotocol.io/xmp/',\n    'examplePrefix'\n)\n```\n\nTo read the XMP metadata into a dict:\n\n```\nimport pyxmp\n\nmetadata_dict = pyxmp.read(xmp_injected_image)\n```\n\nExample injected XMP metadata dict:\n\n```\n{\n    'Xmp.examplePrefix.infoSnapshot.brand': 'My Service',\n    'Xmp.examplePrefix.infoSnapshot.currentGPSAccuracy': '14.589',\n    'Xmp.examplePrefix.infoSnapshot.currentGPSLatitude': '25.045234',\n    'Xmp.examplePrefix.infoSnapshot.currentGPSLongitude': '121.530795',\n    'Xmp.examplePrefix.infoSnapshot.currentGPSTimestamp': '2020-09-15T13:50:25.143Z',\n    'Xmp.examplePrefix.infoSnapshot.timestamp': '2020-09-15T13:50:30.203Z'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fpyxmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumbersprotocol%2Fpyxmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fpyxmp/lists"}