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.1.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.1-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctfd_api-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e836838ee9a7ec4efdb7e49050a509410cd202c0ab69bb7ea3e395ce22a92e66
MD5 8ee63d523d36e3f18772bda3ad3f8fdf
BLAKE2b-256 9cd9b680d161b8f33a30a18365b387abb186dec74531bfe59853fad484b5b4d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctfd_api-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: ctfd_api-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b13e994a9c6843316e160a1b290fc18ccdf99b3dbc0ae7790c9534afca113afd
MD5 b970df2f8df97f6517861a834032e320
BLAKE2b-256 29d9f0e8a7ec9af907e4506f15cfd495e8ecadb39608b7d848740dcfe6b1f866

See more details on using hashes here.

Provenance

The following attestation bundles were made for ctfd_api-0.2.1-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