-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
513ea43
commit 7b101ce
Showing
4 changed files
with
78 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
"""Entrypoint for random neo4j tasks/tests.""" | ||
import asyncio | ||
from pprint import pprint | ||
|
||
from articlesa.neo import Neo4JDriver | ||
from articlesa.neo import Neo4JArticleDriver | ||
|
||
article_urls = [ | ||
"https://apnews.com/article/washington-virginia-maryland-loud-boom-crash-military-jet-biden-joint-base-andrews-7116356c23f2ade0d6c842159e261f1b", | ||
"https://www.thegatewaypundit.com/2019/11/revealed-adam-schiff-connected-to-both-companies-named-in-7-4-billion-burisma-us-ukraine-corruption-case/", | ||
] | ||
|
||
async def main(): | ||
query = '''\ | ||
CREATE (article:FakeArticle { | ||
title: "Your Article Title", | ||
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", | ||
published_date: "2023-07-25" | ||
}) | ||
''' | ||
async with Neo4JDriver() as driver: | ||
response = await driver._driver.execute_query(query) | ||
pprint(response.summary.__dict__) | ||
|
||
async def main() -> None: # noqa: D103 | ||
from articlesa.worker.parse import parse_article, ParsedArticle | ||
async with Neo4JArticleDriver() as driver: | ||
article = ParsedArticle.parse_obj(await parse_article(article_urls[0])) | ||
await driver.put_article(article) | ||
response = await driver.get_stats() | ||
pprint(response.summary.__dict__) # noqa: T203 | ||
|
||
|
||
asyncio.run(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters