Metadata-Version: 2.4
Name: dsl_functions
Version: 1.3.0
Summary: A module that contains functions designed extract and organize legal data, especially in Brazilian courts.
Author: Alexandre Araújo Costa
Author-email: alexandre.araujo.costa@gmail.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.1
Requires-Dist: selenium>=4.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# DSL Functions

A Python module with utilities for extracting and organizing legal data, especially from Brazilian courts.

![PyPI](https://img.shields.io/pypi/v/dsl_functions)
![License](https://img.shields.io/pypi/l/dsl_functions)

## Installation

```bash
pip install dsl_functions
```

## Main Features

- Web scraping utilities with CAPTCHA handling
- Text cleaning and normalization functions
- Date and month conversion utilities
- CSV and file handling functions
- Selenium WebDriver integration

## Usage Examples

### Basic Web Scraping
```python
from dsl_functions import get

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

### Text Extraction
```python
from dsl_functions import clext

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

### Date Conversion
```python
from dsl_functions import date

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

### Month Conversion (PT-BR to MM)
```python
from dsl_functions import ajustar_mes

month_num = ajustar_mes("JAN")
print(month_num)  # "01"
```

## Full Function Documentation

### Web Scraping
- `get(url)`: Fetch HTML with CAPTCHA handling
- `get_driver()`: Configure Selenium WebDriver
- `get_json(url)`: Fetch JSON data

### Text Processing
- `clean(text)`: Normalize and clean text
- `clext(text, start, end)`: Extract text between delimiters
- `ajustar_mes(month)`: Convert PT-BR month abbreviations to numbers

### File Handling
- `adicionar(filename, data)`: Append data to file
- `carregar_arquivo(filename)`: Read file contents
- `csv_to_list(filename)`: Read CSV into list

## License

MIT - See [LICENSE](LICENSE) for details.
