{"id":24206420,"url":"https://github.com/openscilab/dmeta","last_synced_at":"2025-09-22T05:32:25.690Z","repository":{"id":218684118,"uuid":"695604375","full_name":"openscilab/dmeta","owner":"openscilab","description":"Remove Metadata from Microsoft Office Files","archived":false,"fork":false,"pushed_at":"2025-01-07T21:07:39.000Z","size":748,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-07T22:22:31.505Z","etag":null,"topics":["anonymization","docx","metadata","metadata-editor","microsoft-excel","microsoft-office","microsoft-powerpoint","microsoft-word","pptx","xlsx"],"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/openscilab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-23T17:12:13.000Z","updated_at":"2024-10-28T02:43:19.000Z","dependencies_parsed_at":"2024-04-14T12:43:45.726Z","dependency_job_id":"4f8f9f28-1b86-4f66-b2c1-165f32a5faa8","html_url":"https://github.com/openscilab/dmeta","commit_stats":null,"previous_names":["openscilab/metadoc"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscilab%2Fdmeta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscilab%2Fdmeta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscilab%2Fdmeta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openscilab%2Fdmeta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openscilab","download_url":"https://codeload.github.com/openscilab/dmeta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233828071,"owners_count":18736577,"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":["anonymization","docx","metadata","metadata-editor","microsoft-excel","microsoft-office","microsoft-powerpoint","microsoft-word","pptx","xlsx"],"created_at":"2025-01-14T00:32:03.485Z","updated_at":"2025-09-22T05:32:25.681Z","avatar_url":"https://github.com/openscilab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/openscilab/dmeta/raw/main/otherfiles/logo.png\" width=\"280\" height=\"400\"\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://codecov.io/gh/openscilab/dmeta\"\u003e\u003cimg src=\"https://codecov.io/gh/openscilab/dmeta/branch/dev/graph/badge.svg\" alt=\"Codecov\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://badge.fury.io/py/dmeta\"\u003e\u003cimg src=\"https://badge.fury.io/py/dmeta.svg\" alt=\"PyPI version\" height=\"18\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.python.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/built%20with-Python3-green.svg\" alt=\"built with Python3\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://discord.gg/626twyuPZG\"\u003e\u003cimg src=\"https://img.shields.io/discord/1064533716615049236.svg\" alt=\"Discord Channel\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n----------\n\n## Overview\n\u003cp align=\"justify\"\u003e\nDMeta is an open source Python package that removes metadata of Microsoft Office files.\n\u003c/p\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003ePyPI Counter\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://pepy.tech/projects/dmeta\"\u003e\n                \u003cimg src=\"https://static.pepy.tech/badge/dmeta\" alt=\"PyPI Downloads\"\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eGithub Stars\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003ca href=\"https://github.com/openscilab/dmeta\"\u003e\n                \u003cimg src=\"https://img.shields.io/github/stars/openscilab/dmeta.svg?style=social\u0026label=Stars\"\u003e\n            \u003c/a\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\u003ctable\u003e\n    \u003ctr\u003e \n        \u003ctd align=\"center\"\u003eBranch\u003c/td\u003e\n        \u003ctd align=\"center\"\u003emain\u003c/td\u003e\n        \u003ctd align=\"center\"\u003edev\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\"\u003eCI\u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003cimg src=\"https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=main\"\u003e\n        \u003c/td\u003e\n        \u003ctd align=\"center\"\u003e\n            \u003cimg src=\"https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=dev\"\u003e\n            \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Installation\n\n### PyPI\n\n- Check [Python Packaging User Guide](https://packaging.python.org/installing/)\n- Run `pip install dmeta==0.4`\n### Source code\n- Download [Version 0.4](https://github.com/openscilab/dmeta/archive/v0.4.zip) or [Latest Source](https://github.com/openscilab/dmeta/archive/dev.zip)\n- Run `pip install .`\n\n## Usage\n### In Python\n⚠️ Use `in_place` to apply the changes directly to the original file.\n\n⚠️`in_place` flag is `False` by default.\n\n#### Clear metadata for a .docx file in place\n```python\nimport os\nfrom dmeta.functions import clear\n\nDOCX_FILE_PATH = os.path.join(os.getcwd(), \"sample.docx\")\nclear(DOCX_FILE_PATH, in_place=True)\n```\n#### Clear metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory\n```python\nfrom dmeta.functions import clear_all\nclear_all()\n```\n#### Update metadata for a .pptx file in place\n```python\nimport os\nfrom dmeta.functions import update\n\nCONFIG_FILE_PATH = os.path.join(os.getcwd(), \"config.json\") \nDOCX_FILE_PATH = os.path.join(os.getcwd(), \"sample.pptx\")\nupdate(CONFIG_FILE_PATH, DOCX_FILE_PATH, in_place=True)\n```\n#### Update metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory\n```python\nimport os\nfrom dmeta.functions import update_all\n\nCONFIG_FILE_PATH = os.path.join(os.getcwd(), \"config.json\") \nupdate_all(CONFIG_FILE_PATH)\n```\n\n### CLI\n⚠️ You can use `dmeta` or `python -m dmeta` to run this program\n\n⚠️ Use `--inplace` to apply the changes directly to the original file.\n\n\n#### Clear metadata for a .docx file in place\n```console\ndmeta --clear \"./test_a.docx\" --inplace\n```\n#### Clear metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory\n```console\ndmeta --clear-all\n```\n#### Update metadata for a .xlsx file in place\n```console\ndmeta --update \"./test_a.xlsx\" --config \"./config.json\" --inplace\n```\n#### Update metadata for all existing microsoft files (.docx|.pptx|.xlsx) files in the current directory\n```console\ndmeta --update-all --config \"./config.json\"\n```\n#### Version\n```console\ndmeta -v\ndmeta --version\n```\n#### Info\n```console\ndmeta --info\n```\n\n### Dmeta as pre-commit hook\n\nTo ensure that **no Microsoft Office files ever enter your repo with embedded metadata**, you can use Dmeta’s built-in pre-commit hooks.\n\n#### 1. Install the pre-commit framework\nIf you don’t already have it:\n```bash\npip install pre-commit\n```\n\n#### 2. Add Dmeta to your project’s .pre-commit-config.yaml\nIn your project root, create or update .pre-commit-config.yaml:\n```yaml\nrepos:\n  - repo: https://github.com/openscilab/dmeta.git\n    rev: v0.4 # minimum v0.4 or commit SHA\n    hooks:\n      - id: clear-metadata\n```\n* `rev`: must exactly match the minimum tag supporting pre-commit hooks or the commit SHA where the targetted `.pre-commit-hooks.yaml` exists.\n\n#### 3. Install the hook\n```bash\npre-commit install # or pre_commit install (in windows)\n```\n\nNow, every time you `git commit`, Dmeta will automatically clear metadata from any Microsoft files in-place.\n\n#### ⚠️ Important: Clean Before You Commit\n\nDo **not** stage or add Microsoft Office files **before** removing their metadata.\n\nIf you run `git add` on Office files that still contain embedded metadata, the pre-commit hook will attempt to clean them **in-place**, which modifies the files after they’ve been staged. As a result, **Git will block the commit** because the content has changed mid-process.\n\n#### ✅ Suggested Correct Workflow\n\n1. Let the hook run automatically on earlier commits that didn’t add Office files, or run it manually. To do manually you can run `pre-commit run clear-metadata --all-files` \n\n2. Then:\n   ```bash\n   git add \u003ccleaned-files\u003e\n   git commit -m \"Your message\"\n   ```\n\n## Supported files\n| File format | support | \n| ---------------- | ---------------- | \n| Microsoft Word (.docx) | \u0026#x2705; |\n| Microsoft PowerPoint (.pptx) | \u0026#x2705; |\n| Microsoft Excel (.xlsx) | \u0026#x2705; |\n\n\n## Issues \u0026 bug reports\n\nJust fill an issue and describe it. We'll check it ASAP! or send an email to [dmeta@openscilab.com](mailto:dmeta@openscilab.com \"dmeta@openscilab.com\"). \n\n- Please complete the issue template\n \nYou can also join our discord server\n\n\u003ca href=\"https://discord.gg/626twyuPZG\"\u003e\n  \u003cimg src=\"https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge\" alt=\"Discord Channel\"\u003e\n\u003c/a\u003e\n\n## Acknowledgments\n\n[Python Software Foundation (PSF)](https://www.python.org/psf/) granted DMeta library partially for version(s) 0.4.\n[PSF](https://www.python.org/psf/) is the organization behind Python. Their mission is to promote, protect, and advance the Python programming language and to support and facilitate the growth of a diverse and international community of Python programmers.\n\n\u003ca href=\"https://www.python.org/psf/\"\u003e\u003cimg src=\"https://github.com/openscilab/dmeta/raw/main/otherfiles/psf.png\" height=\"65px\" alt=\"Python Software Foundation\"\u003e\u003c/a\u003e\n\n\n## Show your support\n\n\n### Star this repo\n\nGive a ⭐️ if this project helped you!\n\n### Donate to our project\nIf you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .\t\t\t\n\n\u003ca href=\"https://openscilab.com/#donation\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/openscilab/dmeta/raw/main/otherfiles/donation.png\" height=\"90px\" width=\"270px\" alt=\"DMeta Donation\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscilab%2Fdmeta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenscilab%2Fdmeta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenscilab%2Fdmeta/lists"}