Python 如何在Github API的搜索查询中使用或

Python 如何在Github API的搜索查询中使用或,python,github-api,Python,Github Api,我正在Github中搜索repos中的文件,使用GithubAPI 我知道如何使用,在我的搜索查询中,它是这样的:q=term1+term2+term3,但它的作用是搜索文件中的所有单词。在这里,所有术语都必须在文件中,才能将其包括在搜索中 但是如果我想看看是否有任何单词在那里呢 我试过这样做:q=term1或term2或term3,但这不起作用。我还尝试在字符串中使用Python或,但这当然也不起作用 def find_phrases(urls): # Search terms to

我正在Github中搜索repos中的文件,使用GithubAPI

我知道如何使用,在我的搜索查询中,它是这样的:
q=term1+term2+term3
,但它的作用是搜索文件中的所有单词。在这里,所有术语都必须在文件中,才能将其包括在搜索中

但是如果我想看看是否有任何单词在那里呢

我试过这样做:
q=term1或term2或term3
,但这不起作用。我还尝试在字符串中使用Python
,但这当然也不起作用

def find_phrases(urls):
    # Search terms to search files in all repos
    terms1 = 'seven day'or'seven days'or'7-day'or'7-days'or'7 day'or'7 days'
    terms2 = 'free trial OR trial key OR trial keys OR try OR try experience OR trial experience'
    terms3 = 'trial subscription OR http:\/\/azure.microsoft.com\/try\/cognitive-services OR https:\/\/azure.microsoft.com\/try\/cognitive-services'

    directory = urls[0].replace('https://github.com/', 'repo:')

    query = f'{terms1}+in:file+{directory}'
    response = requests.get(f'https://api.github.com/search/code?q={query}')
这些是我在Github API文档中使用的一些文档,但我没有找到任何关于如何使用或修改的内容