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.
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 handlingget3(url): Fetch raw response with CAPTCHA handlingget_contents(url): Fetch response contentsget_json(url): Fetch JSON dataget_response(url): Fetch full response objectwebdriver_get(url): Fetch page using Seleniumwebdriver_get_page(url): Get page source using SeleniumwaitForLoad(xpath): Wait for element to load (Selenium)xpath_*functions: Interact with page elements (Selenium)
Text Processing
clean(text): Normalize whitespace and clean textclean_text(text): Alternative cleaning functionclean_for_csv(text): Clean text for CSV outputdeep_clean(text): Deep clean including HTML entitiesremove_accents(text): Remove accents and special charsclext(text, start, end): Clean and extract text between delimitersext(text, start, end): Extract text between delimitersextract(text, start, end): Alternative extraction functiontrim(text, start, end): Trim text between markers
License
MIT - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ad3302aa524f5b91d1c27092a6159a482064f7cd594a48fb603dcc569b25964
|
|
| MD5 |
fd942c2ed222b60d90a3b62ce8a3a0f9
|
|
| BLAKE2b-256 |
09342271266e8ee83d819ffb9222daa6f49adc0ed73fc39f26611329cb4ffedc
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ed290a94e0675a95f0958d67f11ce59ad06255e6aa2df47a4b7dd27681ec7a8
|
|
| MD5 |
9d25a3d7516c6311a077c556d87720da
|
|
| BLAKE2b-256 |
c97bc3435ac18532c9a36bd6e8e0152f78b8b9936015cb9e20bd683aa7c10585
|