Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313579
metadata_detector.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
736 B
Subscribers
None
metadata_detector.py
View Options
# Copyright (C) 2017 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
swh.indexer.metadata_dictionary
import
MAPPINGS
def
detect_metadata
(
files
):
"""
Detects files potentially containing metadata
Args:
file_entries (list): list of files
Returns:
dict: {mapping_filenames[name]:f['sha1']} (may be empty)
"""
results
=
{}
for
(
mapping_name
,
mapping
)
in
MAPPINGS
.
items
():
matches
=
mapping
.
detect_metadata_files
(
files
)
if
matches
:
results
[
mapping_name
]
=
matches
return
results
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Jul 3, 11:46 AM (5 d, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3237846
Attached To
rDCIDX Metadata indexer
Event Timeline
Log In to Comment