Skip to main content

A Python wrapper for the CTFd API — automate and script your CTF platforms with a clean, pythonic interface.

Project description

ctfd.py

Async Python client for the CTFd API (v1).

PyPI Python License

Documentation · PyPI · Changelog

Installation

uv add ctfd-api
# or
pip install ctfd-api

Requires Python 3.13+.

Quick start

import asyncio
from ctfd import CTFdClient

async def main():
    async with CTFdClient('https://my-ctf.example.com', token='ctfd_...') as ctfd:
        me = await ctfd.users.me()

        async for challenge in ctfd.challenges.iter():
            print(challenge.name, challenge.value)

asyncio.run(main())

Get a token from Profile → API Access Tokens on your CTFd instance.

Dev setup

uv sync                              # install deps + dev tools
uv run pre-commit install            # install git hooks
uv run pytest                        # run tests
uv run ruff check ctfd               # lint
uv run mypy                          # type-check
uv run --group docs mkdocs serve     # live docs preview

License

GPL-3.0-or-later

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

ctfd_api-0.2.2.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

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

ctfd_api-0.2.2-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file ctfd_api-0.2.2.tar.gz.

File metadata

  • Download URL: ctfd_api-0.2.2.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctfd_api-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d9d240eeb73ecd200f4c07e0fdfd1b2803b4ad399ffdc98c2a326403d8bbb474
MD5 5a9454009c1dca507aeb7435e07fabd0
BLAKE2b-256 0f8db16e7be4c79eec004fee6cd00b59c567873653b3337d50228ab7196fe58e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctfd_api-0.2.2.tar.gz:

Publisher: publish-to-pypi.yml on DonAsako/ctfd.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ctfd_api-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: ctfd_api-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ctfd_api-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b29c6f4070416d8097ca47519b7c77a4d58653ebf106d9167fb6863c741a39da
MD5 2615c0aef0139b60027191b37e71e8b5
BLAKE2b-256 f7a0fc3eae8e54f142e0aa7c1fbcc2e1979793772e6240a4f5fd9ad2d91ae0c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctfd_api-0.2.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on DonAsako/ctfd.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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