Current collected state Current
Observed since 20 Oct, 21:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
High-performance web scraping and MongoDB utilities
High-performance web scraping and MongoDB utilities for Python.
pip install agastya
from agastya import fetch, CustomLogger, Record
# Initialize logger
logger = CustomLogger(name=__file__)
# Fetch with caching
response = fetch(
url="https://example.com",
save_dir="cache",
filename="page.html",
max_retries=3
)
# Work with MongoDB records
from pymongo import MongoClient
db = MongoClient()['mydb']
collection = db['items']
doc = collection.find_one({"_id": "123"})
record = Record(doc, collection, logger)
# Mark states
record.mark_done("scraped", meta={"items": 42})
record.mark_fail("parsed", meta={"error": "timeout"})
Create a config.py in your project root:
from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017")
db = client['your_database']
Smart caching with validation:
response = fetch(
url="https://example.com/data",
save_dir="cache",
filename="data.html",
valid_rules={
"required": ["expected text"],
"forbidden": ["error", "404"],
"remove": True # delete invalid cache
}
)
Concurrent processing:
from agastya import run_engine
from pymongo import MongoClient
db = MongoClient()['mydb']
collection = db['tasks']
def worker(doc):
# Process document
print(f"Processing {doc['_id']}")
query = {"status": "pending"}
run_engine(collection, query, worker, THREADS_START=50)
# Clone repository
git clone https://github.com/yourusername/agastya.git
cd agastya
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
MIT License - see LICENSE file for details
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.2.1 | 5 Jan 2026 | 4 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:5d471f8b0ee32c46eac64310660082c89fd7eda75290ee0b0ffd23abc3024bd3