Last active
January 15, 2019 19:23
-
-
Save tom-montgomery/6734a96226b22416c9aa799fef5c4c54 to your computer and use it in GitHub Desktop.
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
# update socrata asset's DOI metadata | |
headers = {'Host': 'data.austintexas.gov', | |
'Accept': """*/*""", | |
'Content-Length': '6000', | |
'Content-Type': 'application/json', | |
'X-App-Token': os.environ['socrata_doi_app_token']} | |
url = 'https://data.austintexas.gov/api/views/metadata/v1/{}'.format(socrata_4x4) | |
data = {"customFields": {"Digital Object Identifer (DOI)": {"DOI Number": "https://doi.org/{}".format(doi)}}} | |
r2 = requests.patch(url, json=data, auth=(os.environ['socrata_doi_user'], os.environ['socrata_doi_pass']), headers=headers) | |
print(r2.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment