Skip to content
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

Update the examples in README.md to reflect current behaviour #93

Merged
merged 3 commits into from
Nov 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ python setup.py install

## Basic Usage
You can now import the library or individual classes from within Python and start creating your IIIF Presentation 3 objects:
```
>>> import iiif_prezi3
>>> iiif_prezi3.__version__
'0.0.2.1'
```

### Directly creating a Manifest
```
>>> from iiif_prezi3 import Manifest
>>> m = Manifest(id="https://example.com/iiif/manifest.json", type="Manifest", label={"en":["Example Manifest"]})
>>> print(m.json(exclude_unset=True, indent=2))
>>> print(m.json(indent=2))
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://example.com/iiif/manifest.json",
"type": "Manifest",
"label": {}
"label": {
"en": [
"Example Manifest"
]
}
}
```
### Importing an existing IIIF Manifest
Expand All @@ -54,11 +54,16 @@ If you have an existing IIIF Presentation v3 Manifest, you can load it via the b
>>> import json
>>> manifest_json = json.load(open("example.json"))
>>> m = Manifest(**manifest_json)
>>> print(m.json(exclude_unset=True, indent=2))
>>> print(m.json(indent=2))
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0003-mvm-video/manifest.json",
"type": "Manifest",
"label": {},
"label": {
"en": [
"Video Example 3"
]
},
"items": [
{
"id": "https://iiif.io/api/cookbook/recipe/0003-mvm-video/canvas",
Expand Down