<div align="center">
<img src="https://github.com/openscilab/dmeta/raw/main/otherfiles/logo.png" width="280" height="400">
<br/>
<br/>
<a href="https://codecov.io/gh/openscilab/dmeta"><img src="https://codecov.io/gh/openscilab/dmeta/branch/dev/graph/badge.svg" alt="Codecov"></a>
<a href="https://badge.fury.io/py/dmeta"><img src="https://badge.fury.io/py/dmeta.svg" alt="PyPI version" height="18"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
<a href="https://discord.gg/626twyuPZG"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
</div>
----------
## Overview
<p align="justify">
DMeta is an open source Python package that removes metadata of Microsoft Office files.
</p>
<table>
<tr>
<td align="center">PyPI Counter</td>
<td align="center">
<a href="https://pepy.tech/projects/dmeta">
<img src="https://static.pepy.tech/badge/dmeta" alt="PyPI Downloads">
</a>
</td>
</tr>
<tr>
<td align="center">Github Stars</td>
<td align="center">
<a href="https://github.com/openscilab/dmeta">
<img src="https://img.shields.io/github/stars/openscilab/dmeta.svg?style=social&label=Stars">
</a>
</td>
</tr>
</table>
<table>
<tr>
<td align="center">Branch</td>
<td align="center">main</td>
<td align="center">dev</td>
</tr>
<tr>
<td align="center">CI</td>
<td align="center">
<img src="https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=main">
</td>
<td align="center">
<img src="https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=dev">
</td>
</tr>
</table>
## Installation
### PyPI
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- Run `pip install dmeta==0.3`
### Source code
- Download [Version 0.3](https://github.com/openscilab/dmeta/archive/v0.3.zip) or [Latest Source](https://github.com/openscilab/dmeta/archive/dev.zip)
- Run `pip install .`
## Usage
### In Python
⚠️ Use `in_place` to apply the changes directly to the original file.
⚠️`in_place` flag is `False` by default.
#### Clear metadata for a .docx file in place
```python
import os
from dmeta.functions import clear
DOCX_FILE_PATH = os.path.join(os.getcwd(), "sample.docx")
clear(DOCX_FILE_PATH, in_place=True)
```
#### Clear metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory
```python
from dmeta.functions import clear_all
clear_all()
```
#### Update metadata for a .pptx file in place
```python
import os
from dmeta.functions import update
CONFIG_FILE_PATH = os.path.join(os.getcwd(), "config.json")
DOCX_FILE_PATH = os.path.join(os.getcwd(), "sample.pptx")
update(CONFIG_FILE_PATH, DOCX_FILE_PATH, in_place=True)
```
#### Update metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory
```python
import os
from dmeta.functions import update_all
CONFIG_FILE_PATH = os.path.join(os.getcwd(), "config.json")
update_all(CONFIG_FILE_PATH)
```
### CLI
⚠️ You can use `dmeta` or `python -m dmeta` to run this program
⚠️ Use `--inplace` to apply the changes directly to the original file.
#### Version
```console
dmeta -v
dmeta --version
```
#### Clear metadata for a .docx file in place
```console
dmeta --clear "./test_a.docx" --inplace
```
#### Clear metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory
```console
dmeta --clear-all
```
#### Update metadata for a .xlsx file in place
```console
dmeta --update "./test_a.xlsx" --config "./config.json" --inplace
```
#### Update metadata for all existing microsoft files (.docx|.pptx|.xlsx) files in the current directory
```console
dmeta --update-all --config "./config.json"
```
## Supported files
| File format | support |
| ---------------- | ---------------- |
| Microsoft Word (.docx) | ✅ |
| Microsoft PowerPoint (.pptx) | ✅ |
| Microsoft Excel (.xlsx) | ✅ |
## Issues & bug reports
Just 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").
- Please complete the issue template
You can also join our discord server
<a href="https://discord.gg/626twyuPZG">
<img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
</a>
## Show your support
### Star this repo
Give a ⭐️ if this project helped you!
### Donate to our project
If 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 ;-) .
<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/dmeta/raw/main/otherfiles/donation.png" height="90px" width="270px" alt="DMeta Donation"></a>
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.3] - 2025-01-13
### Removed
- `extract_namespaces` function in `util.py`
### Added
- `DMetaBaseError` added to `dmeta/__init__.py`
- `overwrite_metadata` function added to `functions.py`
### Changed
- `update` function in `functions.py` refactored
- `clear` function in `functions.py` refactored
- `README.md` updated
- GitHub actions are limited to the `dev` and `main` branches
- `Python 3.13` added to `test.yml`
## [0.2] - 2024-08-14
### Added
- `dmeta/errors.py`
- `pptx` and `xlsx` support
- `get_microsoft_format` function in `util.py`
- `SECURITY.md`
- `inplace` parameter in the `clear` function in `functions.py`
- `inplace` parameter in the `clear_all` function in `functions.py`
- `inplace` parameter in the `update` function in `functions.py`
- `inplace` parameter in the `update_all` function in `functions.py`
- `inplace` parameter in CLI
- `inplace` tests
### Changed
- `run_dmeta` in `functions.py`
- `read_json` in `util.py`
- `get_microsoft_format` in `util.py`
- error messages in `params.py`
- `clear` function in `functions.py`
- `extract` function in `util.py`
- `remove_format` function in `util.py`
- `clear` function in `functions.py`
- `clear_all` function in `functions.py`
- `update` function in `functions.py`
- `update_all` function in `functions.py`
- `extract_namespaces` function in `util.py`
- `README.md` updated
## [0.1] - 2024-06-19
### Added
- `CLI` handler
- `main` function in `__main__.py`
- `README.md`
- `clear` function in `functions.py`
- `clear_all` function in `functions.py`
- `update` function in `functions.py`
- `update_all` function in `functions.py`
- `run_dmeta` function in `functions.py`
- `dmeta_help` function in `functions.py`
- `extract_namespaces` function in `util.py`
- `remove_format` function in `util.py`
- `extract_docx` function in `util.py`
- `read_json` function in `util.py`
[Unreleased]: https://github.com/openscilab/dmeta/compare/v0.3...dev
[0.3]: https://github.com/openscilab/dmeta/compare/v0.2...v0.3
[0.2]: https://github.com/openscilab/dmeta/compare/v0.1...v0.2
[0.1]: https://github.com/openscilab/dmeta/compare/9a4ad10...v0.1
Raw data
{
"_id": null,
"home_page": "https://github.com/openscilab/dmeta",
"name": "DMeta",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "python3 python metadata remove",
"author": "DMeta Development Team",
"author_email": "dmeta@openscilab.com",
"download_url": "https://files.pythonhosted.org/packages/87/2f/b81d99a4b2baca7a7e8c5bbbc8ed167a0bef6986fce28061a1c6c84e6fe1/dmeta-0.3.tar.gz",
"platform": null,
"description": "\n<div align=\"center\">\n <img src=\"https://github.com/openscilab/dmeta/raw/main/otherfiles/logo.png\" width=\"280\" height=\"400\">\n <br/>\n <br/>\n <a href=\"https://codecov.io/gh/openscilab/dmeta\"><img src=\"https://codecov.io/gh/openscilab/dmeta/branch/dev/graph/badge.svg\" alt=\"Codecov\"></a>\n <a href=\"https://badge.fury.io/py/dmeta\"><img src=\"https://badge.fury.io/py/dmeta.svg\" alt=\"PyPI version\" height=\"18\"></a>\n <a href=\"https://www.python.org/\"><img src=\"https://img.shields.io/badge/built%20with-Python3-green.svg\" alt=\"built with Python3\"></a>\n <a href=\"https://discord.gg/626twyuPZG\"><img src=\"https://img.shields.io/discord/1064533716615049236.svg\" alt=\"Discord Channel\"></a>\n</div>\n\n----------\n\n## Overview\n<p align=\"justify\">\nDMeta is an open source Python package that removes metadata of Microsoft Office files.\n</p>\n<table>\n <tr>\n <td align=\"center\">PyPI Counter</td>\n <td align=\"center\">\n <a href=\"https://pepy.tech/projects/dmeta\">\n <img src=\"https://static.pepy.tech/badge/dmeta\" alt=\"PyPI Downloads\">\n </a>\n </td>\n </tr>\n <tr>\n <td align=\"center\">Github Stars</td>\n <td align=\"center\">\n <a href=\"https://github.com/openscilab/dmeta\">\n <img src=\"https://img.shields.io/github/stars/openscilab/dmeta.svg?style=social&label=Stars\">\n </a>\n </td>\n </tr>\n</table>\n<table>\n <tr> \n <td align=\"center\">Branch</td>\n <td align=\"center\">main</td>\n <td align=\"center\">dev</td>\n </tr>\n <tr>\n <td align=\"center\">CI</td>\n <td align=\"center\">\n <img src=\"https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=main\">\n </td>\n <td align=\"center\">\n <img src=\"https://github.com/openscilab/dmeta/actions/workflows/test.yml/badge.svg?branch=dev\">\n </td>\n </tr>\n</table>\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.3`\n### Source code\n- Download [Version 0.3](https://github.com/openscilab/dmeta/archive/v0.3.zip) or [Latest Source](https://github.com/openscilab/dmeta/archive/dev.zip)\n- Run `pip install .`\n\n## Usage\n### In Python\n\u26a0\ufe0f Use `in_place` to apply the changes directly to the original file.\n\n\u26a0\ufe0f`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\u26a0\ufe0f You can use `dmeta` or `python -m dmeta` to run this program\n\n\u26a0\ufe0f Use `--inplace` to apply the changes directly to the original file.\n\n\n#### Version\n```console\ndmeta -v\ndmeta --version\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\n## Supported files\n| File format | support | \n| ---------------- | ---------------- | \n| Microsoft Word (.docx) | ✅ |\n| Microsoft PowerPoint (.pptx) | ✅ |\n| Microsoft Excel (.xlsx) | ✅ |\n\n\n## Issues & 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<a href=\"https://discord.gg/626twyuPZG\">\n <img src=\"https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge\" alt=\"Discord Channel\">\n</a>\n\n\n## Show your support\n\n\n### Star this repo\n\nGive a \u2b50\ufe0f 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<a href=\"https://openscilab.com/#donation\" target=\"_blank\"><img src=\"https://github.com/openscilab/dmeta/raw/main/otherfiles/donation.png\" height=\"90px\" width=\"270px\" alt=\"DMeta Donation\"></a>\n\n# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)\nand this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n## [0.3] - 2025-01-13\n### Removed\n- `extract_namespaces` function in `util.py`\n### Added\n- `DMetaBaseError` added to `dmeta/__init__.py`\n- `overwrite_metadata` function added to `functions.py`\n### Changed\n- `update` function in `functions.py` refactored\n- `clear` function in `functions.py` refactored\n- `README.md` updated\n- GitHub actions are limited to the `dev` and `main` branches\n- `Python 3.13` added to `test.yml`\n## [0.2] - 2024-08-14\n### Added\n- `dmeta/errors.py`\n- `pptx` and `xlsx` support\n- `get_microsoft_format` function in `util.py`\n- `SECURITY.md`\n- `inplace` parameter in the `clear` function in `functions.py`\n- `inplace` parameter in the `clear_all` function in `functions.py`\n- `inplace` parameter in the `update` function in `functions.py`\n- `inplace` parameter in the `update_all` function in `functions.py`\n- `inplace` parameter in CLI\n- `inplace` tests\n### Changed\n- `run_dmeta` in `functions.py`\n- `read_json` in `util.py`\n- `get_microsoft_format` in `util.py`\n- error messages in `params.py`\n- `clear` function in `functions.py`\n- `extract` function in `util.py`\n- `remove_format` function in `util.py`\n- `clear` function in `functions.py`\n- `clear_all` function in `functions.py`\n- `update` function in `functions.py`\n- `update_all` function in `functions.py`\n- `extract_namespaces` function in `util.py`\n- `README.md` updated\n## [0.1] - 2024-06-19\n### Added\n- `CLI` handler\n- `main` function in `__main__.py`\n- `README.md`\n- `clear` function in `functions.py`\n- `clear_all` function in `functions.py`\n- `update` function in `functions.py`\n- `update_all` function in `functions.py`\n- `run_dmeta` function in `functions.py`\n- `dmeta_help` function in `functions.py`\n- `extract_namespaces` function in `util.py`\n- `remove_format` function in `util.py`\n- `extract_docx` function in `util.py`\n- `read_json` function in `util.py`\n\n[Unreleased]: https://github.com/openscilab/dmeta/compare/v0.3...dev\n[0.3]: https://github.com/openscilab/dmeta/compare/v0.2...v0.3\n[0.2]: https://github.com/openscilab/dmeta/compare/v0.1...v0.2\n[0.1]: https://github.com/openscilab/dmeta/compare/9a4ad10...v0.1\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Removing microsoft office files' metadata",
"version": "0.3",
"project_urls": {
"Download": "https://github.com/openscilab/dmeta/tarball/v0.3",
"Homepage": "https://github.com/openscilab/dmeta",
"Source": "https://github.com/openscilab/dmeta"
},
"split_keywords": [
"python3",
"python",
"metadata",
"remove"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "99f95b843c2ee56873dcfba4d246e312ede26580dde277bba8351621f61acc1f",
"md5": "ca45f195f1eb32b3eadd8520e767a519",
"sha256": "f92ce1388fbe49bc05d4de92ef66be78edef84b4734e1b91f10b33374c69eeb1"
},
"downloads": -1,
"filename": "DMeta-0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca45f195f1eb32b3eadd8520e767a519",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9992,
"upload_time": "2025-01-12T22:29:11",
"upload_time_iso_8601": "2025-01-12T22:29:11.886976Z",
"url": "https://files.pythonhosted.org/packages/99/f9/5b843c2ee56873dcfba4d246e312ede26580dde277bba8351621f61acc1f/DMeta-0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "872fb81d99a4b2baca7a7e8c5bbbc8ed167a0bef6986fce28061a1c6c84e6fe1",
"md5": "439e0238648dca61cd5d72a677f311d9",
"sha256": "1a97c0081396267e4cf0187f96894cf681054bbf0064bf28f0051e38c7dff879"
},
"downloads": -1,
"filename": "dmeta-0.3.tar.gz",
"has_sig": false,
"md5_digest": "439e0238648dca61cd5d72a677f311d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 8942,
"upload_time": "2025-01-12T22:29:07",
"upload_time_iso_8601": "2025-01-12T22:29:07.915489Z",
"url": "https://files.pythonhosted.org/packages/87/2f/b81d99a4b2baca7a7e8c5bbbc8ed167a0bef6986fce28061a1c6c84e6fe1/dmeta-0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-12 22:29:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "openscilab",
"github_project": "dmeta",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "art",
"specs": [
[
">=",
"1.8"
]
]
},
{
"name": "defusedxml",
"specs": [
[
">=",
"0.7.1"
]
]
},
{
"name": "lxml",
"specs": [
[
">=",
"5.2.2"
]
]
}
],
"lcname": "dmeta"
}