dewdrop


Namedewdrop JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummaryInteract with Dewey Data API from the command line.
upload_time2025-07-15 19:07:19
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords dewey dewey data api data academic research
VCS
bugtrack_url
requirements requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Dew Drop: A command line tool for the Dewey Data API
====================================================

A simple Python 3 client for the Dewey Data API that can be used to fetch
product information and download files.

    usage: dewdrop [-h] [-k KEY] [-v] [--params PARAMS] [--debug] [--sleep SLEEP]
                   {meta,download,list} ...

    Fetch data from Dewey Data.

    positional arguments:
      {meta,download,list}
        meta                Fetch metadata for product.
        download            Download files for product.
        list                List files for product.

    options:
      -h, --help            show this help message and exit
      -k KEY, --key KEY     API key.
      -v, --verbose         Enable log.
      --params PARAMS       Additional parameters.
      --debug               Enable debug mode.
      --sleep SLEEP         Delay between requests

_NOTE: I have no affiliation with Dewey Data and this is not an official
Dewey Data client._


## Installation

The package can be installed from PyPI:

    pip install dewdrop


## Commands

### `meta`

Get metadata for a product. For example, if the product identifier is
something like `978cz-306w`, then the command would be:

    dewdrop meta 978cz-306w

By default, the API key is read from the `DEWEY_API_KEY` environment variable.
To set it manually, use the `key` option:

    dewdrop -k YOUR_API_KEY meta 978cz-306w

### `list`

List all file info for a product.

    dewdrop list 978cz-306w

The file information will be written to standard output. You can, of course,
redirect this to a file if you want to save it:

    dewdrop list 978cz-306w > file_info.tsv

See `dewdrop list --help` for full options.

### `download`

Download all files for a product.

    dewdrop download 978cz-306w destination-folder-path

Files will be placed in `destination-folder-path`, which will be created if
it does not exist. Additionally, the file information will be written to
standard output as with the `list` command.

By default, the downloaded files will be organized by the `partition_key`
value that the API returns which each file. To ignore this, specify the
option `--no-partition`. See `dewdrop download --help` for full options.

#### Request parameters

Additional parameters can be passed to the API using the `--params` option.
This is useful when downloading partitioned products. The option expects a
JSON object, which can be difficult to enter as a string on the command line.
One option is to put the parameters in a JSON file and pass the file contents
to the argument like this:

    dewdrop --params "$(<params.json)" download 978cz-306w destination-folder-path

Where a `params.json` file to download data for 2022 might look like this:

    {
    "partition_key_after":  "2022-01-01",
    "partition_key_before": "2022-12-31"
    }

### Checking output

Currently, there is no way to verify the downloaded files. One option is
to use the `-v` option to enable verbose logging, which will show the total
number of files. This can be compared to the downloaded files with:

    # confirm file count
    find destination-folder-path -type f | wc -l

The output file list will also contain file sizes, which can be compared to
the downloaded files, although currently there is no automatic way to make
this comparison using the script.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dewdrop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "Dewey, Dewey Data, API, data, academic, research",
    "author": null,
    "author_email": "Chris Poliquin <chrispoliquin@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/5a/fe/a1d7c65105e8c805328435be54493c04bf58743b38cbc10e538d0d6db99b/dewdrop-0.3.0.tar.gz",
    "platform": null,
    "description": "Dew Drop: A command line tool for the Dewey Data API\n====================================================\n\nA simple Python 3 client for the Dewey Data API that can be used to fetch\nproduct information and download files.\n\n    usage: dewdrop [-h] [-k KEY] [-v] [--params PARAMS] [--debug] [--sleep SLEEP]\n                   {meta,download,list} ...\n\n    Fetch data from Dewey Data.\n\n    positional arguments:\n      {meta,download,list}\n        meta                Fetch metadata for product.\n        download            Download files for product.\n        list                List files for product.\n\n    options:\n      -h, --help            show this help message and exit\n      -k KEY, --key KEY     API key.\n      -v, --verbose         Enable log.\n      --params PARAMS       Additional parameters.\n      --debug               Enable debug mode.\n      --sleep SLEEP         Delay between requests\n\n_NOTE: I have no affiliation with Dewey Data and this is not an official\nDewey Data client._\n\n\n## Installation\n\nThe package can be installed from PyPI:\n\n    pip install dewdrop\n\n\n## Commands\n\n### `meta`\n\nGet metadata for a product. For example, if the product identifier is\nsomething like `978cz-306w`, then the command would be:\n\n    dewdrop meta 978cz-306w\n\nBy default, the API key is read from the `DEWEY_API_KEY` environment variable.\nTo set it manually, use the `key` option:\n\n    dewdrop -k YOUR_API_KEY meta 978cz-306w\n\n### `list`\n\nList all file info for a product.\n\n    dewdrop list 978cz-306w\n\nThe file information will be written to standard output. You can, of course,\nredirect this to a file if you want to save it:\n\n    dewdrop list 978cz-306w > file_info.tsv\n\nSee `dewdrop list --help` for full options.\n\n### `download`\n\nDownload all files for a product.\n\n    dewdrop download 978cz-306w destination-folder-path\n\nFiles will be placed in `destination-folder-path`, which will be created if\nit does not exist. Additionally, the file information will be written to\nstandard output as with the `list` command.\n\nBy default, the downloaded files will be organized by the `partition_key`\nvalue that the API returns which each file. To ignore this, specify the\noption `--no-partition`. See `dewdrop download --help` for full options.\n\n#### Request parameters\n\nAdditional parameters can be passed to the API using the `--params` option.\nThis is useful when downloading partitioned products. The option expects a\nJSON object, which can be difficult to enter as a string on the command line.\nOne option is to put the parameters in a JSON file and pass the file contents\nto the argument like this:\n\n    dewdrop --params \"$(<params.json)\" download 978cz-306w destination-folder-path\n\nWhere a `params.json` file to download data for 2022 might look like this:\n\n    {\n    \"partition_key_after\":  \"2022-01-01\",\n    \"partition_key_before\": \"2022-12-31\"\n    }\n\n### Checking output\n\nCurrently, there is no way to verify the downloaded files. One option is\nto use the `-v` option to enable verbose logging, which will show the total\nnumber of files. This can be compared to the downloaded files with:\n\n    # confirm file count\n    find destination-folder-path -type f | wc -l\n\nThe output file list will also contain file sizes, which can be compared to\nthe downloaded files, although currently there is no automatic way to make\nthis comparison using the script.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Interact with Dewey Data API from the command line.",
    "version": "0.3.0",
    "project_urls": {
        "homepage": "https://github.com/poliquin/dewdrop",
        "issues": "https://github.com/poliquin/dewdrop/issues",
        "repository": "https://github.com/poliquin/dewdrop"
    },
    "split_keywords": [
        "dewey",
        " dewey data",
        " api",
        " data",
        " academic",
        " research"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ccaeae066ae1995e109459461eab3e6d78d485cf2d7d0a137b8d3f963a1268a",
                "md5": "ebf6b6bcbe3495a8ff84197ca83d6db6",
                "sha256": "96ee817c5f6d7793a6385f45af6137b2963e1c3aa32099e5754dac1f31e5d250"
            },
            "downloads": -1,
            "filename": "dewdrop-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ebf6b6bcbe3495a8ff84197ca83d6db6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7231,
            "upload_time": "2025-07-15T19:07:18",
            "upload_time_iso_8601": "2025-07-15T19:07:18.226945Z",
            "url": "https://files.pythonhosted.org/packages/7c/ca/eae066ae1995e109459461eab3e6d78d485cf2d7d0a137b8d3f963a1268a/dewdrop-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5afea1d7c65105e8c805328435be54493c04bf58743b38cbc10e538d0d6db99b",
                "md5": "010d8d96f15daa5ec347abad149d110b",
                "sha256": "566b2399953629192933aa275196d27ed6ae211ced49f7648c022797cb20478e"
            },
            "downloads": -1,
            "filename": "dewdrop-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "010d8d96f15daa5ec347abad149d110b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6496,
            "upload_time": "2025-07-15T19:07:19",
            "upload_time_iso_8601": "2025-07-15T19:07:19.407273Z",
            "url": "https://files.pythonhosted.org/packages/5a/fe/a1d7c65105e8c805328435be54493c04bf58743b38cbc10e538d0d6db99b/dewdrop-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 19:07:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "poliquin",
    "github_project": "dewdrop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    "<",
                    "3.0.0"
                ],
                [
                    ">=",
                    "2.32.0"
                ]
            ]
        }
    ],
    "lcname": "dewdrop"
}
        
Elapsed time: 0.83158s