GithubHelp home page GithubHelp logo

Pagination about ckanapi HOT 3 CLOSED

ckan avatar ckan commented on July 26, 2024
Pagination

from ckanapi.

Comments (3)

deniszgonjanin avatar deniszgonjanin commented on July 26, 2024

Hum. I think you're found a bug in data.gov. The following is the code the will do what you want it to do in any other CKAN catalogue I've tested (so like, 2 other CKAN catalogues...):

myckan.action.package_search(q='fish', rows='20', start=120)

But on data.gov it always returns just the first 10 rows. Consider reporting to https://github.com/GSA/data.gov/

from ckanapi.

dsoprea avatar dsoprea commented on July 26, 2024

It's weird that the cURL requests work perfectly, though the parameter looks like it's "start" rather than "offset":

Start at offset 1:

$ curl -s "http://catalog.data.gov/api/3/action/package_search?q=fish&rows=1&start=1" -L | python -m json.tool 
                        "state": "active",
                        "vocabulary_id": null
                    }
                ],
                "title": "Statistics of U.S. Businesses (SUSB)",
                "tracking_summary": {
                    "recent": 177,
                    "total": 918
                },
                "type": "dataset",
                "url": null,
                "version": null
            }
        ],
        "search_facets": {}
    },
    "success": true
}

Start at offset (10):

$ curl -s "http://catalog.data.gov/api/3/action/package_search?q=fish&rows=1&start=10" -L | python -m json.tool 
                        "state": "active",
                        "vocabulary_id": null
                    }
                ],
                "title": "Annual Survey of State and Local Government Finances",
                "tracking_summary": {
                    "recent": 29,
                    "total": 158
                },
                "type": "dataset",
                "url": null,
                "version": null
            }
        ],
        "search_facets": {}
    },
    "success": true
}

from ckanapi.

wardi avatar wardi commented on July 26, 2024

start=X should work exactly the same with ckanapi. closing as it looks like you were just using the wrong parameter. There is no code in ckanapi related to the parameters pased to specific actions.

from ckanapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.