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

Meta info upload doesn't work #4

Open
kasbah opened this issue Apr 10, 2020 · 3 comments
Open

Meta info upload doesn't work #4

kasbah opened this issue Apr 10, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@kasbah
Copy link
Contributor

kasbah commented Apr 10, 2020

Seems like it's currently commented out in upload.py and un commenting it causes errors.

@scivision
Copy link
Member

Yes I agree, I never actually got this working--not a permanent issue, I just didn't take the time to do it.

@scivision scivision added the enhancement New feature or request label Apr 28, 2020
@kikislater
Copy link

Because some values are mandatory to publish metadata such as :

  • upload_type
  • publication_type if publication
  • image_type if image
  • publication
  • publication_date
  • title
  • creators
  • description
  • access_right
  • license
  • (embargo)
  • access_conditions

https://developers.zenodo.org/#representation

@kikislater
Copy link

kikislater commented Jul 27, 2023

I got it working with for example:

data = {
     'metadata': {
        'title': df.iloc[i]["Title"].split(':')[1]+"_test",
        'upload_type': 'dataset',
        'description': df.iloc[i]["Description"],
        'creators': [{'name': 'Sylvain POULAIN',
                       'affiliation': 'IRD',
                       "orcid": "0009-0005-9789-9095"},
                     {'name': 'Julien BARDE',
                       'affiliation': 'IRD'}],
        "keywords": [
             "FAIR data",
             "Design of Experiment",
             "interoperability"],
        "communities":[{'identifier':'uav'},
                       {'identifier':'ecfunded'}],
        "language": "eng",
        "license": {
                "id": "CC-BY-4.0"
                    },
        "publication_date": df.iloc[i]['Date'].split("_\n")[0].split(':')[1],
        "grants": [{"links":{"self":"https://zenodo.org/api/grants/10.13039/501100000780::654241"},"acronym": "PhenoMenAl",
        "program": "H2020",
        "funder": {
          "doi": "10.13039/501100000780",
          "acronyms": [
            "EC"
          ],
          "name": "European Commission",
          "links": {
            "self": "https://zenodo.org/api/funders/10.13039/501100000780"
          }
        }
                     }]
     }
 }
r = requests.put('https://sandbox.zenodo.org/api/deposit/depositions/{}'.format(recid),
                 params={'access_token': ACCESS_TOKEN}, 
                 data=json.dumps(data), 
                 headers=headers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants