Skip to main content

Stealth-oriented utilities for web scraping with rotating user agents, proxies, and Selenium helpers.

Project description

SQLite Forge

SQLite Forge is a lightweight toolkit that helps you declare and maintain SQLite tables from Python. Define your schema once, then manage tables, run queries, ingest pandas DataFrame objects, and export results.

Highlights

  • Declarative table definitions with schemas and optional multi-column primary keys
  • Safe helpers to create/drop tables and check existence
  • DataFrame ingestion with optional incremental overwrite support
  • Query execution that returns pandas DataFrame objects
  • Table export helpers for csv, json, and parquet

Installation

pip install sqlite-forge

For development:

git clone https://github.com/Tom3man/sqlite-forge.git
cd sqlite-forge
poetry install --with dev --with docs

Quick Start

from pathlib import Path

import pandas as pd

from sqlite_forge import SqliteDatabase


class ExampleTable(SqliteDatabase):
    DEFAULT_PATH = "example_table"
    PRIMARY_KEY = ("id",)
    DEFAULT_SCHEMA = {
        "id": "INTEGER",
        "name": "TEXT",
        "score": "REAL",
    }


db = ExampleTable(database_path=Path("./data"))
db.create_table(overwrite=True)

db.ingest_dataframe(
    pd.DataFrame(
        [
            {"id": 1, "name": "Alice", "score": 9.2},
            {"id": 2, "name": "Bob", "score": 8.7},
        ]
    )
)

print(db.fetch_table())
db.export_table("./data/example_table.csv", format="csv")

Development

poetry run pytest
poetry run ruff check .
poetry run mypy
poetry build

Documentation

poetry run mkdocs serve

Release

  1. Bump version in pyproject.toml.
  2. Update CHANGELOG.md.
  3. Publish:
poetry publish --build

Changelog

See CHANGELOG.md.

Licence

MIT. See LICENSE.

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

orbweaver_tools-1.3.5.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

orbweaver_tools-1.3.5-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file orbweaver_tools-1.3.5.tar.gz.

File metadata

  • Download URL: orbweaver_tools-1.3.5.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-14-generic

File hashes

Hashes for orbweaver_tools-1.3.5.tar.gz
Algorithm Hash digest
SHA256 f797fefd5bca10a998b84ad25440a7e8fc5422c199d4db276ba4e15649af4d4e
MD5 2239068d7555ffc3a5897a709929a5b7
BLAKE2b-256 0396de87c62b93cb4e61c6bf3b324a1310d89946550bc319b819236ced0f1b43

See more details on using hashes here.

File details

Details for the file orbweaver_tools-1.3.5-py3-none-any.whl.

File metadata

  • Download URL: orbweaver_tools-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.17.0-14-generic

File hashes

Hashes for orbweaver_tools-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a79a81df60f0248285887a0ca6b5ad27134c33db60d8bff17c512b620202e6
MD5 280d05ff2d03a90fb29e89b846c0015c
BLAKE2b-256 a623c3f51264839ebcfa3bf870284aa630282e6f8bd9268b3b53f60657d90bcb

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