Skip to main content

Asynchronous and Synchronous Urban Dictionary Scraper

It uses selectolax to parse the HTML and httpx for sending HTTP requests.

Asynchronous Example

import asyncio
from urban_scraper import adefine


async def main():
    definitions = await adefine('hello')
    async for definition in definitions:
        ...

asyncio.run(main())

Synchronous Example

from urban_scraper import define

definitions = define('hello')

for definition in definitions:
    ...

In both examples, definition is urban_scraper.Definition

Attributes and Methods of urban_scraper.Definition

Attributes

  • defid
  • name
  • meaning
  • example
  • author
    • name
    • url
  • date
  • upvote
  • downvote

Methods

  • as_dict()
    • Converts the dataclass to a dict object and returns it.

How To Install

  • Using pip: pip install urban-scraper
  • Manual:
    • Clone the folder somewhere
    • CD to the location
    • Install the packages listed in requirements.txt (pip install -r requirements.txt)
    • Copy the folder, urban_scraper where you want to use it.

Metadata

Release files for urban-scraper 1.2

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

Source distribution (sdist)

Source distribution for urban-scraper 1.2
File Size Uploaded Provenance Actions
urban_scraper-1.2.tar.gz 4.7 kB Without provenance Details for urban_scraper-1.2.tar.gz

Release files / urban_scraper-1.2.tar.gz

Download URL urban_scraper-1.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8b036eb7450b26d688733eff7e673d29ae2e3dabcb7f8ecb4f64ecc2ff5bf76f
BLAKE2b-256 checksum
How to use checksums
3252e4debb919e1a9e290608818225666d964d290d3c5336b60a3d196cdc931e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

Security for urban-scraper 1.2

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.2 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