Skip to content

Docs: how can new users try creating a dataset? #129

Open

Description

@AntoninKns

Hello, and thank you for merging the documentation update #126. I tested the getting-started tutorial as a new user to see what I could do next. Reading a dataset works, but I cannot complete the dataset creation part.

I created an API token on data.humdata.org, as described in "Obtain your API Key", and used it with hdx_read_only=False. Step 9 of the tutorial uses hdx_site="stage" for writing:

from hdx.api.configuration import Configuration
from hdx.data.hdxobject import HDXError
from hdx.data.user import User

Configuration.create(hdx_site="stage", user_agent="stage_access_repro")
try:
    User.get_current_user()
except HDXError as e:
    print(e)
    print(repr(e.__cause__))

Output:

Failed when trying to show! (POST)
NotAuthorized({'__type': 'Authorization Error', 'message': 'Access denied'})

The same code with hdx_site="prod" authenticates (User.get_current_user() returns my username), which seems to prove that the issue comes from the stage site. That account has no organisation, so it cannot create datasets on prod, which matches the message on the "Add Data" page from data.humdata.org. I believe that is intended.

The demo site (for example https://demo.data-humdata-org.ahconu.org/, which the README uses for test_ckan.py) returns HTTP 401 for a plain request, so I assume outside users can't use them. Because of this, the tutorial's write steps can't be followed by an outside reader.

Questions:

  1. What should an outside reader use to practise creating and updating a dataset: a public test site, a sandbox organisation, or something else?
  2. If there is no such option, would you be happy with a tutorial that builds and validates the dataset locally and shows create_in_hdx() as the step for organisation members?
  3. Who do you see as the main readers of the docs (publishers inside organisations, data analysts reading data, or both)? That would help me choose what to write first.

I am happy to write the tutorial and a "Troubleshoot common errors" how-to page, but I want them to match what you would actually point new users to.

Best,
Antonin

Activity

  1. mcarans commented on Nov 5, 2026

    @mcarans
    Contributor

    Thanks for this issue which highlights gaps in our documentation. Although we have additional documentation here: https://docs.humdata.org/build/hdx-python-library, it does not cover the authorisation issue you have raised.

    1. Our intention is that people should use stage or feature if they want to create datasets that are unlikely to be touched for a while. The issue here is that the stage or feature) database is periodically (rarely) updated from prod so the the API key (or anything else created on prod) won't be on stage if the update has not occurred. The best way to do it is to be prepared to create a separate API key on stage for testing. demo is updated weekly so any changes on it that have not come from prod will be lost (but conversely prod API keys and other changes will be available within at most a week).

    2. I'm curious still about this tutorial: how would it work without a test site?

    3. I would say both

    @AntoninKns Please tell me more about the tutorial you have in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions