Skip to content

ENH: Enhance XMP metadata handling with creation and setter methods #3410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Arya-A-Nair
Copy link
Contributor

Closes #3394

@Arya-A-Nair Arya-A-Nair force-pushed the feature/xmp-create-method branch from 9183c12 to 7129e69 Compare July 30, 2025 10:26
- Fix missing Dict and List imports in typing
- All XMP setter methods are now working correctly
- All tests pass except one unrelated remote file test
- XmpInformation.create() and all setter methods fully functional
- Code follows existing codebase patterns and style
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 99.64912% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.03%. Comparing base (b622a2f) to head (2247b45).

Files with missing lines Patch % Lines
pypdf/xmp.py 99.64% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3410      +/-   ##
==========================================
+ Coverage   96.97%   97.03%   +0.06%     
==========================================
  Files          54       54              
  Lines        9324     9557     +233     
  Branches     1708     1738      +30     
==========================================
+ Hits         9042     9274     +232     
  Misses        168      168              
- Partials      114      115       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add tests for ownerDocument None error conditions (lines 459-465, 484, 506, 535, 564, 597)
- Add tests for description element creation paths
- Add tests for attribute handling and edge cases
- Improve test coverage from 95% to 97%
- All XMP functionality thoroughly tested with error conditions and edge cases
@stefan6419846
Copy link
Collaborator

Thanks for the PR. Besides the coverage: Could we please have proper properties instead of a read-only property and a setter? This is not really pythonic.

@Arya-A-Nair
Copy link
Contributor Author

@stefan6419846 yeah sure, I understood my mistake. I'll refactor it and ask for review, once done

@Arya-A-Nair Arya-A-Nair marked this pull request as draft July 31, 2025 12:20
@Arya-A-Nair Arya-A-Nair force-pushed the feature/xmp-create-method branch from d66f82b to 1abdf04 Compare July 31, 2025 12:32
@Arya-A-Nair Arya-A-Nair marked this pull request as ready for review July 31, 2025 12:55
@Arya-A-Nair
Copy link
Contributor Author

@stefan6419846 you can take a look at it now

@stefan6419846
Copy link
Collaborator

Sorry for the delays - I did not yet have the time to properly review these larger changes again. I hope that I manage to look into this in the next days.

@Arya-A-Nair
Copy link
Contributor Author

Hey @stefan6419846 can i contribute to some other issue till that time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a way to create XMP metadata from scratch
2 participants