Skip to main content

A Python Helper CLI for Competitive Programming

Project description

FastSnake

Python Package Pypi License Platforms 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 and AtCoder platforms. But you will have to write your own code and library for the problems you want to solve.

Installing FastSnake:

$ 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 test <problem>

You can also create your own generator, at test_generators folder, to bruteforce your solution.

$ fastsnake test <problem> -g <n_tests>

Starting a Custom Contest

Use the command below to start your own contest.

$ fastsnake start-custom-contest <n_problems>

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 *

coins = []

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

value = int(input())

result = min_coins(coins, value)
print(result)

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

Injecting the algorithm to the final solution...

$ fastsnake compile 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 test <problem> -c

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

Adding External Modules:

You may also add your own modules to the external package of fastsnake.

$ fastsnake add-external <path | url> --name <module_name> [--url]

For downloading the module from web, use the flag --url.

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.4.7.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

fastsnake-1.4.7-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastsnake-1.4.7.tar.gz
Algorithm Hash digest
SHA256 d9a11794a10e90a1ef6e88eec9c73f933e42b38ddf9864cbbae5513711ec94c9
MD5 9ee70ed34b8f5719e9be272b8a3f4534
BLAKE2b-256 158298fbb2ff78eb668f02ba538197f1716dc2e113e552e29d7225412311d346

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastsnake-1.4.7-py3-none-any.whl
  • Upload date:
  • Size: 19.4 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.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 951452d6e15eed8e469b3359a51e3c536f480859182b4a3583f388a5992cf207
MD5 5d5eab456c1a39780d505149a97cb5bc
BLAKE2b-256 3ff5a7f62fb6da6b48ea332b0d5f74d6a62f5e2e30cf69b637d0367c527f676d

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