Skip to main content

GroupDocs.Metadata for Python via .NET is a robust document API that supports over 170 file types and enables developers to easily render files to various formats, such as PDF, HTML, JPG, or PNG. With this API, you can seamlessly render a wide range of file types, including popular OpenDocument and Microsoft Office formats like DOCS, XLSX, and PPTX, as well as specialized CAD and graphic editor files like DWG, DXF, PSD, AI, and CDR.

Project description

File Metadata Python API

banner

Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License

GroupDocs.Metadata for Python via .NET is a powerful on-premise class library for read, edit, remove, retrieve, search, compare, replace and export metadata information of all popular documents & image file formats.

Without having to install any 3rd party component, you can use GroupDocs.Metadata to build different types applications. For example, GroupDocs, using its own APIs, developed a free web application that allows people to view their metadata PDF documents online.

Metadata API Features

GroupDocs.Metadata for Python via .NET provides a single API to read, edit, search and clean metadata across many file types:

Supported File Formats

With GroupDocs.Metadata for Python via .NET, developers can view and manage metadata in a wide range of document, image, media, and archive formats:

  • Microsoft Word: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT
  • Microsoft Excel: XLS, XLSX, XLSM, XLSB, XLTM, XLT, XLTX, XLAM, SXC, SpreadsheetML
  • Microsoft PowerPoint: PPT, PPTX, PPTM, PPS, PPSX, PPSM, POT, POTX, POTM
  • Microsoft Visio: VSD, VSDX, VSDM, VDX, VDW, VSS, VSSX, VSSM, VSX, VST, VSTX, VSTM, VTX
  • Microsoft Project: MPP
  • Microsoft Outlook: MSG, EML, EMLX, PST, OST
  • Microsoft OneNote: ONE
  • OpenDocument Formats: ODT (text), ODS (spreadsheets)
  • Portable Documents: PDF
  • Adobe Photoshop: PSD
  • AutoCAD Drawings: DWG, DXF
  • Images: JPG, JPEG, JPE, JP2, PNG, GIF, TIFF, WebP, BMP, DJVU, DJV, DICOM, CR2
  • Metafiles: EMF, WMF
  • Fonts: OTF, OTC, TTF, TTC
  • Audio: MP3, WAV
  • Video: AVI, MOV, QT, FLV, MKV
  • Matroska Media Containers: MKV, MKA, MK3D, WEBM
  • vCard Files: VCF, VCR
  • eBooks and Others: EPUB, TORRENT, ASF
  • 3D Models: 3DS, FBX, STL, DAE
  • Archives: ZIP, 7Z, RAR, TAR

See detailed list of file formats.

Platform Independence

GroupDocs.Metadata for Python via .NET can be used to develop 32-bit and 64-bit applications for different operating systems (such as Windows, Linux and macOS) where Python 3.5 or later is installed.

Get Started

Ready to try GroupDocs.Metadata for Python via .NET?

Fetch the package and install GroupDocs.Metadata. Run this command: pip install groupdocs.metadata

If you already have GroupDocs.Metadata installed and want to get the latest version, you have to run pip install --upgrade groupdocs.metadata instead.

Check out GroupDocs.Metadata for Python for .NET documentation.

Or

Download Package from Official Website

To download the GroupDocs.Metadata package for your operating system, please visit the official GroupDocs Releases website. Currently, four OS-specific packages are available:

  • Windows 64-bit: Package name ends with amd64.whl
  • Windows 32-bit: Package name ends with win32.whl
  • Linux 64-bit: Package name ends with linux1_x86_64.whl
  • macOS Intel Silicon: Package name ends with macosx_10_14_x86_64.whl

Choose the appropriate package based on your system's architecture.

Quickly Fetching Metadata Properties

import groupdocs.metadata as gm
import groupdocs.metadata.options as gvo

# Instantiate a Metadata object and load a JPEG file
with gm.Metadata("input.jpeg") as metadata:
    root = metadata.GetRootPackage()
    root.RemoveImageResourcePackage()
    metadata.Save("output.jpeg")

Find metadata properties

Use tags to find most common metadata properties.

# Fetch all the properties satisfying the predicate:
    # property contains the name of the last document editor OR the date/time the document was last modified
with gm.Metadata(constants.input_pptx) as metadata:
        specification = gm.search.ContainsTagSpecification(gm.tagging.Tags.person.editor).either(gm.search.ContainsTagSpecification(gm.tagging.Tags.time.modified))
        properties = metadata.find_properties(specification)
        for property in properties:
             print(f"Property name: {property.name}, Property value: {property.value}")

Remove metadata properties

The easiest way to remove metadata properties from a file is to use corresponding tags that allow you to locate the desired properties across all metadata packages. But sometimes it’s necessary to remove metadata entries having a particular value.

const metadata = new groupdocs.metadata.Metadata("input.docx");

    # Remove all the properties satisfying the predicate:
    # property contains the name of the document author OR
    # it refers to the last editor OR
    # the property value is a string that is equal to the given string "John" (to remove any mentions of John from the detected metadata)
   with gm.Metadata(constants.input_docx) as metadata:
        specification = gm.search.ContainsTagSpecification(gm.tagging.Tags.person.creator).either(gm.search.ContainsTagSpecification(gm.tagging.Tags.person.editor)).either(gm.search.OfTypeSpecification(gm.common.MetadataPropertyType.STRING).both(gm.search.WithValueSpecification("John")))
        affected = metadata.remove_properties(specification)
        print(f"Properties removed: {affected}")
        metadata.save(constants.output_docx)

Extracting metadata

The code sample below demonstrates some advanced usage of tags, categories and other attributes of metadata properties.

def run():
    files = os.listdir(constants.input_path)
    for file in files:
        with gm.Metadata(constants.input_path+file) as metadata:
            if metadata.file_format != gm.common.FileFormat.UNKNOWN and metadata.get_document_info().is_encrypted != True:
                print()
                print(file)

                specification = gm.search.FallsIntoCategorySpecification(gm.tagging.Tags.content)
                properties = metadata.find_properties(specification)
                for property in properties:
                    print(f"Property name: {property.name}, Property value: {property.value}")

Adding metadata

Adding metadata properties is the most sophisticated feature of the GroupDocs.Metadata search engine. When you call the addProperties method it examines all available metadata packages and tries to pick up a known property that would satisfy the specified predicate.

def run():
    files = os.listdir(constants.input_path)
    for file in files:
        with gm.Metadata(constants.input_path+file) as metadata:
            if metadata.file_format != gm.common.FileFormat.UNKNOWN and metadata.get_document_info().is_encrypted != True:
                print()
                print(file)
        
        # Add a property containing the file last printing date if it's missing
                # Note that the property will be added to metadata packages that satisfy the following criteria:
                # 1) Only existing metadata packages will be affected. No new packages are added during this operation
                # 2) There should be a known metadata property in the package structure that fits the search condition but is actually missing in the package.
                # All properties supported by a certain package are usually defined in the specification of a particular metadata standard
        
                specification = gm.search.ContainsTagSpecification(gm.tagging.Tags.time.printed)
                now = datetime.now()
                property_value = gm.common.PropertyValue(now)
                affected = metadata.add_properties(specification, property_value)
                print(f"Affected properties: {affected}");
                filename, file_extension = os.path.splitext(file)
                metadata.save(constants.output_path + "output" + file_extension)

GroupDocs.Metadata for Python requires you to use python programming language. For Node.js, Java and .NET languages, we recommend you get GroupDocs.Metadata for Node.js, GroupDocs.Metadata for Java and GroupDocs.Metadata for .NET, respectively.

Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

groupdocs_metadata_net-25.10-py3-none-win_amd64.whl (174.3 MB view details)

Uploaded Python 3Windows x86-64

groupdocs_metadata_net-25.10-py3-none-win32.whl (167.4 MB view details)

Uploaded Python 3Windows x86

groupdocs_metadata_net-25.10-py3-none-macosx_11_0_arm64.whl (173.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

groupdocs_metadata_net-25.10-py3-none-macosx_10_14_x86_64.whl (183.2 MB view details)

Uploaded Python 3macOS 10.14+ x86-64

File details

Details for the file groupdocs_metadata_net-25.10-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for groupdocs_metadata_net-25.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4c1d1aeb71c8cbcce6bd8e57b3ab6a1a159898fdeed390c05c6fb30b1220bdac
MD5 77e739c3f691c4e8f6b1168059f03163
BLAKE2b-256 469e4fe5955c03d4aa4d8ce9ff125d23833074c324757614a01503cbb460f32b

See more details on using hashes here.

File details

Details for the file groupdocs_metadata_net-25.10-py3-none-win32.whl.

File metadata

File hashes

Hashes for groupdocs_metadata_net-25.10-py3-none-win32.whl
Algorithm Hash digest
SHA256 e3ae5675212890c0077cabbee6591c809b48918abf4a2f0974e9bcbb7be5b07e
MD5 72ce4e1e95f66f9dfd5a8f1c248cfbd5
BLAKE2b-256 280ce64db02ae3e37c19da22f61d8a87a42a125aa9873d34f5687be8cb34063d

See more details on using hashes here.

File details

Details for the file groupdocs_metadata_net-25.10-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for groupdocs_metadata_net-25.10-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a0a928efc195930f591fa29a6232fda2a0e0ef49d1a71577f6d8cb23c646881
MD5 3c20493192922c7787fedfa5f7aadf78
BLAKE2b-256 746dc8befb47f48fe523deb7dbdfac4961a14f4a675d179f1cb79bce50d2a7a7

See more details on using hashes here.

File details

Details for the file groupdocs_metadata_net-25.10-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for groupdocs_metadata_net-25.10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e440ab28e57821173ea4680c627c97275a6158420a41aa35be1f8c44f636fde
MD5 cc08e724f2a2c6ed39111757064289be
BLAKE2b-256 950b9d0d1a629cd7800845e10ddbbd8bd44b582fc6b06baa5cfd4c22e463e419

See more details on using hashes here.

File details

Details for the file groupdocs_metadata_net-25.10-py3-none-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for groupdocs_metadata_net-25.10-py3-none-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 478c5f95d6a6043180ebefc3aeca4b2a9485d996f0d1132d8dff7b9963edfa20
MD5 79488eeae28b19be58129158f89096ea
BLAKE2b-256 0c6054b22a5bd4527cce739324b966dd3e75370380b992f83109c928a591fc78

See more details on using hashes here.

Supported by

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