-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from metaodi/develop
Release 0.1.0
- Loading branch information
Showing
22 changed files
with
2,778 additions
and
35 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import sruthi | ||
from pprint import pprint | ||
|
||
# check supported schemas of server | ||
server_url = 'https://suche.staatsarchiv.djiktzh.ch/SRU/' | ||
schema = 'isad' | ||
server = sruthi.explain(server_url) | ||
|
||
|
||
print(20 * '=') | ||
print('=') | ||
print(f"= Record with schema: {schema}") | ||
print('=') | ||
print(20 * '=') | ||
records = sruthi.searchretrieve( | ||
server_url, | ||
query='Zurich', | ||
record_schema=schema | ||
) | ||
pprint(records[0]) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sruthi | ||
from pprint import pprint | ||
|
||
# check supported schemas of server | ||
server = sruthi.explain('http://lx2.loc.gov:210/LCDB?') | ||
|
||
print(f"Supported schemas: {', '.join(server.schema.keys())}") | ||
|
||
|
||
for schema in server.schema.keys(): | ||
print(20 * '=') | ||
print('=') | ||
print(f"= Record with schema: {schema}") | ||
print('=') | ||
print(20 * '=') | ||
records = sruthi.searchretrieve( | ||
'http://lx2.loc.gov:210/LCDB?', | ||
query="human", | ||
record_schema=schema | ||
) | ||
pprint(records[0]) | ||
print('') | ||
print('') |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import sruthi | ||
|
||
records = sruthi.searchretrieve('https://suche.staatsarchiv.djiktzh.ch/SRU/', query='Zurich') | ||
print("SRU version:", records.sru_version) | ||
print("Count:", records.count) | ||
print('') | ||
|
||
for record in records: | ||
# print fields from schema | ||
print(record['reference']) | ||
print(record['title']) | ||
print(record['date']) | ||
print(record['extra']['link']) # extra record data is available at the 'extra' key | ||
print('') |
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,2 +1,4 @@ | ||
requests | ||
defusedxml | ||
xmltodict | ||
flatten-dict |
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
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
Oops, something went wrong.