Skip to main content

Crawler and search tools used by Sirji.

Project description

Sirji Logo

Sirji is an Open Source AI Software Development Agent.

Built with ❤️ by True Sparrow

GitHub License GitHub commit activity GitHub Issues or Pull Requests PyPI sirji-tools

GitHub Repo stars GitHub forks GitHub watchers

Sirji Tools

sirji-tools is a PyPI package that provides tools for:

  • Crawling (downloading web pages to markdown files)
  • Searching on Google
  • Custom Logging

Installation

Setup Virtual Environment

We recommend setting up a virtual environment to isolate Python dependencies, ensuring project-specific packages without conflicting with system-wide installations.

python3 -m venv venv
source venv/bin/activate

Install Package

Install the package from PyPi:

pip install sirji-tools

Run the following command to install playwright:

playwright install

Usage

Environment Variables

Ensure that following environment variables are set:

export SIRJI_WORKSPACE="Absolute folder path for Sirji to use as it's workspace."
export SIRJI_RUN_PATH='Folder having run specific logs, etc.'

Crawl URLs

Crawl URLs tool will be used to crawl the web pages and extract the information from the web pages. And store the information for the further processing by researcher.

from sirji_tools import crawl_urls

urls = ['https://www.google.com', 'https://www.yahoo.com']

crawl_urls(urls, 'workspace/researcher')

Search

Search tool will be used to search the information from the web pages based on the search terms provided. It returns the list of URLs related to the search terms.

from sirji_tools import search_for

search_term = 'python programming'

urls = search_for(search_term)

Logger

Logger tool will be used to log the information in the log file. It will be used to log the information to show the progress of the execution.

from sirji_tools.logger import p_logger

p_logger.info("Log line here")

For Contributors

  1. Fork and clone the repository.
  2. Create and activate the virtual environment as described above.
  3. Set the environment variables as described above.
  4. Install the package in editable mode by running the following command from repository root:
pip install -e .
  1. Run the following command to install playwright:
playwright install

Running Tests and Coverage Analysis

Follow the above mentioned steps for "contributors", before running the test cases.

# Install testing dependencies
pip install pytest coverage

# Execute tests
pytest

# Measure coverage, excluding test files
coverage run --omit="tests/*" -m pytest
coverage report

License

Distributed under the MIT License. See LICENSE for more information.

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

sirji_tools-0.0.11.tar.gz (11.0 kB view hashes)

Uploaded Source

Built Distribution

sirji_tools-0.0.11-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

Supported by

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