= JpsCuration() gallery
Japan Search Gallery client
JpsCuration
JpsCuration (curationType='GALLERY', version=1, rightsType='ccby')
Initialize self. See help(type(self)) for accurate signature.
JpsCurationText
JpsCurationText ()
Text
JpsCurationTimepoint
JpsCurationTimepoint (name_ja, name_en, start, end, startFraction=0, endFraction=0, labelHeight=1)
Timepoint
JpsCurationTimeline
JpsCurationTimeline (start, end, layout='bar')
Timeline
JpsCurationListExternalLink
JpsCurationListExternalLink ()
ListExternalLink
Part
Part (type, viewType=None)
Initialize self. See help(type(self)) for accurate signature.
Type | Default | Details | |
---|---|---|---|
type | |||
viewType | NoneType | None | , viewType |
JpsCurationIIIFImage
JpsCurationIIIFImage (manifestUrl, infoJsonUrl, title, source, xywh=None)
Initialize self. See help(type(self)) for accurate signature.
Media
Media (type, title, source)
Initialize self. See help(type(self)) for accurate signature.
Component
Component ()
Initialize self. See help(type(self)) for accurate signature.
First import the JPSGalleryClient class.
from jps_gallery_tools.api import JPSGalleryClient
To initialise the JPSGalleryClient you need to provide the base url of your Omeka instance’s API.
ギャラリーのメタデータの設定
ギャラリーのメタデータを設定します。
Component.setLangMetadata
Component.setLangMetadata (key, lang, value)
メタデータの設定
Parameters:
* key
- title, description, etc…
* lang
- one of 言語, eg: ‘ja’, ‘en’, ‘yomi’
* value
- 値
タイトルの設定
"title", "ja", "日本語タイトル")
gallery.setLangMetadata("title", "en", "English Title")
gallery.setLangMetadata("title", "yomi", "にほんごのよみ") gallery.setLangMetadata(
summaryの設定
"summary", "ja", "日本語の概要文")
gallery.setLangMetadata("summary", "en", "English Summary") gallery.setLangMetadata(
responsibilityの設定
"responsibility", "ja", "中村覚")
gallery.setLangMetadata("responsibility", "en", "Satoru Nakamura") gallery.setLangMetadata(
tagの設定
JpsCuration.addTag
JpsCuration.addTag (tag)
タグを追加します。
Parameters:
* tag
- タグ
"はじめてのタグ")
gallery.addTag("二つ目のタグ") gallery.addTag(
画像の設定
JpsCurationUrlImage
JpsCurationUrlImage (url, title, source, thumbnailUrl=None)
URLを指定して表示する画像に関するクラス
= "https://blogger.googleusercontent.com/img/a/AVvXsEiTjjaWkCHeCslxeKujaQotjuR_HvhOHen7Ql7rQV8nmQl4ivLRF_CSabMY-JLJHNL-xHMe3VDyA9F-iv1RtQ2jFTk1Vnjck-veKLUZPdYqCcjzHkc8SGKb1fyZ_x8W66aTrSXQ78UN3CnyBakwwmmH_hmPKeEsTzq8J3e2zzUMylmDjCZ0LClPByBRRw=s400"
original_url = "https://blogger.googleusercontent.com/img/a/AVvXsEiTjjaWkCHeCslxeKujaQotjuR_HvhOHen7Ql7rQV8nmQl4ivLRF_CSabMY-JLJHNL-xHMe3VDyA9F-iv1RtQ2jFTk1Vnjck-veKLUZPdYqCcjzHkc8SGKb1fyZ_x8W66aTrSXQ78UN3CnyBakwwmmH_hmPKeEsTzq8J3e2zzUMylmDjCZ0LClPByBRRw=s180-c"
thumbnail_url = "初日の出のキャラクター"
title = "いらすとや"
source = JpsCurationUrlImage(original_url, title, source, thumbnail_url) top_image
Part.setImage
Part.setImage (image)
gallery.setImage(top_image)
パーツの追加
JpsCurationList
JpsCurationList (viewType)
リストパーツ
= JpsCurationList("tile") part
メタデータの追加
"title", "ja", "リストのタイトル")
part.setLangMetadata("title", "en", "List Title") part.setLangMetadata(
リストに画像の追加
= JpsCurationListExternalLink() item
Part.setUrl
Part.setUrl (url)
外部リンクのURLを設定します。
Parameters:
* url
- 外部リンクのURL
"https://www.irasutoya.com/2021/11/blog-post_91.html") item.setUrl(
アイテムの追加
Component.addPart
Component.addPart (part)
パーツの追加
Parameters: * part
- パーツ
part.addPart(item)
Save json
設定した内容をjsonファイルに出力します。
JpsCuration.save
JpsCuration.save (path)
JSONファイルの保存
Parameters:
* path
- 出力先のパス
"tmp/gallery.json") gallery.save(
JpsCuration.saveJsonl
JpsCuration.saveJsonl (path)
JSONLファイルの保存
Parameters:
* path
- 出力先のパス
"tmp/gallery.jsonl") gallery.saveJsonl(
JpsCuration.encode
JpsCuration.encode (curationType='NOTE')
Base64エンコード
Returns:
* str containing Base64 encoded representation of the gallery