Skip to main content

Haystack — Salesforce NPSP

A Haystack 2.x component that ingests Salesforce Nonprofit Success Pack (NPSP) donor data as Documents for RAG pipelines — no Airbyte, no CDK.

Unlike a raw Salesforce connector, this is NPSP-aware: it understands npo02__ and npsp__ field prefixes and emits human-readable donor summaries (giving totals, gift history, engagement) instead of raw JSON.

Installation

pip install haystack-salesforce-npsp

Credentials

export SF_USERNAME="you@yourorg.org"
export SF_PASSWORD="your_password"
export SF_TOKEN="your_security_token"

Usage

from haystack import Pipeline
from haystack.components.embedders import SentenceTransformersDocumentEmbedder
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack.components.writers import DocumentWriter
from haystack_salesforce_npsp import SalesforceNPSPFetcher

store = InMemoryDocumentStore()

indexing = Pipeline()
indexing.add_component("fetch", SalesforceNPSPFetcher(
    soql_filter="npo02__TotalOppAmount__c > 5000",
    limit=500,
))
indexing.add_component("embed", SentenceTransformersDocumentEmbedder())
indexing.add_component("write", DocumentWriter(document_store=store))
indexing.connect("fetch.documents", "embed.documents")
indexing.connect("embed.documents", "write.documents")

indexing.run({})

Each Document has:

  • .content — narrative donor profile (name, giving summary, recent gifts)
  • .meta — structured donor fields (donor_id, total_gift_amount, gift_count, affiliation, source="salesforce_npsp", …)

Affinity scores

Pass a callable (meta: dict) -> float as affinity_score_fn to inject an ML-derived donor propensity score into every document's metadata at fetch time.

SalesforceNPSPFetcher(affinity_score_fn=lambda m: min(50 + m["total_gift_amount"] / 5000, 100))

Note: because affinity_score_fn is an arbitrary callable, a fetcher configured with one is not YAML-serializable. Instantiate it in Python.

Metadata

Release files for haystack-salesforce-npsp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haystack-salesforce-npsp 0.1.0
File Size Uploaded Provenance
haystack_salesforce_npsp-0.1.0.tar.gz 3.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for haystack-salesforce-npsp 0.1.0
File Interpreter ABI Platform
haystack_salesforce_npsp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / haystack_salesforce_npsp-0.1.0.tar.gz

Download URL haystack_salesforce_npsp-0.1.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a4ba7f4b54627ec41979bdfb966ba22d012bab8b970fdf1aef695e601ceefb61
BLAKE2b-256 checksum
How to use checksums
515f57bbb545d82fbaf1547ce32895bb73fbd7d0796587e081f3f088c1f088be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / haystack_salesforce_npsp-0.1.0-py3-none-any.whl

Download URL haystack_salesforce_npsp-0.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7ce055b7d89178b2472bfbb17bf2354c2396dc5cd219c1fd1da8d6e2c861069
BLAKE2b-256 checksum
How to use checksums
cb5f15a20c2bf7886bb4cf055b83fb63965fcbcd6e4bd6a1c846365c7987688f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Security for haystack-salesforce-npsp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for haystack_salesforce_npsp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page