scrapy / itemadapter

Common interface for data container classes
BSD 3-Clause "New" or "Revised" License
61 stars 13 forks source link

ItemAdapter.get_field_names_from_class #64

Closed kmike closed 2 years ago

kmike commented 2 years ago

hey! This PR adds a new ItemAdapter classmethod: get_field_names_from_class - similar to get_field_names, but accepts item class, not an item itself. It's motivated by https://github.com/scrapinghub/web-poet/pull/53#discussion_r934313210.

codecov[bot] commented 2 years ago

Codecov Report

Merging #64 (074d9e7) into master (927ee25) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #64   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          291       318   +27     
=========================================
+ Hits           291       318   +27     
Impacted Files Coverage Δ
itemadapter/adapter.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

kmike commented 2 years ago

Thanks for merging it @elacuesta! Yes, a release would be perfect; I don't have anything else in mind.

elacuesta commented 2 years ago

Released https://github.com/scrapy/itemadapter/releases/tag/v0.7.0

kmike commented 2 years ago

Awesome, thanks @elacuesta!