Removing microsoft office files' metadata
Project description
Overview
DMeta is an open source Python package that removes metadata of Microsoft Office files.
PyPI Counter | |
Github Stars |
Branch | main | dev |
CI |
Installation
PyPI
- Check Python Packaging User Guide
- Run
pip install dmeta==0.2
Source code
- Download Version 0.2 or Latest Source
- 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
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
from dmeta.functions import clear_all
clear_all()
Update metadata for a .pptx file in place
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
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
dmeta -v
dmeta --version
Clear metadata for a .docx file in place
dmeta --clear "./test_a.docx" --inplace
Clear metadata for all existing microsoft files (.docx|.pptx|.xlsx) in the current directory
dmeta --clear-all
Update metadata for a .xlsx file in place
dmeta --update "./test_a.xlsx" --config "./config.json" --inplace
Update metadata for all existing microsoft files (.docx|.pptx|.xlsx) files in the current directory
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.
- 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 ;-) .
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
0.2 - 2024-08-14
Added
dmeta/errors.py
pptx
andxlsx
supportget_microsoft_format
function inutil.py
SECURITY.md
inplace
parameter in theclear
function infunctions.py
inplace
parameter in theclear_all
function infunctions.py
inplace
parameter in theupdate
function infunctions.py
inplace
parameter in theupdate_all
function infunctions.py
inplace
parameter in CLIinplace
tests
Changed
run_dmeta
infunctions.py
read_json
inutil.py
get_microsoft_format
inutil.py
- error messages in
params.py
clear
function infunctions.py
extract
function inutil.py
remove_format
function inutil.py
clear
function infunctions.py
clear_all
function infunctions.py
update
function infunctions.py
update_all
function infunctions.py
extract_namespaces
function inutil.py
README.md
updated
0.1 - 2024-06-19
Added
CLI
handlermain
function in__main__.py
README.md
clear
function infunctions.py
clear_all
function infunctions.py
update
function infunctions.py
update_all
function infunctions.py
run_dmeta
function infunctions.py
dmeta_help
function infunctions.py
extract_namespaces
function inutil.py
remove_format
function inutil.py
extract_docx
function inutil.py
read_json
function inutil.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dmeta-0.2.tar.gz
.
File metadata
- Download URL: dmeta-0.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8856ff5a76c3fe7d2619f15ac57a9876b4d23b939b9f4b706800aee534e7bbf5 |
|
MD5 | b6c10d5b8878b55dcedcfd66eadb755d |
|
BLAKE2b-256 | 768431112a230340f70c68cc51b64bb7bd77e7e7cb323e0c62ee35e17ca35fc0 |
File details
Details for the file DMeta-0.2-py3-none-any.whl
.
File metadata
- Download URL: DMeta-0.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd5e9efade266718fac9a7baddd6b3e4b19fa45d7849f4536f23e8fcf2d9f6be |
|
MD5 | dd19401520af077763e2cb06c0b5d51d |
|
BLAKE2b-256 | 27fab37ee3f36a5fd8042500b9866b78c8ed47289b56cb39ffd72f909f0ceace |