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).
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9d240eeb73ecd200f4c07e0fdfd1b2803b4ad399ffdc98c2a326403d8bbb474
|
|
| MD5 |
5a9454009c1dca507aeb7435e07fabd0
|
|
| BLAKE2b-256 |
0f8db16e7be4c79eec004fee6cd00b59c567873653b3337d50228ab7196fe58e
|
Provenance
The following attestation bundles were made for ctfd_api-0.2.2.tar.gz:
Publisher:
publish-to-pypi.yml on DonAsako/ctfd.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctfd_api-0.2.2.tar.gz -
Subject digest:
d9d240eeb73ecd200f4c07e0fdfd1b2803b4ad399ffdc98c2a326403d8bbb474 - Sigstore transparency entry: 1753431659
- Sigstore integration time:
-
Permalink:
DonAsako/ctfd.py@f001bf4c0c9ba234354fb47e189fae55fdb39266 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DonAsako
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f001bf4c0c9ba234354fb47e189fae55fdb39266 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b29c6f4070416d8097ca47519b7c77a4d58653ebf106d9167fb6863c741a39da
|
|
| MD5 |
2615c0aef0139b60027191b37e71e8b5
|
|
| BLAKE2b-256 |
f7a0fc3eae8e54f142e0aa7c1fbcc2e1979793772e6240a4f5fd9ad2d91ae0c9
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctfd_api-0.2.2-py3-none-any.whl -
Subject digest:
b29c6f4070416d8097ca47519b7c77a4d58653ebf106d9167fb6863c741a39da - Sigstore transparency entry: 1753431681
- Sigstore integration time:
-
Permalink:
DonAsako/ctfd.py@f001bf4c0c9ba234354fb47e189fae55fdb39266 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DonAsako
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f001bf4c0c9ba234354fb47e189fae55fdb39266 -
Trigger Event:
push
-
Statement type: