Skip to main content

university-subscriptions

Premium plans, paid periods and entitlements other modules can check.

An optional level-two module of the University platform.

Installation

pip install university-subscriptions university-payments
INSTALLED_APPS = [
    # ...
    *CORE_APPS,
    "university.payments",
    "university.subscriptions",
]

Run python manage.py migrate. The API is mounted under /api/v1/subscriptions/.

How it works

  1. GET plans/ lists the plans, prices and what each includes.
  2. POST me/ with {plan, interval, currency} chooses a plan. The response's payment_due is passed to POST /api/v1/payments/checkout/ (purpose subscriptions.period).
  3. When the payment succeeds the subscription becomes active for one interval.
  4. Renewals are paid by the member (no stored cards) from RENEWAL_WINDOW_DAYS before the period ends. A reminder goes out REMINDER_DAYS before, and entitlements continue for GRACE_DAYS after an unpaid period ends, then the subscription expires.
  5. POST me/cancel/ stops renewing; the plan lasts until the paid period ends.

Run the university.subscriptions.sweep task (or call services.sweep()) every hour.

Entitlements

Plans grant entitlement keys. Any module can check them through Core, without depending on this package:

from university.core.entitlements import has_entitlement

if has_entitlement(request.user, "creator.analytics_pro"):
    ...

premium.ad_free hides adverts in university-promotions; premium.badge adds premium: true to public profiles.

Configuration

UNIVERSITY = {
    "SUBSCRIPTIONS": {
        "PLANS": {
            "plus": {
                "name": "Plus",
                "description": "No adverts and a profile badge.",
                "prices": {"month": {"NGN": 150000}, "year": {"NGN": 1500000}},
                "entitlements": ["premium.ad_free", "premium.badge"],
            },
        },
        "GRACE_DAYS": 3,
    },
}

A double payment, or a payment for the wrong amount, is refused and refunded by university-payments. A refunded period is taken back off the subscription.

Metadata

Release files for university-subscriptions 0.1.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 university-subscriptions 0.1.0
File Size Uploaded Provenance Actions
university_subscriptions-0.1.0.tar.gz 13.1 kB With provenance Details for university_subscriptions-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for university-subscriptions 0.1.0
File Interpreter ABI Platform Actions
university_subscriptions-0.1.0-py3-none-any.whl Python 3 none any Details for university_subscriptions-0.1.0-py3-none-any.whl

Total release size: 29.7 kB

Release files / university_subscriptions-0.1.0.tar.gz

Download URL university_subscriptions-0.1.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8e2f8f15e4dc485a8ff6471ad08285b54a90eb34d09d8311bb1b71a7c9d1f93d
BLAKE2b-256 checksum
How to use checksums
498dc0e2ecb71f41970e84fd5cdbe658661ae1e2de4562549eb44f2cb421f4f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / university_subscriptions-0.1.0-py3-none-any.whl

Download URL university_subscriptions-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
641cc2e60c3cbfc44b21ad77bd22b35cd3c9a3853bbfc492200a3abd3e9d93c8
BLAKE2b-256 checksum
How to use checksums
0fe48287f4c5524ba1065f01290d61bea85c4d383cc1793d97c1c441fddd60bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for university-subscriptions 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for university_subscriptions-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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