datamuser


Namedatamuser JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryCommand line interface for the Datamuse API
upload_time2025-01-20 03:02:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords antonyms cli datamuse rhyming synonyms thesaurus words
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # datamuse-cli

A command line interface for the Datamuse API.

## Installation

This tool isn't uploaded to pypi yet because the name `datamuse-cli` is already taken there...

```bash
pip install [TO_BE_DETERMINED]
```

## Usage

See `datamuse --help` for usage information:
```
usage: datamuse [-h] [-n MAX_RESULTS] [-f {csv,line,json}] [-m [METADATA]]
                [-t TOPICS] [-l LEFT_CONTEXT] [-r RIGHT_CONTEXT]
                [-V {es,enwiki}] [-q QUERY_ECHO] [-d] [-v]
                mode word

Unofficial command line interface for the Datamuse API. Datamuse API
documentation: https://www.datamuse.com/api/

positional arguments:
  mode                  Type of word relationship to query:
                          ml - "Means like" (words with similar meanings)
                          sl - "Sounds like" (words with similar
                                pronunciation)
                          sp - "Spelled like" (words with similar
                                spelling)
                          rhy - Rhymes with
                          n2a - "Noun to adjective" (adjectives commonly
                                used to describe the given noun)
                          a2n - "Adjective to noun" (nouns commonly
                                modified by the given adjective)
                          syn - Synonyms
                          ant - Antonyms
                          trg - "Triggers" (words statistically
                                associated with the query word in the same
                                piece of text)
                          spc - More specific terms (hyponyms)
                          gen - More general terms (hypernyms)
                          com - "Comprises" (direct holonyms)
                          par - "Part of" (direct meronyms)
                          fol - Frequent followers
                          pre - Frequent predecessors
                          hom - Homophones (sound-alike words)
                          cns - Consonant match
                          sug - Suggestions (autocomplete)
  word                  Word or phrase to query

options:
  -h, --help            show this help message and exit
  -n, --max-results MAX_RESULTS
                        Maximum number of results to return (default: 10)
  -f, --format {csv,line,json}
                        Output format: comma-separated, line-by-line, or JSON
                        (default: csv)
  -m, --metadata [METADATA]
                        Which metadata to include in results. Options include:
                        - d (definitions)
                        - p (parts of speech)
                        - s (syllable count)
                        - r (pronunciation)
                        - f (word frequency)
                        If omitted, no metadata is included. If specified
                        without a value, all metadata is included: 'dpsrf'.
  -t, --topics TOPICS   Optional topic words. Results will be skewed toward
                        these topics. At most 5 words can be specified. Space
                        or comma delimited. Nouns work best.
  -l, --left-context LEFT_CONTEXT
                        Left context: an optional hint about the word that
                        appears immediately to the left. (Only a single word
                        may be specified.)
  -r, --right-context RIGHT_CONTEXT
                        Right context: an optional hint about the word that
                        appears immediately to the right. (Only a single word
                        may be specified.)
  -V, --vocabulary {es,enwiki}
                        Identifier for alternative vocabulary to use. By
                        default, a 550,000-term English vocabulary is used.
  -q, --query-echo QUERY_ECHO
                        Query echo: see Datamuse documentation for details.
  -d, --debug           Enable debug mode. This will print the API request to
                        the console.
  -v, --version         show program's version number and exit

(Note that compared to the Datamuse API, this tool reverses the meanings of the
"spc" and "gen" parameters.)
```

## Examples

Words that have similar meanings to "happy":
```
$ datamuse ml happy
pleased, blissful, content, glad, contented, joyful, euphoric, joyous, fortunate, riant
```

Words that sound like "spot":
```
$ datamuse sl spot
spot, spott, spout, spit, spite, spat, spate, sput, spight, spet
```

Adjectives that are often used to modify the noun "tree", skewed toward the topic of "Carribean":
```
$ datamuse --topics carribean a2n tree
tropical, mango, small, entire, stately, shady, giant, famous, lemon, palm
```

Hyponyms (more specific terms) of "stone":
```
$ datamuse spc stone
calculus, cornerstone, crystal, conglomerate, capstone, gravel, marble, sill, lava, magma
```

Three antonyms of "day", returned in JSON format, with pronunciation and frequency metadata:
```
$ datamuse -n 3 -f json -m rf ant day
[
  {
    "word": "night",
    "score": 3407,
    "tags": [
      "pron:N AY1 T ",
      "f:145.767264"
    ]
  },
  {
    "word": "dark",
    "score": 2295,
    "tags": [
      "pron:D AA1 R K ",
      "f:68.871627"
    ]
  },
  {
    "word": "nighttime",
    "score": 988,
    "tags": [
      "pron:N AY1 T T AY0 M ",
      "f:1.016966"
    ]
  }
]
```

## Future features

The Datamuse API supports queries involving a spelling filter alongside other
parameters, for instance "words that have a similar meaning to 'point' and have
'o' as the third letter":

[https://api.datamuse.com/words?ml=point&sp=??o*]()

Currently, the `datamuse-cli` tool does not support this feature.


## Datamuse API page

https://www.datamuse.com/api/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "datamuser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "antonyms, cli, datamuse, rhyming, synonyms, thesaurus, words",
    "author": null,
    "author_email": "Hrothgar <hrothgarrrr@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/85/07/5d0abbb96bb7a6d450fbd763668f28b56633f5c28bdf9ff1edb264118dd7/datamuser-0.1.1.tar.gz",
    "platform": null,
    "description": "# datamuse-cli\n\nA command line interface for the Datamuse API.\n\n## Installation\n\nThis tool isn't uploaded to pypi yet because the name `datamuse-cli` is already taken there...\n\n```bash\npip install [TO_BE_DETERMINED]\n```\n\n## Usage\n\nSee `datamuse --help` for usage information:\n```\nusage: datamuse [-h] [-n MAX_RESULTS] [-f {csv,line,json}] [-m [METADATA]]\n                [-t TOPICS] [-l LEFT_CONTEXT] [-r RIGHT_CONTEXT]\n                [-V {es,enwiki}] [-q QUERY_ECHO] [-d] [-v]\n                mode word\n\nUnofficial command line interface for the Datamuse API. Datamuse API\ndocumentation: https://www.datamuse.com/api/\n\npositional arguments:\n  mode                  Type of word relationship to query:\n                          ml - \"Means like\" (words with similar meanings)\n                          sl - \"Sounds like\" (words with similar\n                                pronunciation)\n                          sp - \"Spelled like\" (words with similar\n                                spelling)\n                          rhy - Rhymes with\n                          n2a - \"Noun to adjective\" (adjectives commonly\n                                used to describe the given noun)\n                          a2n - \"Adjective to noun\" (nouns commonly\n                                modified by the given adjective)\n                          syn - Synonyms\n                          ant - Antonyms\n                          trg - \"Triggers\" (words statistically\n                                associated with the query word in the same\n                                piece of text)\n                          spc - More specific terms (hyponyms)\n                          gen - More general terms (hypernyms)\n                          com - \"Comprises\" (direct holonyms)\n                          par - \"Part of\" (direct meronyms)\n                          fol - Frequent followers\n                          pre - Frequent predecessors\n                          hom - Homophones (sound-alike words)\n                          cns - Consonant match\n                          sug - Suggestions (autocomplete)\n  word                  Word or phrase to query\n\noptions:\n  -h, --help            show this help message and exit\n  -n, --max-results MAX_RESULTS\n                        Maximum number of results to return (default: 10)\n  -f, --format {csv,line,json}\n                        Output format: comma-separated, line-by-line, or JSON\n                        (default: csv)\n  -m, --metadata [METADATA]\n                        Which metadata to include in results. Options include:\n                        - d (definitions)\n                        - p (parts of speech)\n                        - s (syllable count)\n                        - r (pronunciation)\n                        - f (word frequency)\n                        If omitted, no metadata is included. If specified\n                        without a value, all metadata is included: 'dpsrf'.\n  -t, --topics TOPICS   Optional topic words. Results will be skewed toward\n                        these topics. At most 5 words can be specified. Space\n                        or comma delimited. Nouns work best.\n  -l, --left-context LEFT_CONTEXT\n                        Left context: an optional hint about the word that\n                        appears immediately to the left. (Only a single word\n                        may be specified.)\n  -r, --right-context RIGHT_CONTEXT\n                        Right context: an optional hint about the word that\n                        appears immediately to the right. (Only a single word\n                        may be specified.)\n  -V, --vocabulary {es,enwiki}\n                        Identifier for alternative vocabulary to use. By\n                        default, a 550,000-term English vocabulary is used.\n  -q, --query-echo QUERY_ECHO\n                        Query echo: see Datamuse documentation for details.\n  -d, --debug           Enable debug mode. This will print the API request to\n                        the console.\n  -v, --version         show program's version number and exit\n\n(Note that compared to the Datamuse API, this tool reverses the meanings of the\n\"spc\" and \"gen\" parameters.)\n```\n\n## Examples\n\nWords that have similar meanings to \"happy\":\n```\n$ datamuse ml happy\npleased, blissful, content, glad, contented, joyful, euphoric, joyous, fortunate, riant\n```\n\nWords that sound like \"spot\":\n```\n$ datamuse sl spot\nspot, spott, spout, spit, spite, spat, spate, sput, spight, spet\n```\n\nAdjectives that are often used to modify the noun \"tree\", skewed toward the topic of \"Carribean\":\n```\n$ datamuse --topics carribean a2n tree\ntropical, mango, small, entire, stately, shady, giant, famous, lemon, palm\n```\n\nHyponyms (more specific terms) of \"stone\":\n```\n$ datamuse spc stone\ncalculus, cornerstone, crystal, conglomerate, capstone, gravel, marble, sill, lava, magma\n```\n\nThree antonyms of \"day\", returned in JSON format, with pronunciation and frequency metadata:\n```\n$ datamuse -n 3 -f json -m rf ant day\n[\n  {\n    \"word\": \"night\",\n    \"score\": 3407,\n    \"tags\": [\n      \"pron:N AY1 T \",\n      \"f:145.767264\"\n    ]\n  },\n  {\n    \"word\": \"dark\",\n    \"score\": 2295,\n    \"tags\": [\n      \"pron:D AA1 R K \",\n      \"f:68.871627\"\n    ]\n  },\n  {\n    \"word\": \"nighttime\",\n    \"score\": 988,\n    \"tags\": [\n      \"pron:N AY1 T T AY0 M \",\n      \"f:1.016966\"\n    ]\n  }\n]\n```\n\n## Future features\n\nThe Datamuse API supports queries involving a spelling filter alongside other\nparameters, for instance \"words that have a similar meaning to 'point' and have\n'o' as the third letter\":\n\n[https://api.datamuse.com/words?ml=point&sp=??o*]()\n\nCurrently, the `datamuse-cli` tool does not support this feature.\n\n\n## Datamuse API page\n\nhttps://www.datamuse.com/api/\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Command line interface for the Datamuse API",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "antonyms",
        " cli",
        " datamuse",
        " rhyming",
        " synonyms",
        " thesaurus",
        " words"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb65d42a77a807a636a44bf3a145b4090583c29e35f9a7eb83955d81044f06e8",
                "md5": "8c52229fd9254a85cf7f924820529799",
                "sha256": "ea0b2a4aa95f9361ad1e8dfb8a84707cb923f746478fb996a48071a6e6372ebb"
            },
            "downloads": -1,
            "filename": "datamuser-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c52229fd9254a85cf7f924820529799",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7141,
            "upload_time": "2025-01-20T03:02:18",
            "upload_time_iso_8601": "2025-01-20T03:02:18.740115Z",
            "url": "https://files.pythonhosted.org/packages/bb/65/d42a77a807a636a44bf3a145b4090583c29e35f9a7eb83955d81044f06e8/datamuser-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "85075d0abbb96bb7a6d450fbd763668f28b56633f5c28bdf9ff1edb264118dd7",
                "md5": "31e721dc918d81f17a7e8eccec45881c",
                "sha256": "41c8dc0500b954c14b2c16ea152464f82d29992269320bd37515095cba3a052d"
            },
            "downloads": -1,
            "filename": "datamuser-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "31e721dc918d81f17a7e8eccec45881c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5653,
            "upload_time": "2025-01-20T03:02:20",
            "upload_time_iso_8601": "2025-01-20T03:02:20.985048Z",
            "url": "https://files.pythonhosted.org/packages/85/07/5d0abbb96bb7a6d450fbd763668f28b56633f5c28bdf9ff1edb264118dd7/datamuser-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-20 03:02:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "datamuser"
}
        
Elapsed time: 0.55970s