{"id":15358379,"url":"https://github.com/astrofrog/pyavm","last_synced_at":"2025-07-22T07:32:09.089Z","repository":{"id":47188844,"uuid":"749496","full_name":"astrofrog/pyavm","owner":"astrofrog","description":"Pure-python AVM library","archived":false,"fork":false,"pushed_at":"2024-06-09T18:36:03.000Z","size":741,"stargazers_count":21,"open_issues_count":13,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-12T15:43:31.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://astrofrog.github.io/pyavm/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrofrog.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","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":"2010-06-30T17:25:15.000Z","updated_at":"2025-02-17T06:15:28.000Z","dependencies_parsed_at":"2024-06-09T20:29:13.138Z","dependency_job_id":null,"html_url":"https://github.com/astrofrog/pyavm","commit_stats":{"total_commits":166,"total_committers":6,"mean_commits":"27.666666666666668","dds":"0.12048192771084343","last_synced_commit":"7d5d6d2cbaff385f0bc4708ec83959feadd9100b"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/astrofrog/pyavm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpyavm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpyavm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpyavm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpyavm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrofrog","download_url":"https://codeload.github.com/astrofrog/pyavm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrofrog%2Fpyavm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266447760,"owners_count":23930023,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-01T12:41:00.067Z","updated_at":"2025-07-22T07:32:09.070Z","avatar_url":"https://github.com/astrofrog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|Build Status| |Coverage Status|\n\nAbout\n-----\n\nPyAVM is a module to represent, read, and write metadata following the\n`*Astronomy Visualization\nMetadata* \u003chttp://www.virtualastronomy.org/avm_metadata.php\u003e`__ (AVM)\nstandard.\n\nRequirements\n------------\n\nPyAVM supports Python 3.8 and later. No other dependencies are needed\nsimply to read and embed AVM meta-data.\n\nHowever, the following optional dependencies are needed for more\nadvanced functionality:\n\n-  `Numpy \u003chttp://www.numpy.org\u003e`__ 1.10 or later\n-  `Astropy \u003chttp://www.astropy.org\u003e`__ to handle WCS objects and FITS\n   headers\n-  `py.test \u003chttp://www.pytest.org\u003e`__ and\n   `PIL \u003chttp://www.pythonware.com/products/pil/\u003e`__ for tests\n\nInstalling and Reporting issues\n-------------------------------\n\nPyAVM can be installed with pip::\n\n    pip install pyavm\n\nPlease report any issues you encounter via the `issue\ntracker \u003chttps://github.com/astrofrog/pyavm/issues\u003e`__ on GitHub.\n\nUsing PyAVM\n-----------\n\nImporting\n~~~~~~~~~\n\nPyAVM provides the ``AVM`` class to represent AVM meta-data, and is\nimported as follows:\n\n.. code:: python\n\n    \u003e\u003e\u003e from pyavm import AVM\n\nParsing files\n~~~~~~~~~~~~~\n\nTo parse AVM meta-data from an existing image, simply call the\n``from_image`` class method using the filename of the image (or any\nfile-like object):\n\n.. code:: python\n\n    \u003e\u003e\u003e avm = AVM.from_image('myexample.jpg')\n\nOnly JPEG and PNG files are properly supported in that the parsing\nfollows the JPEG and PNG specification. For other file formats, PyAVM\nwill simply scan the contents of the file, looking for an XMP packet.\nThis method is less reliable, but should work in most real-life cases.\n\nAccessing and setting the meta-data\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can view the contents of the AVM object by using\n\n.. code:: python\n\n    \u003e\u003e\u003e print(avm)\n\nThe AVM meta-data can be accessed using the attribute notation:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm.Spatial.Equinox\n    'J2000'\n    \u003e\u003e\u003e avm.Publisher\n    'Chandra X-ray Observatory'\n\nTags can be modified:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm.Spatial.Equinox = \"B1950\"\n    \u003e\u003e\u003e avm.Spatial.Notes = \"The WCS information was updated on 04/02/2010\"\n\nCreating an AVM object from scratch\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo create an empty AVM meta-data holder, simply call ``AVM()`` without\nany arguments:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm = AVM()\n\nNote that this will create an AVM object following the 1.2\nspecification. If necessary, you can specify which version of the\nstandard to use:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm = AVM(version=1.1)\n\nConverting to a WCS object\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIt is possible to create an Astropy WCS object from the AVM meta-data:\n\n.. code:: python\n\n    \u003e\u003e\u003e wcs = avm.to_wcs()\n\nBy default, ``Spatial.FITSheader`` will be used if available, but if\nnot, the WCS information is extracted from the other ``Spatial.*`` tags.\nTo force PyAVM to not try ``Spatial.FITSheader``, use:\n\n.. code:: python\n\n    \u003e\u003e\u003e wcs = avm.to_wcs(use_full_header=False)\n\nInitializing from a FITS header\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo create an AVM meta-data object from a FITS header, simply pass the\nheader (as an Astropy Header instance) to the ``from_header`` class\nmethod:\n\n.. code:: python\n\n    \u003e\u003e\u003e from astropy.io import fits\n    \u003e\u003e\u003e header = fits.getheader('image.fits')\n    \u003e\u003e\u003e avm = AVM.from_header(header)\n\nBy default, the AVM tag ``Spatial.FITSheader`` will be created,\ncontaining the full header (in addition to the other ``Spatial.*``\ntags). This can be disabled with:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm = AVM.from_header(header, include_full_header=False)\n\nInitializing from a WCS object\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSimilarly, it is possible to create an AVM meta-data object from an\nAstropy WCS instance:\n\n.. code:: python\n\n    \u003e\u003e\u003e from astropy.wcs import WCS\n    \u003e\u003e\u003e from pyavm import AVM\n    \u003e\u003e\u003e wcs = WCS('image.fits')\n    \u003e\u003e\u003e avm = AVM.from_wcs(wcs)\n\nTagging images with AVM meta-data\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIt is possible to embed AVM meta-data into an image file:\n\n.. code:: python\n\n    \u003e\u003e\u003e avm.embed('original_image.jpg', 'tagged_image.jpg')\n\nAt this time, only JPG and PNG files are supported for embedding.\n\n.. |Build Status| image:: https://github.com/astrofrog/pyavm/actions/workflows/main.yml/badge.svg\n   :target: https://github.com/astrofrog/pyavm/actions/workflows/main.yml\n.. |Coverage Status| image:: https://coveralls.io/repos/astrofrog/pyavm/badge.svg?branch=master\n   :target: https://coveralls.io/r/astrofrog/pyavm?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fpyavm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrofrog%2Fpyavm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrofrog%2Fpyavm/lists"}