Skip to main content

PySpark batch analytics: Extract, Transform, Stage, and analytical modules (linear regression, correlation, PCA, t-test).

Project description

Batch Analytics

PySpark-based analytics pipeline for ClickHouse data: ExtractTransformStageAnalytics. Designed to run as the main application inside a Spark driver container (invoked by analytics_runners via SparkApplication CRD).

Bundle contents

Only the files required for the batch analytics job runner:

analytics/
├── pyproject.toml
├── requirements-batch.txt
├── README.md
└── src/
    └── batch_analytics/
        ├── __init__.py
        ├── __main__.py        # python -m batch_analytics
        ├── job_runner.py      # Entry point
        ├── config.py
        ├── extract.py
        ├── transform.py
        ├── log.py
        ├── README.md
        └── analytics/
            ├── __init__.py
            ├── linear_regression.py
            ├── correlation.py
            ├── pca_clustering.py
            └── t_test.py

Install

pip install -e .
# or: pip install -r requirements-batch.txt && pip install -e .

Run

# Via module
python -m batch_analytics

# Via CLI (after pip install -e .)
batch-analytics

# Full pipeline
batch-analytics

# Analytics only (from staged ClickHouse table)
batch-analytics --from-stage --modules lr corr pca ttest

Configuration

See src/batch_analytics/README.md for environment variables and usage.

Docker image

For Spark on Kubernetes, build an image that includes this package and exposes job_runner.py at the path used by mainApplicationFile (e.g. local:///opt/analytics/job_runner.py).

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

batch_analytics-0.2.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

batch_analytics-0.2.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file batch_analytics-0.2.0.tar.gz.

File metadata

  • Download URL: batch_analytics-0.2.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for batch_analytics-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c959948d600c21288fe263f378dcbe9d46ab8e6f598250eb98a9b12f44471310
MD5 193a1ef1ac22d46e58dfc27cbb2c3591
BLAKE2b-256 3d8e763f952d4fd120a6849ef29d10dae7f87b8d722d0145012d5292a6dc5200

See more details on using hashes here.

File details

Details for the file batch_analytics-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for batch_analytics-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a812de7cd903aaa7103839a3d4659d928d433d1084010a370d18470d1b3d4705
MD5 e0fc5044dbf6e457b9ab94d75404d9fe
BLAKE2b-256 fc0cb7d1b62d7edcfba7abd17d9b6266a7c7de5f5b33d92180d85f6eaf585cc9

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