writing data

This commit is contained in:
saret committed 2023-04-12 01:00:18 +03:00
1 parent e25ad40379
commit e31ca85485
3 files changed
+2624 -6

No files matched your search

+1
View File
@@ -0,0 +1 @@
[{"id_text": "X102611", "project_name": "adsd/adart1", "raw_text": "Month II, (the 1st of which was identical with) the 30th (of the preceding month), [sunset to moonset:] 12\u00b0 [...] Night of the 8th, first part of the night, Mercury was [... above \u03b7 Geminorum ...] Night of the 11th, beginning of the night, the moon was [...] in front of [\u03b1 Virginis ...] The 14th, moonset to sunrise: 8\u00b0 50'. Night of the 1[5th, ...] The 16th, Sirius\u2019 last appearance. Night of the 17th, ... [...] 1 2/3 cubits [...] Capricorni [...] That [month,] the equivalent (for 1 shekel of silver was): ba[rley, ...] [...] ... [...] [...] ... on the ... [... Mars was ...] in the middle of the month, in Cancer. Th[at month, ...] That month, Paini ... [...] Month VI, (the 1st of which was identical with) the 30th (of the preceding month, sunset to moonset:) 9\u00b0 30'; mist, when I watched [I did not see the moon ... Night of the 5th, beginning of the night, the moon was] 1 cubit 4 fingers behind \u03b1 Scorpii. Night of the 6th, [...] Night of the 9th, beginning of the night, the moon was [... behind \u03b2 Capricorni ...] The 12th, moonset to sunrise: 11\u00b0. The 13th, 2\u00b0 [... Night of the 15th, last part of the night, the moon was] [...] below \u03b1 Arietis [...] last part of the night,, the moon was [...] in front of [...] [... year 5]0, Antiochus, the great king [...]"}, {"id_text": "X102612", "project_name": "adsd/adart1", "raw_text": "[...] from within it were killed ... [...] [... of? S]eleucus seized the fields in Babylonia, they surrounded and [...] ... [...] [...] the guard which they had put on this fortress [...] [...] (holes) [Month IX, the 1st (of which followed the 30th of the preceding month), ... Ni]ght of the 3rd, the moon was 1 cubit behind \u03b4 Capricorni. Night of the 7th, beginning of the night, the moon was 2 cubits in front of \u03b7 Piscium. Night of the 8th, beginning of the night, the moon was [...] below \u03b2 Arietis. [... Night of the 10th, beginning of the night, the moon was] 8 fingers [...] \u03b7 Tauri. Night of the 11th, beginning of the night, the moon was 5 cubits above \u03b1 Tauri. Night of the 12th, beginning of the ni[ght, the moon was] 6 fingers [...] \u03b2 Tauri. The 12th, moonset to sunrise: 7\u00b0. Night of the 13th, moonrise to sunset: 9\u00b0 [...] [... The 13th, sunrise] to moonset: [nn] (expected); clouds, I did not watch. Night of the 14th, sunset to moonrise: 3\u00b0 20'; measured (despite) clouds; last part of the night, the moon was 1 2/3 cubits below \u03b2 Geminorum. Ni[ght of the 15th, last part of the] night, the moon was 1 1/2 cubits in front of \u03b4 Cancri. Night of the 16th, last part of the night, the moon was [... below \u03b5 Leonis, the moon] being [nn] fingers back to the west. Night of the 18th, last part of the night, the moon was 1 1/2 cubits in front of \u03d1 Leonis, 1 1/2 cubits below Saturn, the moon being 1/2 cubit back to the west. Around the 18th, when Saturn became stationary to the east, [it became stationary] 1/2 cubit in front of [... Night of the 19th, last part of the night, the moon was 1] cubit 8 fingers [in front of \u03b2 Virginis,] it stood 1 cubit in front of Mars to the west. Night of the 20th, last part of the night, the moon was 1 1/2 cubits in front of \u03b3 Virginis. The 20th, Mercury\u2019s first appearance in the west in Capricorn; it was bright and high, sunset to setting of Mercury: 15\u00b0, (ideal) first appearance on the 19th or 18th. [... The 2]2nd, Venus\u2019 first appearance in the west in Capricorn; sunset to setting of Venus: 10\u00b0, (ideal) first appearance on the 20th. Night of the 23rd, last part of the night, the moon was [nn] cubits below \u03b1 Librae, it stood 2 1/2 cubits behind Jupiter to the east; around [...] [... Night] of the 25th, last part of the night, the moon was 1 cubit 8 fingers behind \u03b1 Scorpii. Night of the 26th, last part of the night, the moon was [...] behind \u03d1 Ophiuchi [...] visible [... The 2]8th, solar eclipse [...] [... d]ates, 4 p\u0101nu 1 s\u016btu; mustard, 1 kur 2 p\u0101nu 3 s\u016btu; cress, 5 s\u016btu 3 qa; sesame, 1 p\u0101nu 1 s\u016btu; wool, [...] ... [...] [... the 20th, Mercury\u2019s] first appearance [in the west in Capri]corn; Saturn was in Leo; Ma[rs ...] [...] ... [...] [...] sunset to moonrise: [x]+2\u00b0 30' [...] [...] clouds crossed the sky [...] [...] 9\u00b0 ... [...] [... around the 23rd, when Mars became stationary to the west, it became stationary ... behind \u03c1 Le]onis, 1 cubit behind Sa[turn ...] [...] Mars was above ... [...] [... min]as. At that time, Jupi[ter ...] [...] ... [...] [...] ... [...] (holes)"}, {"id_text": "X102613", "project_name": "adsd/adart1", "raw_text": "[...] last part of the night, Jupiter was 2 fingers above Venus [... Ni]ght of the 2nd, the moon was 1/2 cubit in front of \u03b1 Scorpii [...] [...] ... The 3rd, [equinox? ... Ni]ght of the 6th, beginning of the night, the moon was 2 1/2 cubits Line truncated
+17 -6
View File
@@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
@@ -18,12 +18,18 @@
"import scrapping\n",
"import psycopg2\n",
"from psycopg2.extras import execute_batch\n",
"# from psycopg2.extensions import register_adapter"
"import re\n",
"import logging\n",
"import datetime\n",
"logging.basicConfig(\n",
" level=logging.INFO, filename=f'{datetime.datetime.now().strftime(\"%Y-%m-%d_%H-%M-%S\")}.log', filemode='w',\n",
" format='%(name)s - %(levelname)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')\n",
"# from psycopg2.extensions import register_adapter\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
@@ -32,9 +38,14 @@
"with open('project_list') as f:\n",
" for project in f.read().split('\\n'):\n",
" scrap = scrapping.get_raw_english_texts_of_project(project)\n",
" connection = connection.execute(\"insert into raw_texts values (%(id_text)s, %(project_name)s, %(raw_text)s)\", scrap)\n",
" execute_batch(connection, \"insert into raw_texts values (%(id_text)s, %(project_name)s, %(raw_text)s)\", scrap)\n",
" conn.commit()"
" # connection = connection.execute(\"insert into raw_texts values (%(id_text)s, %(project_name)s, %(raw_text)s)\", scrap)\n",
" try:\n",
" execute_batch(connection, \"insert into raw_texts values (%(id_text)s, %(project_name)s, %(raw_text)s)\", scrap)\n",
" conn.commit()\n",
" except Exception:\n",
" with open(project, 'w') as f:\n",
" f.write(json.dumps(scrap))\n",
" logging.error(f\"Error in {project}:{Exception}\")"
]
},
{
+2606
View File
File diff suppressed because it is too large. Load diff