Skip to main content

Removing microsoft office files' metadata

Project description



Codecov PyPI version built with Python3 Discord Channel

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

Source code

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

Discord Channel

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 ;-) .

DMeta Donation

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 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmeta-0.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

DMeta-0.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for dmeta-0.2.tar.gz
Algorithm Hash digest
SHA256 8856ff5a76c3fe7d2619f15ac57a9876b4d23b939b9f4b706800aee534e7bbf5
MD5 b6c10d5b8878b55dcedcfd66eadb755d
BLAKE2b-256 768431112a230340f70c68cc51b64bb7bd77e7e7cb323e0c62ee35e17ca35fc0

See more details on using hashes here.

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

Hashes for DMeta-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd5e9efade266718fac9a7baddd6b3e4b19fa45d7849f4536f23e8fcf2d9f6be
MD5 dd19401520af077763e2cb06c0b5d51d
BLAKE2b-256 27fab37ee3f36a5fd8042500b9866b78c8ed47289b56cb39ffd72f909f0ceace

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page