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

Pre-release: not yet published to PyPI.

License

MIT

Metadata

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

Built distribution (wheel)

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

Total release size: 68.3 kB

Release files / fancy_fun_lab-0.1.0.tar.gz

Download URL fancy_fun_lab-0.1.0.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a1ccf436a04a1fe98483f680ff05d02c1686bbbd0ec3502efe81c256a23667c5
BLAKE2b-256 checksum
How to use checksums
6fe33c54cc9b97c492583b9fd3f6b3b15b40aa8a83ea70de0e73ec66323fd3ce
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.0-py3-none-any.whl

Download URL fancy_fun_lab-0.1.0-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
908adc663408f9a9289f5282fc1939bdf0623af9b825bbf8f0c92d7e77f71c6d
BLAKE2b-256 checksum
How to use checksums
eb4de511953d16fc5cde88335bef90eec963d60d4439b3b0c99946c5860f06b2
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.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 fancy_fun_lab-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 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.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