Skip to content

Repository files navigation

ctftime_api

PyPI - Python VersionPyPI - StatusPyPI - Version

A simple Python wrapper for the CTFTime API that provides an asynchronous interface to retrieve CTF event and team information.

Features

  • Asynchronous: Utilize Python's async/await for non-blocking API requests.
  • Type Safe: Fully type annotated using Pydantic models.
  • Modular: Organized into client and models modules for easy maintenance and extension.
  • Tested: Includes comprehensive unit tests in the tests directory.

Installation

Install via pip:

pip install ctftime_api

Usage

Create a client to interact with the CTFTime API. For example, to get the top teams for the current year:

importasynciofromctftime_api.clientimportCTFTimeClientasyncdefmain():
client=CTFTimeClient()
top_teams=awaitclient.get_top_teams_per_year()
forteamintop_teams:
print(f"{team.name} (ID: {team.id}) - Points: {team.points}")
awaitclient.close()
asyncio.run(main())

For more detailed examples, check the examples directory.

Documentation

Full API documentation is available at https://jotonedev.github.io/ctftime_api.

Contributing

This project is licensed under the GNU General Public License v3 or later (GPLv3+).

Additional Resources

License

This project is released under the GPL 3.0 or later license.

About

A simple Python wrapper for the CTFTime API.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages