Skip to main content

A package for browser automation and database management

Project description

Gfruit

一个用于浏览器自动化和数据库管理的Python包。

简介

Gfruit是一个功能强大的Python库,提供了两个主要模块:

  1. browser_use - 基于Selenium的浏览器自动化工具
  2. db_manager - 数据库管理工具

安装

从PyPI安装(推荐)

pip install Gfruit

从源码安装

git clone https://github.com/yourusername/Gfruit.git
cd Gfruit
pip install .

从构建的包安装

pip install dist/gfruit-0.1.0-py3-none-any.whl

使用方法

导入模块

from Gfruit.browser_use import SeleniumBase
from Gfruit.db_manager import DatabaseManager

SeleniumBase 使用示例

# 初始化SeleniumBase
browser = SeleniumBase(ads_id="your_ads_id")

# 初始化WebDriver
driver = browser.init_driver()

# 使用各种浏览器操作方法
browser.button_click("//button[@id='submit']", "点击提交按钮")

DatabaseManager 使用示例

# 初始化DatabaseManager
db = DatabaseManager(host="localhost", user="root", password="password", database="test")

# 使用上下文管理器自动处理连接
with db:
    result = db.fetch_all("SELECT * FROM users")
    print(result)

开发

构建包

# 安装构建工具
pip install build

# 清理旧的构建文件
rm -rf dist/ build/ *.egg-info src/*.egg-info

# 构建新包
python -m build

发布新版本

详细说明请参阅 RELEASE.md 文件。

依赖

  • keyboard
  • requests
  • psutil
  • selenium
  • loguru
  • web3
  • webdriver-manager
  • PyMySQL

许可证

MIT

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

gfruit-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

gfruit-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file gfruit-0.1.1.tar.gz.

File metadata

  • Download URL: gfruit-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for gfruit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 20c71b7a2c39f61430b049156a0639b3c8a2969215e1fdfa1e74b9a98f9850e2
MD5 46c7bcac8829727af9282e9daf50a831
BLAKE2b-256 b1984b85adb600c804b33f848ea07f9c56d026068d13330adebd8366109571f7

See more details on using hashes here.

File details

Details for the file gfruit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gfruit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for gfruit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 820ac76501dfcec107faa3bc0c4e50badc8ed4c2c8bebcadd07d067f6ad7a206
MD5 c66bff9af5e494ed8d5ecc2a0651fc80
BLAKE2b-256 9be5bc517d85b7521a6e0a2cc2ca9344c462ff781f19bd53055d95a14f69bf2b

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