MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_copyrights

Function get_copyrights

src/scancode/api.py:48–79  ·  view source on GitHub ↗

Return a mapping with a single 'copyrights' key with a value that is a list of mappings for copyright detected in the file at `location`.

(
    location,
    deadline=sys.maxsize,
    **kwargs,
)

Source from the content-addressed store, hash-verified

46
47
48def get_copyrights(
49 location,
50 deadline=sys.maxsize,
51 **kwargs,
52):
53 """
54 Return a mapping with a single 'copyrights' key with a value that is a list
55 of mappings for copyright detected in the file at `location`.
56 """
57 from cluecode.copyrights import detect_copyrights
58 from cluecode.copyrights import Detection
59
60 detections = detect_copyrights(
61 location,
62 include_copyrights=True,
63 include_holders=True,
64 include_authors=True,
65 include_copyright_years=True,
66 include_copyright_allrights=False,
67 deadline=deadline,
68 )
69
70 copyrights, holders, authors = Detection.split(detections, to_dict=True)
71
72 results = dict([
73 ('copyrights', copyrights),
74 ('holders', holders),
75 ('authors', authors),
76 ])
77
78 # TODO: do something if we missed the deadline
79 return results
80
81
82def get_emails(

Callers

nothing calls this directly

Calls 2

detect_copyrightsFunction · 0.90
splitMethod · 0.45

Tested by

no test coverage detected