Repository navigation
Releases
PyCRMKit v1.2.0 — Campaign Metadata Stable
PyCRMKit v1.2.0 — Campaign Metadata Stable
PyCRMKit 1.2.0 delivers the stable Campaign 1.2 contract, promoted from the qualified v1.2.0rc1 candidate. The release includes a concise README that is also embedded as the PyPI long description. No new delivery engine, tenant/IAM provider, public API change, or schema migration was introduced by the documentation refresh.
Features
- Campaign metadata, lifecycle, optimistic
expected_revision, and precise PATCH omitted/null/value semantics. - Direct members, captured static Segment sources, deduplicated audience and provenance, attribution references, and CommunicationRecord linkage metadata (not message delivery).
- Optional FastAPI and DRF Campaign endpoints with host-owned identity, authorization, resource, scope and tenant policy.
- Bounded CSV/JSON/JSONL direct-member import (up to 1,000 rows) and paginated direct/audience/source exports.
- In-memory, SQLAlchemy/PostgreSQL, and Django ORM persistence adapters, with separately managed migrations.
- Updated GitHub/PyPI-compatible README, preserved changelog and exact README-to-wheel/sdist metadata parity gate.
Source-exact qualification
- Qualified merged
mainsource SHA:e0ae1c67ccc488918dbef845b799caf7aba3ab70(PR #114). - Source tree SHA:
7675dd7a4d9c3a9edbbfce0e13860d84e9e21e7d. - Exact-
mainpush workflows: 33/33 successful; check runs: 83/83 successful. - Global test matrix: Python 3.11, 3.12 and 3.13 each 1,255 passed, 44 skipped; the dedicated adapter, migration, PostgreSQL and documentation gates also passed.
- Wheel and sdist inspected, including the exact source README embedded in
METADATA,PKG-INFOand archivedREADME.md. - Qualified CI wheel/sdist: run #41086458905, artifact ID
12991098791. - Four GitHub release assets: wheel, sdist, SHA256SUMS and JSON provenance manifest. Verify the published SHA-256 values before installation.
Operational boundaries
The host application owns IAM, tenant authorization, secrets, retention, database backup/recovery and migrations. Imports may partially commit and require reconciliation. Offset exports are not snapshot-consistent under concurrent writes. The library is not a hosted CRM, a message delivery service or a compliance certification.
Distribution
The GitHub stable release is the initial verified publication channel. PyPI publication is a separate, explicitly approved action. The GitHub release itself does not imply pip install pycrmkit==1.2.0 is available. Check PyPI separately, and only upload the exact wheel and sdist verified against this release's checksums.
Tagged-source documentation may retain prepublication labels until LOT-32-013 post-release reconciliation; use the published release, immutable annotated tag and independently verified asset bytes as evidence of GitHub publication.
PyCRMKit v1.2.0rc1 — Campaign Production Qualification
PyCRMKit 1.2.0rc1 — Campaign Production Qualification
Release candidate of the 1.2 Campaign contract. Adds no new messaging
engine, tenant/IAM provider or stable API promise. Includes Campaign
metadata, audience/Segment snapshots, attribution references,
CommunicationRecord link metadata, optional secure FastAPI/DRF
integration, bounded CSV/JSON/JSONL data operations and Memory,
PostgreSQL/SQLAlchemy and Django persistence adapters.
Qualification
- Exact post-merge source: 5113ced
- 27/27 source-main GitHub Actions workflow runs successful.
- Python 3.11, 3.12 and 3.13; isolated wheel/sdist and optional extras.
- Real PostgreSQL 17 migration and signed-reference-host integration.
- SHA256SUMS and source-provenance manifest attached.
Important limitations
Hosts provide trusted authentication, authorization, secrets/TLS,
tenant policy and private-data controls; no embedded IAM.
Import is bounded and can partially commit; export is not
snapshot-consistent under concurrent writes. CSV opened in a spreadsheet
needs a consuming-host formula guard. Stable 1.2.0 is a separate release.
This GitHub prerelease is NOT a claim of publication to PyPI.
PyCRMKit v1.2.0b3 - HTTP + Data Operations Integration
PyCRMKit v1.2.0b3 - HTTP + Data Operations Integration
Beta prerelease. Qualified source SHA: 76aff82.
Overview
This beta extends the existing crm.campaigns facade with optional HTTP exposure over FastAPI and Django REST Framework and provider-neutral direct-member import/export. The core remains headless; no web stack or ORM is required by a core-only installation.
Campaign HTTP endpoints are opt-in, protected by an explicitly configured host-authenticated principal resolver and authorization policy. Unsigned X-Actor-ID headers never grant Campaign identity or permission. Existing non-Campaign routes keep their prior compatibility behavior; they are not retroactively protected by this new boundary.
Delivered scope
HTTP: FastAPI and DRF parity
- Campaign create, list, retrieve, PATCH and lifecycle (activate, complete, archive), with optimistic revision preconditions.
- Direct Campaign member list/add/remove.
- Deduplicated audience list and count across direct members and captured Segment sources.
- Segment source attach/refresh/detach and captured provenance.
- Attribution reference list/add/remove and CommunicationRecord link metadata list/link/unlink.
- Host-owned action/resource/scope authorization, bounded pagination (1 to 200), typed input schemas and standardized errors.
- Negative tests for forged actor headers, unauthorized list counts and private CommunicationRecord content.
- Cross-transport rendered JSON parity tests across FastAPI and DRF against the same Memory-backed CRM.
Not in scope: messaging/email delivery, marketing automation, attribution scoring, campaign journeys, full CommunicationRecord content endpoints, an HTTP file-upload interface or cross-tenant filtering performed after pagination.
Data Operations: Python API
import_campaign_members(...)consumes existingCSVReader,JSONReader,JSONLReader,ImportReader,ImportReportand mapping primitives. This is a bounded (1-1000 rows) direct membership only operation.- Duplicate detection is based on existing direct members and successfully inserted rows. Existing captured Segment members are not classified as direct duplicates; Segment snapshots are never mutated.
- Missing CRM entity references are row validation failures. Unexpected business/storage errors propagate; earlier successfully committed rows can remain. There is no global batch transaction or exactly-once promise.
export_campaign_records(..., kind="direct"|"audience"|"sources", format="csv"|"json"|"jsonl")reads bounded facade pages and uses the existing exporters. The audience export is deduplicated, but not snapshot-consistent during concurrent writes.
Backend coverage
- Memory, SQLAlchemy/PostgreSQL and native Django Campaign persistence use the existing
crm.campaignscontract. - No new persistence tables or migrations in b3. The earlier Alembic
0006_campaign_persistenceand Django0004_campaign_persistence/0005_communication_record_storeretain ownership. The physical SQLAlchemy and Django Segment-source schemas are not interchangeable and must not be migrated by both tools against one physical schema. - The earlier frozen public
ImportPipelinedataclass shape andImportStageenum remain unchanged.
Integration examples and docs
- Campaign overview
- Trusted Campaign HTTP integration
- FastAPI adapter
- DRF adapter
- Campaign DataOps
- Cross-transport qualification
- Campaign security and linkage contract
Runnable core-only scenario: python examples/data_operations/campaign_scenario.py. It is exercised from the source checkout, installed wheel and installed sdist by the data-operations-e2e workflow. The HTTP examples require their documented optional dependencies and a real, configured application authorization policy.
Package installation after verified publication
python -m pip install --pre "pycrmkit==1.2.0b3"
python -m pip install --pre "pycrmkit[fastapi]==1.2.0b3"
python -m pip install --pre "pycrmkit[django,drf,postgresql]==1.2.0b3"These commands are future installation instructions, not evidence that the version currently exists on PyPI. Before publication, use a local qualified source checkout or a verified wheel.
Main checks: 24/24. Build run: 40763215723. SHA256SUMS attached.
PyPI publication is separate and not implied.
PyCRMKit v1.2.0b2 - Django Campaign Persistence
PyCRMKit v1.2.0b2 - Django Campaign Persistence
Beta prerelease. Qualified source SHA: e4abf03.
Summary
The existing crm.campaigns facade can now persist Campaign data using the
optional Django ORM adapter. Domain API signatures and business invariants
remain unchanged for Memory and SQLAlchemy/PostgreSQL clients. The release
adds no new Campaign HTTP/DRF routes or marketing-delivery behavior.
Included
Six native Django Campaign tables, managed by additive migration
0004_campaign_persistence on top of 0003_segmentation:
pycrmkit_campaigns
pycrmkit_campaign_members
pycrmkit_campaign_segment_sources
pycrmkit_campaign_segment_members
pycrmkit_campaign_attributions
pycrmkit_campaign_communication_links
The implementation includes domain/ORM codecs, repositories and
DjangoTransactionBridge capabilities campaigns,
campaign_audience and campaign_linkage, sharing the same Django
transaction and on_commit event-publication boundary.
Campaign revisions use a compare-and-swap update under PostgreSQL.
Audience reads compose direct members and captured Segment members with
SQL UNION DISTINCT, including database-side pagination and counts.
Attribution uniqueness preserves external_ref=None via the database
representation "".
Segment-source identity is internal to Django. A technical BigAutoField
source PK and a real captured-member source_id FK preserve database
integrity without exposing ORM identifiers through the domain API.
Django CommunicationRecord boundary
A separate additive migration 0005_communication_record_store adds
native Django CommunicationRecord persistence. A narrow transactional
DjangoCommunicationRecordStore provides record save and lookup, enabling
the Campaign facade to validate that a record exists before linking it and
to hydrate linked records.
Scope limit: this is not the full Django
CommunicationRepository protocol. It does not implement
Communication intents, provider delivery attempts, delivery events, email
sending, queueing, or marketing operations. The Django UoW exposes
communication_records rather than falsely claiming the full
communications capability.
Compatibility and migration safety
- Python 3.11, 3.12 and 3.13; Django 5.2.x; optional DRF 3.18.x.
- The core wheel continues to import without Django/DRF dependencies.
- Existing Memory and SQLAlchemy Campaign contracts remain available.
- Previously published b1 Alembic migration
0006_campaign_persistence
and all historical release artifacts remain unchanged. - Django and SQLAlchemy Campaign tables have different physical
Segment-source FK layouts, despite sharing table names. Never independently
run Django and Alembic migrations against those same physical tables.
Use separate databases/schemas with one schema owner. - Django ORM-level
on_delete=CASCADEmust not be misrepresented as
PostgreSQL-nativeON DELETE CASCADE.
Installation (once publication is verified)
python -m pip install --pre "pycrmkit[django,postgresql]==1.2.0b2"
python manage.py migrate pycrmkit_crmBefore publication, install from a verified internal wheel or source
checkout; the command above does not assert current availability on PyPI.
A Django application that has registered
pycrmkit.integrations.django.apps.PyCRMKitDjangoConfig can construct its
CRM facade with DjangoTransactionBridge and use the existing
crm.campaigns.create/get/add_member/attach_segment_source/add_attribution/ link_communication methods. Linked CommunicationRecord objects must
actually be stored in the Django record store; they are not fabricated.
Main checks: 24/24. Build run: 40689320890. SHA256SUMS attached.
PyPI publication is separate and not implied.
PyCRMKit 1.2.0b1 - SQLAlchemy/PostgreSQL Campaign Persistence
PyCRMKit 1.2.0b1 — SQLAlchemy/PostgreSQL Campaign Persistence
This release implements PV1-LOT-011.
Delivered
PyCRMKit now persists the complete Campaign contract introduced across
1.2.0a1 through 1.2.0a3 with the SQLAlchemy/PostgreSQL adapter.
Campaign
├── metadata / lifecycle / optimistic revision
├── direct audience members
├── attached Segment sources
│ └── captured Segment members
├── attribution references
└── communication links
The public crm.campaigns facade remains unchanged. Applications switch
storage adapters without receiving ORM models or SQLAlchemy expressions.
SQLAlchemy persistence
The beta adds six Campaign-owned tables:
pycrmkit_campaigns
pycrmkit_campaign_members
pycrmkit_campaign_segment_sources
pycrmkit_campaign_segment_members
pycrmkit_campaign_attributions
pycrmkit_campaign_communication_links
Ownership foreign keys cascade only inside the Campaign aggregate boundary.
There are deliberately no database foreign keys from Campaign persistence to
Segment, CommunicationRecord, Contact, Organization, Lead or Opportunity.
Those remain cross-aggregate references and preserve the same semantics as the
Memory adapter.
Unit of Work
SQLAlchemyUnitOfWork now exposes:
campaigns
campaign_audience
campaign_linkage
All three repositories share the same SQLAlchemy Session as the rest of the
CRM repositories.
Therefore multi-table Campaign operations remain atomic:
Campaign mutation
+ audience / linkage persistence
+ Audit
+ staged DomainEvent
↓
single database commit
↓
post-commit event publication
A rollback clears all uncommitted Campaign rows and staged events.
Optimistic concurrency
Campaign updates use an atomic SQL compare-and-swap:
UPDATE pycrmkit_campaigns
SET ...
WHERE id = :campaign_id
AND revision = :previous_revisionA stale writer cannot silently overwrite a committed revision. Competing
PostgreSQL transactions are qualified to converge to one successful update and
one campaign.revision.conflict.
Audience persistence
Direct members and captured Segment members retain provenance independently.
The final Campaign audience is computed from:
direct members
UNION
captured Segment members
The SQL UNION is the canonical de-duplication boundary. Pagination and
audience_count() derive from the same relation.
Attaching or refreshing a Segment source validates the complete capture before
mutation. The source row is persisted before its captured members inside the
same transaction so PostgreSQL ownership constraints remain valid without
weakening rollback atomicity.
Attribution uniqueness
The Memory contract treats an absent external reference as part of the logical
attribution key.
SQL persistence therefore normalizes:
Domain None
↕
Database ""
This preserves duplicate protection on PostgreSQL where ordinary nullable
unique columns would otherwise allow multiple NULL values.
Migration 0006
Alembic head advances:
0005_segmentation_persistence
↓
0006_campaign_persistence
Revision 0006 is additive:
- no existing V1 or 1.1 table is altered;
- existing rows are untouched;
- the six Campaign tables are created in dependency order;
- downgrade removes only the six Campaign tables;
- the migration exists in both the development and packaged migration trees.
Qualification covers:
empty database → head
0005 → 0006
0006 → 0005
0005 → 0006 again
Base.metadata drift == []
stable 1.1 fixture preserved
packaged migration == development migration
Repository and PostgreSQL qualification
The beta includes mirrored Memory/SQLAlchemy repository contracts for Campaign,
Audience and Linkage semantics.
Live PostgreSQL qualification covers:
- Campaign revision races;
- concurrent duplicate direct members;
- concurrent duplicate attributions including
external_ref=None; - ownership constraints;
- atomic Segment capture rollback;
- no event publication on rollback;
- timezone-aware timestamp round trips;
- nested JSON metadata round trips.
Historical 1.1 evidence
PyCRMKit 1.1 remains the stable compatibility baseline.
The frozen 1.1.0rc1 and 1.1.0 checksums and migration-head evidence are
not modified by this release. Their reproducibility workflow pins the original
qualified build toolchain so later setuptools/Python patch releases cannot
create false artifact drift.
Explicitly deferred
1.2.0b2
Django Campaign Persistence
1.2.0b3
HTTP + Data Operations Integration
1.2.0rc1
Campaign Production Qualification
1.2.0
Campaign Metadata Stable
No email design, marketing-delivery engine, advertising platform management,
journey execution or advanced attribution model is introduced by this beta.