chore: include local files

This commit is contained in:
0xWheatyz 2025-11-15 22:13:31 -05:00
parent 60a2b82510
commit 8ca435a78a
9 changed files with 36 additions and 0 deletions

0
SPARC/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

7
SPARC/config.py Normal file
View File

@ -0,0 +1,7 @@
# Handle all of the configurations and secrets
from dotenv import load_dotenv
import os
load_dotenv()
api_key = os.getenv("API_KEY")

0
SPARC/patent_api.py Normal file
View File

22
SPARC/serp_api.py Normal file
View File

@ -0,0 +1,22 @@
import serpapi
from SPARC import config
class SERP:
def query(company: str):
# Make API call
params = {
"engine": "google_patents",
"q": company,
"num": 10,
"filter": 1,
"tbs": "cdr:1,cd_min:10/28/2025,cd_max:11/4/2025",
"api_key": config.api_key,
}
search = serpapi.search(params)
# Convert data into a list of publicationID
patent_ids = []
list_of_patents = search["organic_results"]
for patent in list_of_patents:
patent_ids.append(patent["publication_number"])
return patent_ids

5
main.py Normal file
View File

@ -0,0 +1,5 @@
import SPARC.serp_api
a = SPARC.serp_api.SERP.query('nvidia')
print(a)

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
dotenv
serpapi