-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should have a script that scrapes the bagnowka images and writes them as photos/photoUnits to BH dbs #132
Comments
@OriHoch I'll work on the script to convert scraping output into DBS-API structure. |
@OriHoch [
{
"NegativeNumbers": "",
"IsLandscape": "",
"PrevPictureUnitsId": "",
"ExhibitionIsPreview": "",
"LocationInMuseum": "",
"Pictures": [
{
"IsLandscape": "",
"ForDisplay": "1",
"ToScan": "0",
"IsPreview": "0",
"PictureTypeDesc": {
"En": "Picture",
"He": "תצלום"
},
"PicId": "",
"PictureId": "95eb0e2ccf2a62ad46939994718ba150",
"LocationCode": ""
},
{
"PictureTypeDesc": {}
}
],
"ToScan": "||",
"PeriodDateTypeDesc": {
"En": "Year|",
"He": "שנים|"
},
"related": [
"palce_Latvia"
],
"ExhibitionId": "",
"UpdateDate": "",
"OldPictureNumbers": "|||",
"OldUnitId": "",
"id": "",
"UpdateUser": "BH Online",
"PictureLocations": "",
"UnitDisplayStatus": 3,
"main_image_url": "full/58d8b7015e3883d243d4dd46e85fd6f74d575c41.jpg",
"UnitPeriod": [
{
"PeriodDateTypeDesc": {
"En": "Year",
"He": "שנים"
},
"PeriodEndDate": "",
"PeriodNum": "0",
"PeriodTypeDesc": {
"En": "Period",
"He": "תקופת"
},
"PeriodDesc": {
"En": "1930",
"He": "1930"
},
"PeriodStartDate": "",
"PeriodTypeCode": "",
"PeriodDateTypeCode": ""
},
{
"PeriodTypeDesc": {}
}
],
"PrevPicturePaths": "",
"TS": "",
"PrevPictureId": "",
"PictureSources": "",
"UnitPersonalities": [
{
"OrderBy": "1"
}
],
"UnitTypeDesc": "Photo",
"PeriodStartDate": "",
"Slug": {
"En": "",
"He": ""
},
"PeriodDateTypeCode": "1|",
"RightsDesc": "Full",
"OrderBy": "1|",
"Bibiliography": {
"En": "null",
"He": ""
},
"UnitText1": {
"En": "Today: Latvia, Pre 1914 Russia, pre 1795 Poland.\nCourtesy of www.bagnowka.pl ",
"He": ""
},
"UnitText2": {
"En": "",
"He": ""
},
"UnitPlaces": [
{
"PlaceIds": ""
}
],
"PictureFileNames": "",
"UnitStatus": 3,
"PersonalityIds": "",
"PeriodNum": "0|",
"PeriodDesc": {
"En": "1930",
"He": "1930"
},
"UnitType": 1,
"UnitHeaderDMSoundex": {
"En": "",
"He": ""
},
"PrevPictureFileNames": "",
"RightsCode": 1,
"PeriodTypeCode": "",
"UnitId": "",
"PicId": "",
"IsValueUnit": "true",
"StatusDesc": "Completed",
"PreviewPics": [
{
"PrevPictureId": ""
}
],
"PicturePaths": "",
"Attachments": [],
"UserLexicon": "",
"EditorRemarks": "",
"Exhibitions": [],
"ForDisplay": "|||",
"DisplayStatusDesc": "Museum and Internet",
"PeriodEndDate": "",
"PictureTypeCodes": "",
"PictureTypeDesc": {
"En": "Picture|None|Picture|",
"He": "תצלום - ש/ל|לא מוגדר|תצלום - ש/ל|"
},
"PIctureReceivedIds": "",
"Header": {
"En": "Auce, [None]. 1930"
},
"PeriodTypeDesc": {
"En": "Period|",
"He": "תקופת צילום|"
},
"thumbnail_url": "thumbs/small/95eb0e2ccf2a62ad46939994718ba150",
"ForPreview": "false",
"Resolutions": "1",
"_id": "",
"LocationCode": ""
}
] |
@OriHoch |
@Libisch
|
import json
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client['bhdata']
photoUnits = db['photoUnits']
file = open("bagnowka_all.json", "r")
data = json.load(file)
count = 0
for slug in data:
data[slug]["Header"]["He"] = "null"
photoUnits.insert_one(data[slug])
count += 1
print("1 item was added to photoUnits")
print("{} items were inserted to photoUnits.".format(count)) I guess there's a better way to do this, please let me know how it should be handled and I'll do it as soon as I return. |
deployment plan
|
preconditions
reproduction steps
expecected
actual
related issues
The text was updated successfully, but these errors were encountered: