Skip to main content

Centralized virtual currency engine for game economies

Project description

MintCore

PyPI Python License: SOCL-1.0

Centralized virtual currency engine for game economies. FastAPI + SQLAlchemy + a mintcore CLI out of the box.

Install

pip install mintcore           # core engine + CLI
pip install mintcore[bot]      # + Discord bot support
pip install mintcore[dev]      # + dev/test tools

Quickstart

mintcore init    # writes .env template
mintcore start   # starts API on http://127.0.0.1:8000

Or embed directly in your code:

from mintcore import MintCore

engine = MintCore(
    database_url="sqlite:///./mygame.db",
    admin_key="super-secret",
    debt_cap=-500,
)
engine.run(host="0.0.0.0", port=8000)

CLI

mintcore start                             # start API server
mintcore init                              # write .env template
mintcore status                            # check server health

mintcore admin currency GLD Gold G        # create currency
mintcore admin mint player1 500 GLD       # mint to player
mintcore admin tax 5 GLD                  # 5% tax sweep
mintcore admin interest                   # apply interest
mintcore admin stats                      # economy snapshot
mintcore admin richlist GLD               # top holders

Discord bot

# Add your DISCORD_TOKEN to .env, then:
python -m mintcore.bot.main

See discord bot docs for slash command reference.

Environment variables

Variable Default Description
MINTCORE_ADMIN_KEY admin-secret Admin API key
MINTCORE_DB_URL sqlite:///./mintcore.db SQLAlchemy DB URL
MINTCORE_TREASURY treasury Treasury account ID
MINTCORE_INTEREST_RATE 5 Interest % per cycle
MINTCORE_DEBT_CAP -1000 Max overdraft
MINTCORE_CACHE_TTL 300 Rate cache TTL (seconds)
DISCORD_TOKEN Discord bot token

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mintcore-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mintcore-1.0.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file mintcore-1.0.0.tar.gz.

File metadata

  • Download URL: mintcore-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mintcore-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5e1a259e252cd63f1107848715ef953473c6e6fc29ad7a24b2d2b91101a7e6a0
MD5 947b0b726d7b7deb95c12dc0442e580e
BLAKE2b-256 93f3118a98388a767305468d34c6f77b1a4cce32d1a7ef3d8f8e9761e7d8c5d5

See more details on using hashes here.

File details

Details for the file mintcore-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mintcore-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mintcore-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 406613c1285daaa658e518374d0db6a0744bc0817e4c2307d8fa819fa83fd6e3
MD5 fafcba4fa0bfcec21e633a2a3519f594
BLAKE2b-256 63319f09f367e2ed4d7d8518055fbf0045e801b8a05f2348f86c433f62f39eb7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page