This guide gives a quick overview of how to set up and start using GroupDocs.Metadata for Python via .NET. The library lets you read, edit, and remove metadata from documents, images, audio, and video with minimal configuration.
Optionally, a Temporary License to test all product features (saving files requires a license).
Set Up Your Development Environment
For best practices, use a virtual environment to manage dependencies.
Create and Activate a Virtual Environment
Create a virtual environment:
py-mvenv.venv
python3 -m venv .venv
python3 -m venv .venv
Activate it:
.venv\Scripts\activate
source .venv/bin/activate
source .venv/bin/activate
Install the groupdocs-metadata-net package
py-mpipinstallgroupdocs-metadata-net
python3 -m pip install groupdocs-metadata-net
python3 -m pip install groupdocs-metadata-net
Example 1: Read metadata
Open a file and print all detected metadata properties.
importosfromgroupdocs.metadataimportLicense,Metadatadefread_metadata():# Apply a license if one is present next to the scriptlicense_path=os.path.abspath("./GroupDocs.Metadata.lic")ifos.path.exists(license_path):License().set_license(license_path)withMetadata("./input.docx")asmetadata:# `lambda p: True` matches every property in the fileforpropinmetadata.find_properties(lambdap:True):print(f"{prop.name} = {prop.value}")if__name__=="__main__":read_metadata()
input.docx is the sample file used in this example. Click here to download it.