https://github.com/alisharify7/xmeta
**Xmeta** is a Python package to perform CRUD operations on media metadata across various file types like images, videos, audio, and documents.
https://github.com/alisharify7/xmeta
Last synced: 4 months ago
JSON representation
**Xmeta** is a Python package to perform CRUD operations on media metadata across various file types like images, videos, audio, and documents.
- Host: GitHub
- URL: https://github.com/alisharify7/xmeta
- Owner: alisharify7
- License: gpl-3.0
- Created: 2025-06-29T16:52:44.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T18:07:26.000Z (7 months ago)
- Last Synced: 2025-06-29T18:27:14.478Z (7 months ago)
- Language: Python
- Size: 94.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ซ XMeta

**XMeta** is a powerful and extensible Python package for performing CRUD operations on media metadata.
It supports a wide range of file types including images, videos, audio files, and documents.
---
## โจ Features
- โ
Unified interface to **read**, **update**, and **delete** metadata
- ๐ผ๏ธ Supports **images** (`.jpeg`, `.png`, etc.)
- ๐๏ธ Supports **videos** (`.mp4`, `.mkv`, etc.)
- ๐ง Supports **audio files** (`.mp3`, `.flac`, etc.)
- ๐ Supports **documents** (`.pdf`, `.docx`, etc.)
- ๐ง Automatic file type detection via MIME type and file extension
- ๐ Easily extensible with **custom handlers**
---
## ๐ฆ Installation
> XMeta is not yet published on PyPI. You can install it locally for development:
```bash
pip install xmeta # Coming soon to PyPI
```
---
## ๐ ๏ธ Usage Guide
XMeta offers a simple and consistent interface to interact with media metadata.
---
### โ
1. Initialize the Metadata Manager
Create an instance of `XmetaMetadataManager` by passing the file path:
```python
from xmeta import XmetaMetadataManager
file_meta = XmetaMetadataManager("path/to/your/file")
```
---
### โ
2. Read Metadata
Retrieve and inspect the metadata of the file:
```python
metadata = file_meta.read()
print(metadata)
```
> โน๏ธ Returns a dictionary of key-value pairs representing the file's metadata.
---
### โ
3. Update Metadata
Modify or add metadata by passing a new dictionary:
```python
file_meta.update(new_metadata={
"Author": "Ali Sharify",
"Description": "Sample image"
})
```
> โ ๏ธ This replaces the existing metadata fields with the new values provided.
---
### โ
4. Save the Changes
Write the updated metadata back to a file. You can either overwrite the original or write to a new file:
```python
file_meta.save(output_path="updated_file.jpg") # Saves to a new file
```
If `output_path` is **not** provided, the original file will be **overwritten**.
---
## ๐งช Example
A complete usage example:
```python
from xmeta import XmetaMetadataManager
meta = XmetaMetadataManager("sample.jpg")
# Read existing metadata
print(meta.read())
# Update selected fields
meta.update({
"Title": "Sunset Photo",
"Location": "Caspian Sea"
})
# Save changes to a new file
meta.save("sunset_updated.jpg")
```
---
## ๐ Coming Soon
- ๐งฐ **Command-line interface** (CLI) for quick metadata editing
- ๐ **Plugin system** for extending media type support
- ๐ฅ๏ธ **Web dashboard** for managing metadata visually
---
## ๐จโ๐ป Author
Developed with โค๏ธ by [Ali Sharify](https://github.com/alisharify7)
Proudly maintained by the [Free Developers](https://github.com/free-programmers) organization.
---
## ๐ License
This project is licensed under the GPL-3.0 license License.
## Star History
[](https://starchart.cc/alisharify7/xmeta)