Skip to main content

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.*.

  • 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

Metadata

Release files for django-party 0.3.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 django-party 0.3.0
File Size Uploaded Provenance Actions
django_party-0.3.0.tar.gz 23.8 kB Without provenance Details for django_party-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-party 0.3.0
File Interpreter ABI Platform Actions
django_party-0.3.0-py3-none-any.whl Python 3 none any Details for django_party-0.3.0-py3-none-any.whl

Total release size: 51.9 kB

Release files / django_party-0.3.0.tar.gz

Download URL django_party-0.3.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c6f182d5010ff6feb06ce0e2ed6c102ca8105b38356af3e2388c0b6a2cffbbfc
BLAKE2b-256 checksum
How to use checksums
a3f337cb78b065abf46f4ca782d7e841b0d6415a2581cd140e611e108d4ce4c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / django_party-0.3.0-py3-none-any.whl

Download URL django_party-0.3.0-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03be00260834b36098d3129e9524e8b7c99d1036838e7bd939f91063694499fc
BLAKE2b-256 checksum
How to use checksums
cabc849f8eef040e45d71d5612837484d1bf931c42fab0602545e18252d48386
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for django-party 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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