Skip to main content

fancy-fun-lab

Fancified

A headless gamification engine for Python. XP awarded to gamed metrics, levels and weighted level groups, achievements, prizes with inventory, leaderboards (all-time, daily, weekly, monthly and per metric) and an event log with analytics, with zero runtime dependencies.

The Python twin of particle-academy/laravel-fun-lab (PHP), with @particle-academy/fancy-fun-lab (Node) beside it. All three run the same fun-lab/* conformance tables from fancy-conformance in their own CI, so the same awards give the same levels, boards and log in every runtime, and @particle-academy/fancy-fun-lab-ui renders the same JSON whichever backend produced it.

For agents. Every Fancy package, this one included, is listed on the Fancy MCP catalog server at https://ui.particle.academy/mcp (streamable HTTP, no API key; MCP id fancy-ui), with install commands and docs. How an agent installs and uses this package is in AGENTS.md.

What it does

  • XP to gamed metrics ("combat", "crafting", "coins"), with a per-action cap and validation hooks.
  • Levels per metric, and level groups that weigh several metrics together. A level is claimed exactly once, even under concurrent awards.
  • Achievements, granted by hand or automatically when a level is reached, and prizes with inventory and a claim / fulfil lifecycle.
  • Leaderboards all-time, daily, weekly or monthly (on the XP earned in the period), per metric, by awardable type, paged.
  • An event log of every award, grant and catalog change, with analytics: counts, totals, active users, completion rates, time series, breakdowns.
  • Opt-out, honoured everywhere.
  • Stores: in-memory, or SQLite on the standard library using laravel-fun-lab's own tables, so it can share a database with a Laravel app.

Example

from fancy_fun_lab import FunLab, Subject

lab = FunLab()
lab.setup("gamed-metric", {"slug": "combat"})
lab.setup("metric-level", {"metric": "combat", "level": 2, "xp": 100})

ada = Subject("user", 1)
lab.award("combat").to(ada).amount(150).save()
lab.level_info(ada, "combat")["current_level"]  # 2

Status

pip install fancy-fun-lab

License

MIT

Metadata

Release files for fancy-fun-lab 0.1.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 fancy-fun-lab 0.1.1
File Size Uploaded Provenance Actions
fancy_fun_lab-0.1.1.tar.gz 39.1 kB With provenance Details for fancy_fun_lab-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fancy-fun-lab 0.1.1
File Interpreter ABI Platform Actions
fancy_fun_lab-0.1.1-py3-none-any.whl Python 3 none any Details for fancy_fun_lab-0.1.1-py3-none-any.whl

Total release size: 72.3 kB

Release files / fancy_fun_lab-0.1.1.tar.gz

Download URL fancy_fun_lab-0.1.1.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0188668cf784c85bf1141ca96234b56778d86c89262df5e9ab2b5c7d30bc6119
BLAKE2b-256 checksum
How to use checksums
ebaa2121a19dc00b021697e7130280a5313db921b9fd7f0df46f6267fcc39314
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 17, 2026.

Transparency log

Release files / fancy_fun_lab-0.1.1-py3-none-any.whl

Download URL fancy_fun_lab-0.1.1-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
284fa78ad4a4394ac7625560429d57820a141bd55b11c996837e9bcd652fadeb
BLAKE2b-256 checksum
How to use checksums
2d7908b00b3ce53e73fe94afd0eb6148e66f9a46ce87617e5a69af75b10ad2cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 17, 2026.

Transparency log

Security for fancy-fun-lab 0.1.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.

Full provenance

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

Select from 2 files

Attestation for fancy_fun_lab-0.1.1.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 Nov 17, 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.1 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