Skip to content

feat: add Little Green Light gift ingest preset - #312

Merged
shivamlalakiya merged 15 commits into
PhilanthroPy-Project:mainfrom
jimoholayinka01:feat/little-green-light-ingest
Nov 4, 2026
Merged

shivamlalakiya merged 15 commits into
PhilanthroPy-Project:mainfrom
jimoholayinka01:feat/little-green-light-ingest

Conversation

@jimoholayinka01

@jimoholayinka01 jimoholayinka01 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add little_green_light_gifts_to_features and read_little_green_light_gifts for Little Green Light gift exports.
  • Normalize LGL export headers to the canonical gift columns and delegate aggregation to the shared CiviCRM implementation.
  • Exclude pledge commitments from received-gift totals by default, while keeping gift/payment rows. Warn when the export has no gift-type column.
  • Register source="little_green_light" with read_gifts.

Source documentation

The reader excludes the normalized Pledge gift type by default so the commitment is not counted alongside its received payments.

Validation

  • tests/test_little_green_light.py
  • tests/test_read_gifts.py

Closes #238
Closes #238

Checklist

  • make ci passes locally (lint → collection → tests → coverage ≥ 92%)
  • New/changed public API has docstrings and is exported in the subpackage __init__.py
  • Tests added or updated
  • CHANGELOG.md updated under [Unreleased]
  • Added yourself to CONTRIBUTORS.md (skip if you would rather not be listed)

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks, the core of this is good. Excluding Pledge by normalised gift type, warning when there is no gift-type column, the typed empty frame when every row is a pledge, and delegating to the shared CiviCRM aggregator all match the Raiser's Edge pattern. The header aliases cover the labels LGL's "Mapping gift fields" article uses (LGL Constituent ID, Gift Date, Gift Amount). Changes are needed before merge:

Blocking

  1. CHANGELOG.md: an editor formatter rewrote about 100 lines of the file and broke its Markdown. Continuation lines under list items lost their indent (for example fiscal_year_and_quarter, Contact: the Account always wins..., upgrade flags...), two code spans merged in the demographic_parity_difference entry (`min(selection_rate)`across ... `disparate_impact_ratio`), v*.*.* became v*.*.\*, and *x* emphasis became _x_ throughout. Please reset the file to main (git checkout origin/main -- CHANGELOG.md) and add only your entry.
  2. PR body: feat: add a Little Green Light gift export reader (ingest preset) #238 asks for the LGL doc URLs you verified to go in the PR body (as Add a Salesforce NPSP Opportunity export reader #233 did for NPSP), plus Closes #238. The template is still empty. In particular, cite where the Pledge gift-type value and the pledge-vs-payment split come from. The "Mapping gift fields" article names the columns but does not list gift-type values.

Should fix

  1. philanthropy/ingest/__init__.py: feat: add a Little Green Light gift export reader (ingest preset) #238 asks for __all__ in alphabetical order, and the three new names are appended at the end. Please also remove the extra blank line added before __all__.
  2. philanthropy/ingest/_read_gifts.py: the "little_green_light" registry entry's inner lines are not indented, the blank line before __all__ was dropped, and the read_gifts docstring's **kwargs list should mention exclude_gift_types= for "little_green_light".
  3. docs/reference/index.md: the new row is missing its trailing |, and there is a stray blank line before ### Tier 2: Beta.
  4. tests/test_read_gifts.py: read_little_green_light_gifts, in the import list is not indented, there is a double space in the GIFT_SOURCES set, there are missing blank lines and a whitespace-only line between the new tests, and the file has no trailing newline. _little_green_light.py and test_little_green_light.py also lack a trailing newline.

Once the CHANGELOG is reset and the body cites the sources, I'm happy to take another look.

Changes
@jimoholayinka01

Copy link
Copy Markdown
Contributor Author

I have now restored the changelog to its pre-formatter version, preserving the existing entries and keeping only my Little Green Light entry. I also fixed the requested export ordering, registry formatting and docstring, reference-table formatting, and test-file whitespace/newlines. The focused tests passed: 43 passed.

I drafted the PR description with the LGL documentation links and Closes #238; I haven’t updated the GitHub PR itself, so that part still needs to be pasted there.

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for the follow-up. The CHANGELOG is now clean (only your entry), the PR body cites the LGL sources with Closes #238, and the registry, docstring, and whitespace fixes all look right.

Two things before this can merge:

  1. Rebase on main. The branch now conflicts: main has since added the nonprofit_cloud and blackbaud_crm sources to GIFT_SOURCES, _REGISTRY, the read_gifts docstring, and ingest/__init__.py. Please rebase (or merge main) and add "little_green_light" alongside them.
  2. __all__ ordering in philanthropy/ingest/__init__.py. The list was re-sorted case-insensitively, which moved the existing DEFAULT_* and GIFT_SOURCES entries. The file's convention is plain ASCII order (uppercase constants first), so please leave the existing entries where they are and insert only your three names in that order: DEFAULT_EXCLUDED_LGL_GIFT_TYPES after DEFAULT_EXCLUDED_GIFT_TYPES, and the two functions in their lowercase positions. Likewise, the from ._little_green_light import ... lines in both __init__.py and _read_gifts.py belong in alphabetical position (after ._donorperfect in _read_gifts.py, after ._donorperfect and before ._map_columns in __init__.py) rather than after ._raisers_edge.

Optional: if you'd like to be credited, add yourself to CONTRIBUTORS.md.

@jimoholayinka01

Copy link
Copy Markdown
Contributor Author

All requirements completed.

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for the rebase, the code side looks right now: little_green_light sits in GIFT_SOURCES, _REGISTRY, and __all__ next to the newer sources, and CI is green. Three things in the merge still need fixing before this can go in:

  1. CHANGELOG.md was mangled by the merge. Against main, the file gains about 230 lines: a whole block of 0.9.0 entries (### Changed, ### Fixed, ### Removed, ### Documentation, and several more ### Added sections) is now duplicated, so for example "KDD Cup 1998 feature checks" appears twice. Please reset the file to main's version (git checkout origin/main -- CHANGELOG.md) and re-add only your entry.
  2. The entry is under the wrong release. It currently lands in ## [0.9.0] - 2026-10-12 / ### Added, which has already shipped. It belongs under ## [Unreleased] / ### Added at the top of the file.
  3. .vscode/settings.json should not be committed. It's a personal editor setting; please drop it from the branch.

Once those are done this should be ready to merge.

@jimoholayinka01

Copy link
Copy Markdown
Contributor Author

I have now made the 3 changes, if you would like to have a look. Since my fork has a rebase issue earlier, thanks

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for the update. The code is ready: _little_green_light.py, the GIFT_SOURCES / _REGISTRY entries, the __all__ placement, the reference-table row, the CONTRIBUTORS entry, and both registry tests all look right, and CI is green.

One blocker left, and it is the same file again:

CHANGELOG.md lost about 1,060 lines. On main the file is 2,373 lines with ## [Unreleased], ## [0.9.0], ## [0.8.0], ## [0.7.1], ... in order. On this branch it is 1,313 lines: the current [Unreleased] entries (for example the #53 and #55 test entries), and the whole [0.9.0] and [0.8.0] sections are gone, a second ### Added block from older history now sits inside [Unreleased], and the PlannedGivingSignalTransformer line from 0.8.0 got pulled up next to your entry. CI's changelog check only looks for an added entry, so it doesn't catch deletions.

The simplest fix, from your branch:

git fetch upstream            # or whatever your remote for PhilanthroPy-Project/PhilanthroPy is called
git checkout upstream/main -- CHANGELOG.md

Then add only your four-line Little Green Light bullet at the end of the existing ### Added list under ## [Unreleased], commit, and push. git diff upstream/main -- CHANGELOG.md should show exactly those four + lines and no - lines. Please avoid running an editor formatter on the file, that is what keeps rewriting it.

Once the diff is just that, this is ready to merge.

@jimoholayinka01

Copy link
Copy Markdown
Contributor Author

All changes done ready for check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add a Little Green Light gift export reader (ingest preset)

3 participants