Skip to content

About

Django party identity hub: contacts, external ids, consent, thin account codes.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

django-party

CI License: MIT PyPI version

Shared party (person/organization) identity for Django sites: contacts, external ids, append-only consent ledger, and thin counterpart account codes.

Not a sales CRM. Not a double-entry ledger.

Requirements

  • Python 3.10+
  • Django 4.2+

Install

pip install django-party
INSTALLED_APPS = [
    # ...
    "party",
    # ...
]

Then migrate:

python manage.py migrate party

Concepts

Model Role
Party Canonical person or organization
ExternalIdentity Multi-source ids (free namespace+scheme+value, e.g. PMS guest id vs fiscal supplier id)
ContactPoint / PostalAddress Channels and addresses with validity
ConsentRecord Append-only privacy/marketing ledger (null ≠ granted)
PartyFact Keyed attributes with validity (IdP snapshots, historical/obsolete facts)
PartyAccount Thin studio account-code metadata (no balances)

ExternalIdentity taxonomy

Pick site-local namespace / scheme strings. Examples:

namespace scheme meaning
pms guest / contact / company hospitality PMS ids
fiscal supplier / cedente fiscal facet primary key
socialprofile user Auth user pk (django-sp sync)
socialprofile google / facebook / twitter / live / instagram / linkedin / discord / github IdP subject uid

Same numeric value may exist under different (namespace, scheme) pairs. An open (namespace, scheme, value) binds to one Party.

Wire PMS/fiscal adapters in the consumer app — not inside party.*.

Consent and account codes

  • Write consent only via record_consent(); admin add/change/delete are closed.
  • Opt in to payload-key refusal via settings, then call refuse_untrusted_consent_mapping:
PARTY_CONSENT_FORBIDDEN_PAYLOAD_KEYS = {
    "privacy_check",
    "privacy_check_from_admin",
    "promotion_check",
    "promotion_check_from_admin",
}
  • PartyAccount.code must be non-empty and not all-digit (external ids are not studio codes).

License

MIT

About

Django party identity hub: contacts, external ids, consent, thin account codes.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages