Skip to main content

A general purpose module with utility functions for data processing

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

DSL Geral

A general purpose Python module with utilities for data processing and web scraping.

PyPI License

Installation

pip install dsl_geral

Main Features

  • Web scraping utilities with CAPTCHA handling (get, get3, get_contents, get_json, get_response)
  • Text cleaning and normalization functions (clean, clean_text, clean_for_csv, deep_clean, remove_accents)
  • Text extraction utilities (clext, ext, extract, trim)
  • Selenium WebDriver integration (webdriver_get, webdriver_get_page, waitForLoad, xpath_* functions)

Usage Examples

Basic Web Scraping

from dsl_geral import get

html = get("https://example.com")
print(html)

Text Extraction

from dsl_geral import clext

text = "Some text [START]extract this[END] more text"
extracted = clext(text, "[START]", "[END]") 
print(extracted)  # "extract this"

Date Conversion

from dsl_geral import date

formatted = date("31/12/2023")
print(formatted)  # "2023-12-31"

Text Cleaning

from dsl_geral import clean, remove_accents

text = "  Some   messy  text with accents: áéíóú  "
cleaned = clean(text)  # "Some messy text with accents: áéíóú"
no_accents = remove_accents(cleaned)  # "Some messy text with accents: aeiou"

Full Function Documentation

Web Scraping

  • get(url): Fetch HTML with CAPTCHA handling
  • get3(url): Fetch raw response with CAPTCHA handling
  • get_contents(url): Fetch response contents
  • get_json(url): Fetch JSON data
  • get_response(url): Fetch full response object
  • webdriver_get(url): Fetch page using Selenium
  • webdriver_get_page(url): Get page source using Selenium
  • waitForLoad(xpath): Wait for element to load (Selenium)
  • xpath_* functions: Interact with page elements (Selenium)

Text Processing

  • clean(text): Normalize whitespace and clean text
  • clean_text(text): Alternative cleaning function
  • clean_for_csv(text): Clean text for CSV output
  • deep_clean(text): Deep clean including HTML entities
  • remove_accents(text): Remove accents and special chars
  • clext(text, start, end): Clean and extract text between delimiters
  • ext(text, start, end): Extract text between delimiters
  • extract(text, start, end): Alternative extraction function
  • trim(text, start, end): Trim text between markers

License

MIT - See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsl_geral-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsl_geral-1.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file dsl_geral-1.0.0.tar.gz.

File metadata

  • Download URL: dsl_geral-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for dsl_geral-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1ad3302aa524f5b91d1c27092a6159a482064f7cd594a48fb603dcc569b25964
MD5 fd942c2ed222b60d90a3b62ce8a3a0f9
BLAKE2b-256 09342271266e8ee83d819ffb9222daa6f49adc0ed73fc39f26611329cb4ffedc

See more details on using hashes here.

File details

Details for the file dsl_geral-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dsl_geral-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for dsl_geral-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ed290a94e0675a95f0958d67f11ce59ad06255e6aa2df47a4b7dd27681ec7a8
MD5 9d25a3d7516c6311a077c556d87720da
BLAKE2b-256 c97bc3435ac18532c9a36bd6e8e0152f78b8b9936015cb9e20bd683aa7c10585

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page