Skip to main content

Core API for dwellir-harvester: collector bases, types, loaders, and helpers.

Project description

Dwellir Harvester Lib

Core SDK for building and running Dwellir harvesters. It provides the collector base classes, loader helpers, RPC utilities, and the shared blockchain metadata schema used by dwellir-harvester.

Features

  • Collector base classes (CollectorBase, GenericCollector, BlockchainCollector) with result/metadata helpers
  • Collector loader with plugin paths and entry point support
  • Schema validation helpers and bundled blockchain_node_metadata.schema.json
  • Simple runner to execute a collector class directly (python -m dwellir_harvester.lib.run)
  • RPC helpers for JSON-RPC, Substrate, and EVM-compatible nodes

Installation

python -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

from dwellir_harvester.core import collect_all, bundled_schema_path

result = collect_all([
    "host",  # or your plugin collector name
], schema_path=bundled_schema_path())
print(result)

Run a collector class directly (module:Class):

# Built-in null collector
python -m dwellir_harvester.lib.run dwellir_harvester.collectors.null:NullCollector

# From the dwellir_harvester package
python -m dwellir_harvester.lib.run examples.plugins.sample_collector:SamplePluginCollector

Packaging notes

  • Python 3.9+
  • Entry point group for collectors: dwellir_harvester.collectors
  • Bundled schema is included as package data under dwellir_harvester/data/

Building (offline-friendly)

Use the sibling checkout pattern:

  1. Make sure you have a venv with build tools (and system site packages to avoid missing setuptools):
    python3 -m venv --system-site-packages .venv
    source .venv/bin/activate
    pip install --upgrade pip build
    
  2. Build the library without isolation (reuses your env, no downloads):
    python -m build --no-isolation
    

Artifacts land in dist/ (.whl and .tar.gz). If you depend on this from the app as a sibling path, the existing file:../dwellir-harvester-lib PEP 508 spec in the app works; for publishing, set a versioned requirement there instead.

Publish (Python package)

# build
python3 -m pip install build twine
python3 -m build  # creates dist/*.tar.gz and dist/*.whl

# upload to TestPyPI first (recommended)
python3 -m twine upload -r testpypi dist/*

# Install from testpypi
python3 -m venv .venv
source .venv/bin/activate
# Pull in deps from real, this is needed only on testpypi 
pip3 install jsonschema>=4.25.1 psutil>=7.1.3 requests>=2.32.5
# Install from testpypi
pip3 install --index-url https://test.pypi.org/simple/ --no-deps dwellir-harvester-lib

# then to PyPI
python3 -m twine upload dist/*

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

dwellir_harvester_lib-0.0.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

dwellir_harvester_lib-0.0.1-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file dwellir_harvester_lib-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for dwellir_harvester_lib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0fa04891d1057a8430c555b60906775e08767a1ab10f337ccb90688af6a38db3
MD5 dc4a47f6e8bd2daf40490666b399d134
BLAKE2b-256 a6e2788f2b378be8acca41a37163fe4b14da2ef8cfb5a7cae7d62e555b8bd1b6

See more details on using hashes here.

File details

Details for the file dwellir_harvester_lib-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dwellir_harvester_lib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c38116d1a8a3c928207dd904dd5ff309759531faa64a46308f42024d6f6d1e28
MD5 97f0f193fc78d5b120e93b912d240e2e
BLAKE2b-256 d273183c01d7c6735a0ea369e47ae635325a354dc4e9f06ca589db68717b6c29

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