Skip to main content

A Python utility that fetches synonyms for a specified word.


Installation

$ pip install synonymscrawler

synonymscrawler has 3 dependencies:

  • lxml

  • requests

  • blockspring

pip installs the latter two along with this package. To install the former on Windows:

  • Install the appropriate .whl file from lxml.

  • If you’re lucky, then there will be two files: a zip folder and a .whl file. In that case, copy the .whl file to the Scripts directory in your Python installation folder, and invoke pip on it.

  • If you’re not so lucky, then there will only be a zip folder. If you’re using a virtual environment (as you should be), then extract the zip folder, and copy the contents to virtual-environment-dir-name/Lib/site-packages.

  • Confirm successful installation via pip list.


Modules

simple_synonyms_crawler

from synonymscrawler import simple_synonyms_crawler
simple_synonyms_crawler.crawl('adumbrate', 50)

Returns a list of up to N synonyms for a given word. Here, we shall return up to 50 synonyms for “adumbrate.”

synonyms_crawler

from synonymscrawler import synonyms_crawler
synonyms_crawler.crawl('adumbrate', 2)

Returns a dictionary object, where the keys are levels, and the values are the list of synonyms at each level.

For example, the output of this code block would be:

{
  0: ['adumbrate'],

  1: ['suggest', 'cloud', 'portend', 'intimate',
      'bode', 'augur', 'outline', 'foretell',
      'darken', 'obscure', 'sketch', 'indicate',
      'mist'],

    2: ['main features', 'skeleton', 'rough draft',
        'characterize', 'depiction', 'survey',
        'haze', 'tone down', 'conformation',
        'thumbnail sketch', 'aperçu', 'skeletonize',
        'plot', 'figure', 'line', 'cloudover',
        'configuration', 'rough out', 'digest',
        'compendium', 'bare facts', ...]
}

In other words:

{
    level0: [starting word],
    level1: [immediate synonyms for starting word],
    level2: [synonyms for words in level1]
}

blockspring_synonyms_crawler

SynonymsCrawler API

To run, download the BlockSpring CLI, and follow the instructions here to test it locally.

The output should be similar to that of synonyms_crawler above, except for the fact that level 0’s value will be the starting word alone, rather than a list with the starting word.

In other words:

{
       0: 'adumbrate',
       1: [adumbrate's synonyms],
       2: [synonyms of adumbrate's synonyms],
       .....
}

References

Metadata

Release files for synonymscrawler 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synonymscrawler 1.0.0
File Size Uploaded Provenance Actions
synonymscrawler-1.0.0.tar.gz 5.4 kB Without provenance Details for synonymscrawler-1.0.0.tar.gz

Release files / synonymscrawler-1.0.0.tar.gz

Download URL synonymscrawler-1.0.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
916550a132204cbc46f5d8a1c7f071d5ef89913544125e1f3c3636ef4b3c2a59
BLAKE2b-256 checksum
How to use checksums
28e4bc3640b620ca8fe9f61455ac2d247dc2e4d28c7eee82c1e4d124ca6ee316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for synonymscrawler 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page