Skip to main content

A helper for contests in Python 3

Project description

FastSnake

Python Package Pypi License Python Version

Tired of having to copy-paste your library code into every solution you write? FastSnake is a command-line tool that allows you to easily create, expand, run and test Python solutions for competitive programming problems.

This project provides useful CLI tools for competitive programming, such as algorithms and data structures, and tools for Codeforces. But you will have to write your own code and library for the problems you want to solve.

Installing FastSnake:

For Python with pip:

$ pip install FastSnake

Basic Usage:

Starting a contest from Codeforces...

$ fastsnake codeforces -sc <contest_id>

Note: The contest ID can be found at contest URL https://codeforces.com/contest/<id>

Once you have written your solution, test it.

$ fastsnake -t <problem>

Algorithms and Structures

FastSnake provides some algorithms and structures that can be injected to your final solution. See the sample below:

Python Solution:

from fastsnake.algorithms.min_coins import *

n = int(input())
coins = []

for x in input().split():
    coins.append(int(x))

value = int(input())

print(min_coins(coins, value))  # Result

Use the argument --list <algorithms | structures> to see all algorithms and structures provided by FastSnake.

Injecting the algorithm to the final solution...

$ fastsnake -c main.py

Check out the code of the generated Python module.

Testing and Compiling:

You may test and compile your solution using the command below:

$ fastsnake -tc <problem>

If the solution was accepted at all test cases, it will be compiled.

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

fastsnake-1.3.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

fastsnake-1.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file fastsnake-1.3.0.tar.gz.

File metadata

  • Download URL: fastsnake-1.3.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for fastsnake-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3f820b6cd9d5ff485aefc29db259cfefb8c238917086ebfe7a0d6ee300be3fab
MD5 05f76d7ca48a5b2c1527b782367b19d8
BLAKE2b-256 6447d79b3fdcb2affd5c425e5cc72eb4297e3d12ef1af73fec8d0e4e6362dfee

See more details on using hashes here.

File details

Details for the file fastsnake-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: fastsnake-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.6

File hashes

Hashes for fastsnake-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7af626bfde2444bc047224aca3e46b9c5175263bab12ef2eedeacfd6c8e9a832
MD5 4a4bd457e83ca8c57ed66b7dc2312d0e
BLAKE2b-256 de4388a078f745d7f140e30dc71b382365d50a238e8806e80cf8138570d1de8a

See more details on using hashes here.

Supported by

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