Spaces:
Sleeping
Sleeping
Create citations.py
Browse files- citations.py +11 -0
citations.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datetime import datetime
|
| 2 |
+
|
| 3 |
+
def cite(result: dict) -> str:
|
| 4 |
+
accessed = datetime.utcnow().strftime("%Y-%m-%d")
|
| 5 |
+
return (
|
| 6 |
+
f"> **Source:** {result['source']}\n"
|
| 7 |
+
f"> **Title:** {result['title']}\n"
|
| 8 |
+
f"> **URL:** {result['url']}\n"
|
| 9 |
+
f"> **Accessed:** {accessed}\n"
|
| 10 |
+
f"> **Mode:** {'Extended' if result.get('extended') else 'Standard'}"
|
| 11 |
+
)
|