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

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.1
File Size Uploaded Provenance Actions
django_party-0.3.1.tar.gz 25.0 kB Without provenance Details for django_party-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 53.3 kB

Release files / django_party-0.3.1.tar.gz

Download URL django_party-0.3.1.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
607aa2c0126c196bd1c92c7c7cb4250cf6627a5ae1c6bc63deb225e64558d3e2
BLAKE2b-256 checksum
How to use checksums
4dc434061fffc5aff104c9d2c6163098cda32676f8c3a33f671761e222955958
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.1-py3-none-any.whl

Download URL django_party-0.3.1-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7aa09c275031271ea09333f21639bf00f9012d092c172f19883570321a472fb
BLAKE2b-256 checksum
How to use checksums
1fb041042f52f54a5d4098384f48d703ae7eb631df25ffb8351e053e0e21a292
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.1

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