{"id":17190902,"url":"https://github.com/dfm/savefig","last_synced_at":"2025-04-13T19:32:04.461Z","repository":{"id":15518987,"uuid":"18253322","full_name":"dfm/savefig","owner":"dfm","description":"Save matplotlib figures with embedded metadata for reproducibility and profit","archived":false,"fork":false,"pushed_at":"2020-06-12T18:25:26.000Z","size":13,"stargazers_count":32,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-27T10:21:33.450Z","etag":null,"topics":[],"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/dfm.png","metadata":{"files":{"readme":"README.rst","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":"2014-03-29T23:32:07.000Z","updated_at":"2024-10-29T22:08:41.000Z","dependencies_parsed_at":"2022-09-16T04:40:12.365Z","dependency_job_id":null,"html_url":"https://github.com/dfm/savefig","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/dfm%2Fsavefig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fsavefig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fsavefig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Fsavefig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfm","download_url":"https://codeload.github.com/dfm/savefig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248768004,"owners_count":21158571,"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-10-15T01:24:20.711Z","updated_at":"2025-04-13T19:32:04.165Z","avatar_url":"https://github.com/dfm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"*Remember that time where you tried to remake a figure for your paper and\ncouldn't seem to get the same results? We've all been there. Well not\nanymore!*\n\nThis module monkey patches the ``savefig`` command from `matplotlib\n\u003chttp://matplotlib.org/\u003e`_ and inserts your current git commit hash into\nthe metadata of the saved file. Currently it supports PNG and PDF figures.\n\n.. image:: https://travis-ci.org/dfm/savefig.svg?branch=master\n        :target: https://travis-ci.org/dfm/savefig\n\nUsage\n-----\n\nFirst, install the module `from PyPI \u003chttps://pypi.python.org/pypi/savefig\u003e`_::\n\n    pip install savefig\n\nor `from source \u003chttps://github.com/dfm/savefig\u003e`_::\n\n    git clone https://github.com/dfm/savefig.git\n    cd savefig\n    python setup.py install\n\nThen in all your code just add the following lines before importing matplotlib::\n\n    from savefig import monkey_patch\n    monkey_patch()\n\nTo read the metadata from an existing image file, run::\n\n    python -m savefig /path/to/figure.png\n\nwhich will give you something like::\n\n    git-hash: 192a639c4a9eb7523e9becd23f359fd7d96e833f\n    git-date: 2014-03-29 21:30:27 -0400\n    git-author: Dan F-M\n\nYou can also get the diff between the saved commit hash and the version used\nto make the figure by running::\n\n    python -m savefig /path/to/figure.png --diff\n\n\nLicense\n-------\n\nCopyright 2014 Dan Foreman-Mackey\n\nAvailable under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Fsavefig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfm%2Fsavefig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Fsavefig/lists"}