https://github.com/openscilab/dmeta
Remove Metadata from Microsoft Office Files
https://github.com/openscilab/dmeta
anonymization docx metadata metadata-editor microsoft-excel microsoft-office microsoft-powerpoint microsoft-word pptx xlsx
Last synced: 6 months ago
JSON representation
Remove Metadata from Microsoft Office Files
- Host: GitHub
- URL: https://github.com/openscilab/dmeta
- Owner: openscilab
- License: mit
- Created: 2023-09-23T17:12:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T21:07:39.000Z (6 months ago)
- Last Synced: 2025-01-07T22:22:31.505Z (6 months ago)
- Topics: anonymization, docx, metadata, metadata-editor, microsoft-excel, microsoft-office, microsoft-powerpoint, microsoft-word, pptx, xlsx
- Language: Python
- Homepage:
- Size: 730 KB
- Stars: 17
- Watchers: 0
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Authors: AUTHORS.md
Awesome Lists containing this project
README
----------
## Overview
DMeta is an open source Python package that removes metadata of Microsoft Office files.
Branch
main
dev
CI
![]()
![]()
## 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 clearDOCX_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 updateCONFIG_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_allCONFIG_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 [[email protected]](mailto:[email protected] "[email protected]").
- Please complete the issue template
You can also join our discord server## 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 ;-) .