artist-getter


Nameartist-getter JSON
Version 0.4.4 PyPI version JSON
download
home_pagehttps://github.com/fangyizhu/artist-getter
SummaryGetty ULAN and WikiData scraping utilities for artists
upload_time2024-11-15 02:30:25
maintainerNone
docs_urlNone
authorJay Mollica, Fangyi Zhu
requires_pythonNone
licenseNone
keywords getty art ulan wikidata artist artwork museums
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Artist Getter

Building on top of [sfmoma/getty-getter](https://github.com/sfmoma/getty-getter) to retrieve artist information from
both Getty ULAN and WikiData.

## Installation

`pip install artist-getter`

Getty Getter was built on Django 1.8 and Python 3.12.

## Artist Getter

[Getty Getter](https://github.com/sfmoma/getty-getter) was a script developed by SFMOMA for associating artists with the
Getty ULAN vocabulary and gathering additional metadata
based on an artist's ULAN.

The ULAN vocabulary is a wealth of information regarding people and organizations involved in art and culture. More
about ULAN can be found [here](http://www.getty.edu/research/tools/vocabularies/ulan/about.html).

Wikidata is later added as a supplement on top of ULAN, in case there are entries missing from one of the two artist
databases. Together they constitute Artist Getter.

This script is a work in progress.

### ULAN Functions

Right now there are four basic functions.

#### 1. get_getty_ulan

`get_getty_ulan` consumes and artist's name (formatted    `u'Last, First'`) and does a best guess match against
similar names in the Getty ULAN vocabulary. The returned data will include the name of the artist or organization, the
ULAN, the "type" og thing returned (e.g. person, organization etc) and a scope note, which is a brief summary of the
artist's career.

`get_getty_ulan(u"Stieglitz, Alfred")`

```
{'scopenote': u'Renowned photographer Stieglitz first studied photochemistry with Hermann Wilhelm Vogel at the Technische Hochschule in Berlin, from 1882-1886, and took his first photographs in 1883. He continued to travel and photograph in Germany, Austria, and Switzerland until 1890, when he returned to New York City. From 1890 to 1895 he was a partner in a photogravure firm. During this time he concentrated on photographing the streets of New York City. In 1894, Stieglitz travelled to Europe and was elected a member of the Linked Ring, a pictorialist society in London. In 1902, Stieglitz founded the Photo-Secession Movement which attempted to prove that pictorialist photography was a fine art form. From 1903 to 1917, Stieglitz was publisher and director of Camera Work magazine. The graphic section was run by Edward Steichen (1879-1973). In 1905, Stieglitz opened the Little Galleries of the Photo-Secession "291" on Fifth Avenue in New York City with Steichen. The galleries operated until 1917. In 1907, Stieglitz exhibited his autochrome photographs. Stieglitz stopped photographing in 1937. During his lifetime, Stieglitz was also a close friend and collaborator of Joseph T. Keiley. Together they invented the glycerine process which permitted partial development of platinum papers. Also, they produced joint research on the history of photography. Keiley also acted as the associate editor of Stieglitz\'\'s publications "Camera Notes" and "Camera Works". American photographer.', 'ulan': u'500024301', 'type': u'Persons, Artists', 'term': u'Stieglitz, Alfred'}
```

#### 2. get_getty_relationship

`get_getty_relationship` consumes an artist's ULAN and returns a list of the relationships that artist had with
other artists in the ULAN vocabulary. The `object_ulan` being the ULAN of the related person or organization.
`get_getty_relationship("500024301")`

```
{'relationship_type': u'student of', 'object_ulan': u'500063166'}{'relationship_type': u'influenced', 'object_ulan': u'500007426'}{'relationship_type': u'colleague of', 'object_ulan': u'500004441'}{'relationship_type': u'collaborated with', 'object_ulan': u'500001336'}{'relationship_type': u'collaborated with', 'object_ulan': u'500000431'}{'relationship_type': u'spouse of', 'object_ulan': u'500018666'}{'relationship_type': u'friend of', 'object_ulan': u'500070483'}
```

#### 3. get_getty_artist_name

`get_getty_artist_name` consumes an ULAN and returns just the artist's name formatted `Last, First`.
`get_getty_artist_name("500024301")`
```Stieglitz, Alfred```

#### 4. get_getty_artist_data

`get_getty_artist_data` consumes an ULAN and returns entire set of data from given ulan as a dictionary.
`get_getty_artist_data("500024301")`

```
{
'@context': 'https://linked.art/ns/v1/linked-art.json',
'_label': 'Stieglitz, Alfred',
'born': { 'id': 'http://vocab.getty.edu/ulan/activity/birth/4000062133',
'timespan': { 'begin_of_the_begin': '1864-01-01T00:00:00',
    'end_of_the_end': '1864-12-31T23:59:59',
    'id': 'http://vocab.getty.edu/ulan/time/birth/4000062133',
    'type': 'TimeSpan' },
'took_place_at': [ { '_label': 'Hoboken',
    'id': 'http://vocab.getty.edu/tgn/7013711-place',
    'type': 'Place' } ],
...
```

The dictionary is parsed from [this json file on ULAN](http://vocab.getty.edu/ulan/500024301.json)

#### 5. get_getty_artist_sex

`get_getty_artist_name` consumes an ULAN and returns just the artist's sex as a string, available sexes are '
male', 'female' and None if unknown.
`get_getty_artist_sex("500024301")`

`male`

#### 6. get_getty_artist_birth_year

`get_getty_artist_birth_year` consumes an ULAN and returns artist birth year as an integer

`get_getty_artist_birth_year("500024301")`

`1864`


### WikiData Functions
#### 1. get_wiki_artist_data
`get_wiki_artist_data` consumes a WikiData ID like `Q948598` and returns the entire data set from WikiData.

#### 2. get_wiki_artist_name
`get_wiki_artist_data` consumes a WikiData ID and returns the artist name in 'First Last' format, as seen on WikiData.

`get_wiki_artist_name("Q948598")`

`Albert Pinkham Ryder`

#### 3. get_wiki_artist_sex
`get_wiki_artist_sex` consumes a WikiData ID and returns just the artist's gender and sex as a string, available sexes are '
male', 'female' and None if unknown.

`get_wiki_artist_sex("Q948598")`

`male`

#### 4. get_wiki_artist_birth_year
`get_wiki_artist_birth_year` consumes a WikiData ID and returns just the artist's birth year as an integer.

`get_wiki_artist_birth_year("Q948598")`

`1864`

### Example View

```python
from django.views.generic.base import View
from django.http import HttpResponse
from artist_getter import *
import json


class GetUlanView(View):
    def get(self, request):
        artist_ulan = json.dumps(get_getty_ulan(u"Stieglitz, Alfred"))

        return HttpResponse(artist_ulan, content_type="application/json")
```

### Build & Release

For maintainers of this package only.

Download setuptools:
`pip install --upgrade setuptools`

First, bump up the release version in setup.py.

Run this command to build package:
`python -m build`

Run checks before releasing to PyPI:
`twine check --strict dist/*`

Release to PYPI by:
`twine upload --skip-existing dist/*`

Push everything and create a release on GitHub.

#### Test unreleased package locally
`pip uninstall artist-getter`

Change to the dist directory and install the newest distribution by calling:
`pip install artist_getter-$NEWEST_EDITION`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fangyizhu/artist-getter",
    "name": "artist-getter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Getty Art ULAN WikiData Artist Artwork Museums",
    "author": "Jay Mollica, Fangyi Zhu",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9e/26/26450e64bf1c99fe2e22887b08141ca1d5d1aa077628edc64a8ad1e63ef3/artist_getter-0.4.4.tar.gz",
    "platform": null,
    "description": "# Artist Getter\r\n\r\nBuilding on top of [sfmoma/getty-getter](https://github.com/sfmoma/getty-getter) to retrieve artist information from\r\nboth Getty ULAN and WikiData.\r\n\r\n## Installation\r\n\r\n`pip install artist-getter`\r\n\r\nGetty Getter was built on Django 1.8 and Python 3.12.\r\n\r\n## Artist Getter\r\n\r\n[Getty Getter](https://github.com/sfmoma/getty-getter) was a script developed by SFMOMA for associating artists with the\r\nGetty ULAN vocabulary and gathering additional metadata\r\nbased on an artist's ULAN.\r\n\r\nThe ULAN vocabulary is a wealth of information regarding people and organizations involved in art and culture. More\r\nabout ULAN can be found [here](http://www.getty.edu/research/tools/vocabularies/ulan/about.html).\r\n\r\nWikidata is later added as a supplement on top of ULAN, in case there are entries missing from one of the two artist\r\ndatabases. Together they constitute Artist Getter.\r\n\r\nThis script is a work in progress.\r\n\r\n### ULAN Functions\r\n\r\nRight now there are four basic functions.\r\n\r\n#### 1. get_getty_ulan\r\n\r\n`get_getty_ulan` consumes and artist's name (formatted    `u'Last, First'`) and does a best guess match against\r\nsimilar names in the Getty ULAN vocabulary. The returned data will include the name of the artist or organization, the\r\nULAN, the \"type\" og thing returned (e.g. person, organization etc) and a scope note, which is a brief summary of the\r\nartist's career.\r\n\r\n`get_getty_ulan(u\"Stieglitz, Alfred\")`\r\n\r\n```\r\n{'scopenote': u'Renowned photographer Stieglitz first studied photochemistry with Hermann Wilhelm Vogel at the Technische Hochschule in Berlin, from 1882-1886, and took his first photographs in 1883. He continued to travel and photograph in Germany, Austria, and Switzerland until 1890, when he returned to New York City. From 1890 to 1895 he was a partner in a photogravure firm. During this time he concentrated on photographing the streets of New York City. In 1894, Stieglitz travelled to Europe and was elected a member of the Linked Ring, a pictorialist society in London. In 1902, Stieglitz founded the Photo-Secession Movement which attempted to prove that pictorialist photography was a fine art form. From 1903 to 1917, Stieglitz was publisher and director of Camera Work magazine. The graphic section was run by Edward Steichen (1879-1973). In 1905, Stieglitz opened the Little Galleries of the Photo-Secession \"291\" on Fifth Avenue in New York City with Steichen. The galleries operated until 1917. In 1907, Stieglitz exhibited his autochrome photographs. Stieglitz stopped photographing in 1937. During his lifetime, Stieglitz was also a close friend and collaborator of Joseph T. Keiley. Together they invented the glycerine process which permitted partial development of platinum papers. Also, they produced joint research on the history of photography. Keiley also acted as the associate editor of Stieglitz\\'\\'s publications \"Camera Notes\" and \"Camera Works\". American photographer.', 'ulan': u'500024301', 'type': u'Persons, Artists', 'term': u'Stieglitz, Alfred'}\r\n```\r\n\r\n#### 2. get_getty_relationship\r\n\r\n`get_getty_relationship` consumes an artist's ULAN and returns a list of the relationships that artist had with\r\nother artists in the ULAN vocabulary. The `object_ulan` being the ULAN of the related person or organization.\r\n`get_getty_relationship(\"500024301\")`\r\n\r\n```\r\n{'relationship_type': u'student of', 'object_ulan': u'500063166'}{'relationship_type': u'influenced', 'object_ulan': u'500007426'}{'relationship_type': u'colleague of', 'object_ulan': u'500004441'}{'relationship_type': u'collaborated with', 'object_ulan': u'500001336'}{'relationship_type': u'collaborated with', 'object_ulan': u'500000431'}{'relationship_type': u'spouse of', 'object_ulan': u'500018666'}{'relationship_type': u'friend of', 'object_ulan': u'500070483'}\r\n```\r\n\r\n#### 3. get_getty_artist_name\r\n\r\n`get_getty_artist_name` consumes an ULAN and returns just the artist's name formatted `Last, First`.\r\n`get_getty_artist_name(\"500024301\")`\r\n```Stieglitz, Alfred```\r\n\r\n#### 4. get_getty_artist_data\r\n\r\n`get_getty_artist_data` consumes an ULAN and returns entire set of data from given ulan as a dictionary.\r\n`get_getty_artist_data(\"500024301\")`\r\n\r\n```\r\n{\r\n'@context': 'https://linked.art/ns/v1/linked-art.json',\r\n'_label': 'Stieglitz, Alfred',\r\n'born': { 'id': 'http://vocab.getty.edu/ulan/activity/birth/4000062133',\r\n'timespan': { 'begin_of_the_begin': '1864-01-01T00:00:00',\r\n    'end_of_the_end': '1864-12-31T23:59:59',\r\n    'id': 'http://vocab.getty.edu/ulan/time/birth/4000062133',\r\n    'type': 'TimeSpan' },\r\n'took_place_at': [ { '_label': 'Hoboken',\r\n    'id': 'http://vocab.getty.edu/tgn/7013711-place',\r\n    'type': 'Place' } ],\r\n...\r\n```\r\n\r\nThe dictionary is parsed from [this json file on ULAN](http://vocab.getty.edu/ulan/500024301.json)\r\n\r\n#### 5. get_getty_artist_sex\r\n\r\n`get_getty_artist_name` consumes an ULAN and returns just the artist's sex as a string, available sexes are '\r\nmale', 'female' and None if unknown.\r\n`get_getty_artist_sex(\"500024301\")`\r\n\r\n`male`\r\n\r\n#### 6. get_getty_artist_birth_year\r\n\r\n`get_getty_artist_birth_year` consumes an ULAN and returns artist birth year as an integer\r\n\r\n`get_getty_artist_birth_year(\"500024301\")`\r\n\r\n`1864`\r\n\r\n\r\n### WikiData Functions\r\n#### 1. get_wiki_artist_data\r\n`get_wiki_artist_data` consumes a WikiData ID like `Q948598` and returns the entire data set from WikiData.\r\n\r\n#### 2. get_wiki_artist_name\r\n`get_wiki_artist_data` consumes a WikiData ID and returns the artist name in 'First Last' format, as seen on WikiData.\r\n\r\n`get_wiki_artist_name(\"Q948598\")`\r\n\r\n`Albert Pinkham Ryder`\r\n\r\n#### 3. get_wiki_artist_sex\r\n`get_wiki_artist_sex` consumes a WikiData ID and returns just the artist's gender and sex as a string, available sexes are '\r\nmale', 'female' and None if unknown.\r\n\r\n`get_wiki_artist_sex(\"Q948598\")`\r\n\r\n`male`\r\n\r\n#### 4. get_wiki_artist_birth_year\r\n`get_wiki_artist_birth_year` consumes a WikiData ID and returns just the artist's birth year as an integer.\r\n\r\n`get_wiki_artist_birth_year(\"Q948598\")`\r\n\r\n`1864`\r\n\r\n### Example View\r\n\r\n```python\r\nfrom django.views.generic.base import View\r\nfrom django.http import HttpResponse\r\nfrom artist_getter import *\r\nimport json\r\n\r\n\r\nclass GetUlanView(View):\r\n    def get(self, request):\r\n        artist_ulan = json.dumps(get_getty_ulan(u\"Stieglitz, Alfred\"))\r\n\r\n        return HttpResponse(artist_ulan, content_type=\"application/json\")\r\n```\r\n\r\n### Build & Release\r\n\r\nFor maintainers of this package only.\r\n\r\nDownload setuptools:\r\n`pip install --upgrade setuptools`\r\n\r\nFirst, bump up the release version in setup.py.\r\n\r\nRun this command to build package:\r\n`python -m build`\r\n\r\nRun checks before releasing to PyPI:\r\n`twine check --strict dist/*`\r\n\r\nRelease to PYPI by:\r\n`twine upload --skip-existing dist/*`\r\n\r\nPush everything and create a release on GitHub.\r\n\r\n#### Test unreleased package locally\r\n`pip uninstall artist-getter`\r\n\r\nChange to the dist directory and install the newest distribution by calling:\r\n`pip install artist_getter-$NEWEST_EDITION`\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Getty ULAN and WikiData scraping utilities for artists",
    "version": "0.4.4",
    "project_urls": {
        "Homepage": "https://github.com/fangyizhu/artist-getter"
    },
    "split_keywords": [
        "getty",
        "art",
        "ulan",
        "wikidata",
        "artist",
        "artwork",
        "museums"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60aa9bb14b0c1513e73eff35df8eee06080fe283e4224b27498cbf69cf30ec9b",
                "md5": "e34f6bc4a6e8988990d6885439da7b0c",
                "sha256": "914eb50acc7ebb6f61355ac23f90e32fc3e49e05a0afb12965738e64b7f2253f"
            },
            "downloads": -1,
            "filename": "artist_getter-0.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e34f6bc4a6e8988990d6885439da7b0c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7234,
            "upload_time": "2024-11-15T02:30:24",
            "upload_time_iso_8601": "2024-11-15T02:30:24.484628Z",
            "url": "https://files.pythonhosted.org/packages/60/aa/9bb14b0c1513e73eff35df8eee06080fe283e4224b27498cbf69cf30ec9b/artist_getter-0.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9e2626450e64bf1c99fe2e22887b08141ca1d5d1aa077628edc64a8ad1e63ef3",
                "md5": "403b16d22d42d794e2bcaf99ca72083a",
                "sha256": "0743e41f05c93479b05eaf8664da194d13b0566b7e104f1093611359fccd15a1"
            },
            "downloads": -1,
            "filename": "artist_getter-0.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "403b16d22d42d794e2bcaf99ca72083a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6982,
            "upload_time": "2024-11-15T02:30:25",
            "upload_time_iso_8601": "2024-11-15T02:30:25.970224Z",
            "url": "https://files.pythonhosted.org/packages/9e/26/26450e64bf1c99fe2e22887b08141ca1d5d1aa077628edc64a8ad1e63ef3/artist_getter-0.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 02:30:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fangyizhu",
    "github_project": "artist-getter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "artist-getter"
}
        
Elapsed time: 1.47111s