Skip to content

Latest commit

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Gloom Core

Gloom Core

Python VersionPyPI versionLicense: MIT

Core browser automation framework for Ask Gloom. Provides a high-level interface for browser control, profile management, and automation tasks.

Features

  • Simplified browser automation with intelligent recovery
  • Advanced profile management and persistence
  • Flexible configuration system
  • Screenshot and visual comparison capabilities
  • Automatic driver management and updates
  • Comprehensive error handling and logging
  • Cross-platform support (Windows, Linux, macOS)

Installation

pip install gloom-core

Quick Start

Basic browser automation:

fromaskgloom.coreimportBrowser# Initialize and use browser with context managerwithBrowser() asbrowser:
browser.navigate("https://crate.lol")
browser.screenshot("homepage.png")
# Get page contenttitle=browser.get_element_text("h1.title")
print(f"Page title: {title}")

Custom profile configuration:

fromaskgloom.coreimportProfile, Browser# Create custom profileprofile=Profile("my_profile")
profile.preferences.update({
"browser": {
"window_size": {"width": 1920, "height": 1080},
"user_agent": "Custom User Agent",
"download_path": "/custom/download/path"
}
})
profile.save_preferences()
# Use profile with browserwithBrowser(profile=profile) asbrowser:
browser.navigate("https://crate.lol")

Advanced configuration:

fromaskgloom.coreimportConfig, Browser# Configure browser behaviorconfig=Config()
config.set("browser.headless", True)
config.set("automation.retry_attempts", 5)
config.set("automation.screenshot_on_error", True)
# Use configurationbrowser=Browser(options=config.get("browser"))

Documentation

For detailed documentation, visit crate.lol/docs

Setup

# Clone the repository
git clone https://github.com/ask-gloom/gloom-core.git
cd gloom-core
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate# Install development dependencies
pip install -e ".[dev]"

Testing

# Run tests
pytest
# Run tests with coverage
pytest --cov=askgloom
# Run specific test category
pytest tests/test_browser.py -v

Code Quality

# Format code
black askgloom tests
isort askgloom tests
# Type checking
mypy askgloom
# Lint
flake8 askgloom tests

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made by Ask Gloom

About

Gloom is a conversation engine built in C++ and Rust that emphasizes pluggable architecture and platform independence.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages