@@ -985,6 +985,28 @@ def repository(self, owner, repository):
985
985
json = self ._json (self ._get (url ),200 )
986
986
return Repository (json ,self )if json else None
987
987
988
+ def search_code (self ,query ,sort = None ,order = None ,per_page = None ,
989
+ text_match = False ,number = - 1 ,etag = None ):
990
+ """Find code via the code search API.
991
+
992
+ The query can contain any combination of the following supported
993
+ qualifiers:
994
+
995
+ - in Qualifies which fields are searched. With this qualifier you can
996
+ restrict the search to just the file contents, the file path, or
997
+ both.
998
+ - language Searches code based on the language it’s written in.
999
+ - fork Specifies that code from forked repositories should be
1000
+ searched. Repository forks will not be searchable unless the fork
1001
+ has more stars than the parent repository.
1002
+ - size Finds files that match a certain size (in bytes).
1003
+ - path Specifies the path that the resulting file must be at.
1004
+ - extension Matches files with a certain extension.
1005
+ - user or repo Limits searches to a specific user or repository.
1006
+
1007
+
1008
+ """
1009
+
988
1010
def search_repositories (self ,query ,sort = None ,order = None ,
989
1011
per_page = None ,text_match = False ,number = - 1 ,
990
1012
etag = None ):