Skip to main content

A Python binding to the Wandbox API.

Project description

Wandbox API for Python

PyPI version Python Versions Codacy Badge Language grade: Python GitHub Actions

Wandbox is a social compilation service.
This project is a Pythonic binding to the Wandbox API, and CLI command.

Installation

pip install wandbox-api

CLI

wandbox

for Languages

Bash C C# C++ CPP
Crystal D Elixir Erlang Go
Groovy Haskell Java JavaScript Julia
Lazy K Lisp Lua Nim OCaml
OpenSSL Pascal Perl PHP Pony
Python R Ruby Rust Scala
SQL Swift TypeScript Vim script

wandbox

usage: wandbox [-h] [-v] [-l LANGUAGE] [-c COMPILER] [-x OPTIONS] [-r RUNTIME_OPTIONS] [-n] [-s] [--encoding ENCODING]
               [--no-default] [--stdin STDIN] [--retry-wait SECONDS] [--retry COUNT]
               {list,compilers,versions,lang,option,permlink,run,template,run-template,user,help} ...

positional arguments:
  {list,compilers,versions,lang,option,permlink,run,help}
    list                show list api response. see `list -h`
    compilers           show support compilers. see `compilers -h`
    versions            show support compilers. see `versions -h`
    lang                show support languages. see `lang -h`
    option              show compiler options. see `option -h`
    version             show compiler version from version-command. see `version -h`
    permlink            get permlink. see `permlink -h`
    run                 build and run command. see `run +h`
    template            get wandbox template code. see `template -h`
    run-template        run wandbox template code. see `run-template +h`
    user                get wandbox user info. see `user -h`
    help                show subcommand help. see `help -h`

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -l LANGUAGE, --language LANGUAGE
                        specify language
  -c COMPILER, --compiler COMPILER
                        specify compiler
  -x OPTIONS, --options OPTIONS
                        used options for a compiler
  -r RUNTIME_OPTIONS, --runtime-options RUNTIME_OPTIONS
                        runtime options
  -n, --dryrun          dryrun
  -V, --verbose         verbose log
  -s, --save            generate permanent link.
  --encoding ENCODING   set encoding
  --no-head             ignore head compiler version (at auto setup)
  --no-default          no set default options
  --stdin STDIN         set stdin
  --retry-wait SECONDS  wait time for retry when HTTPError occurs
  --retry COUNT         number of retries when HTTPError occurs

Bash

Source files required for runtime are automatically added to the file list.

  • wandbox-bash

Bash Example

wandbox-bash run sample.sh

Bash Example


C

Include files required for compilation are automatically added to the file list.

  • wandbox-cc
    (wandbox -l C)
  • wandbox-gcc
    (wandbox -l C -c gcc-*-c)
  • wandbox-clang
    (wandbox -l C -c clang-*-c)

C Example

wandbox-gcc run sample.c test.c
CXX="wandbox-gcc run" make

C Example


C#

  • wandbox-cs
    (wandbox -l C#)

C# Example

wandbox-cs run sample.cs test.cs

C# Example


C++

Include files required for compilation are automatically added to the file list.

  • wandbox-cxx
    (wandbox -l C++)
  • wandbox-g++
    (wandbox -l C++ -c gcc-*)
  • wandbox-clang++
    (wandbox -l C++ -c clang-*)
usage: wandbox-cxx [-h] [-v] [-c COMPILER] [-x OPTIONS] [-r RUNTIME_OPTIONS] [-n] [-s] [--encoding ENCODING]
                   [--no-default] [--stdin STDIN] [--retry-wait SECONDS] [--retry COUNT] [--std VERSION]
                   [--boost VERSION] [--no-warning] [--optimize] [--cpp-pedantic PEDANTIC] [--cpp-verbose] [--sprout] [--msgpack]
                   {list,compilers,versions,lang,option,permlink,run,template,run-template,user,help} ...

positional arguments:
  {list,compilers,versions,lang,option,permlink,run,help}
    list                show list api response. see `list -h`
    compilers           show support compilers. see `compilers -h`
    versions            show support compilers. see `versions -h`
    lang                show support languages. see `lang -h`
    option              show compiler options. see `option -h`
    version             show compiler version from version-command. see `version -h`
    permlink            get permlink. see `permlink -h`
    run                 build and run command. see `run +h`
    template            get wandbox template code. see `template -h`
    run-template        run wandbox template code. see `run-template +h`
    user                get wandbox user info. see `user -h`
    help                show subcommand help. see `help -h`

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -c COMPILER, --compiler COMPILER
                        specify compiler
  -x OPTIONS, --options OPTIONS
                        used options for a compiler
  -r RUNTIME_OPTIONS, --runtime-options RUNTIME_OPTIONS
                        runtime options
  -n, --dryrun          dryrun
  -V, --verbose         verbose log
  -s, --save            generate permanent link.
  --encoding ENCODING   set encoding
  --no-head             ignore head compiler version (at auto setup)
  --no-default          no set default options
  --stdin STDIN         set stdin
  --retry-wait SECONDS  wait time for retry when HTTPError occurs
  --retry COUNT         number of retries when HTTPError occurs
  --std VERSION         set --std options
  --boost VERSION       set boost options version X.XX or nothing
  --no-warning          disable warning option
  --optimize            use optimization
  --cpp-pedantic PEDANTIC
                        use cpp-pedantic
  --cpp-verbose         use cpp-verbose
  --sprout              use sprout
  --msgpack             use msgpack

C++ Example

wandbox-cxx -c gcc-head run main.cpp -DWANDBOX
CXX="wandbox-g++ run" make

C++ Example


CPP

Include files required for compilation are automatically added to the file list.

  • wandbox-CPP
    (wandbox -l CPP)
  • wandbox-gcc-PP
    (wandbox -l CPP -c gcc-*-pp)
  • wandbox-clang-PP
    (wandbox -l CPP -c clang-*-pp)

CPP Example

wandbox-clang-PP run -CC -nostdinc -E -P sample.cpp test.cpp

CPP Example


Crystal

Import modules required for compilation are automatically added to the file list.

  • wandbox-crystal
    (wandbox -l Crystal)

Crystal Example

wandbox-crystal run sample.cr

Crystal Example


D

  • wandbox-dmd
    (wandbox -l D -c dmd-*)
  • wandbox-ldmd2
    (wandbox -l D -c ldc-*)
  • wandbox-dub

D Example

wandbox-dmd run sample.d test2.d packages/test.d
wandbox-dub run

D Example Dub Example


Elixir

  • wandbox-elixir
    (wandbox -l Elixir)
  • wandbox-mix (Experimental)

Elixir Example

wandbox-elixir run sample.exs
wandbox-mix run test

Elixir Example


Erlang

  • wandbox-erlc
    (wandbox -l Erlang)

Erlang Example

wandbox-erlc run prog.erl

Erlang Example


Go

  • wandbox-go
    (wandbox -l Go)

Go Example

wandbox-go run sample.go

Go Example


Groovy

  • wandbox-groovy
    (wandbox -l Groovy)

Groovy Example

wandbox-groovy run -cp . sample.groovy

Groovy Example


Haskell

  • wandbox-ghc
    (wandbox -l Haskell)
  • wandbox-stack

Note: wandbox-ghc/wandbox-stack add -dynamic compiler option. (output file size workarround.)

Haskell Example

wandbox-ghc run sample.hs
wandbox-stack run

Haskell Example

Haskell Stack Example


Java

  • wandbox-java
    (wandbox -l Java)

Java Example

wandbox-java run sample.java test.java

Java Example


JavaScript

Import files/modules required for runtime are automatically added to the file list.

  • wandbox-js
    (wandbox -l JavaScript)
  • wandbox-node
    (wandbox -l JavaScript-c nodejs-*)
  • wandbox-spidermonkey
    (wandbox -l JavaScript -c spidermonkey-*)

JavaScript Example

wandbox-node run --experimental-modules sample.js

JavaScript Example


Julia

  • wandbox-julia
    (wandbox -l Julia)

Julia Example

wandbox-julia run sample.jl

Julia Example


Lazy K

  • wandbox-lazyk
    (wandbox -l "Lazy K")

Lazy K Example

wandbox-lazyk run sample.lazy

Lazy K Example


Lisp

  • wandbox-sbcl
    (wandbox -l Lisp)
  • wandbox-clisp
    (wandbox -l Lisp -c clisp-*)

Lisp Example

wandbox-sbcl run sample.lisp

Lisp Example


Lua

Import files/modules required for compilation are automatically added to the file list.

  • wandbox-lua
    (wandbox -l Lua)
  • wandbox-luajit
    (wandbox -l Lua -c luajit-*)

Lua Example

wandbox-lua run sample.lua

Lua Example


Nim

Import modules/.c required for compilation are automatically added to the file list.

  • wandbox-nim
    (wandbox -l Nim)

Nim Example

wandbox-nim run sample.nim

Nim Example


OCaml

  • wandbox-ocamlopt
    (wandbox -l OCaml)
  • wandbox-ocaml
    (wandbox -l OCaml)

OCaml Example

wandbox-ocamlopt run sample.ml

OCaml Example


OpenSSL

Even just having wandbox would be enough.

  • wandbox-ssl

OpenSSL Example

wandbox-ssl genrsa -out test.key 2048
wandbox-ssl rsa -in test.key -pubout -out test.key.pub

OpenSSL Example


Pascal

Include files required for runtime are automatically added to the file list.

  • wandbox-fpc
    (wandbox -l Pascal)

Pascal Example

wandbox-fpc run sample.pas

Pascal Example


Perl

Require files/modules required for runtime are automatically added to the file list.

  • wandbox-perl
    (wandbox -l Perl)

Perl Example

wandbox-perl run sample.pl

Perl Example


PHP

Require/Include files required for runtime are automatically added to the file list.

  • wandbox-php
    (wandbox -l PHP)

PHP Example

wandbox-php run sample.php

PHP Example


Pony

Build directory files are automatically added to the file list.

  • wandbox-ponyc
    (wandbox -l Pony)

Pony Example

wandbox-ponyc run ./sample ./sample2

wandbox-ponyc builds ./sample and ./sample2, Then execute ./sample2

Pony Example


Python

Import files/modules required for runtime are automatically added to the file list.

  • wandbox-python
    (wandbox -l Python)
  • wandbox-python2
    (wandbox -l Python -c cpython-2.7-*)
  • wandbox-python3
    (wandbox -l Python -c cpython-*)
  • wandbox-pypy
    (wandbox -l Python -c pypy-*)
  • wandbox-pypy2
    (wandbox -l Python -c pypy-2*)
  • wandbox-pypy3
    (wandbox -l Python -c pypy-3*)

Python Example

wandbox-python3 run sample.py

wandbox-python supports setup.py

wandbox-python -c cpython-head -r test run setup.py

If you open a file, add the file

wandbox-python -c cpython-head -r test run setup.py README.md

Python Example


R

Source files are automatically added to the file list.

  • wandbox-rscript
    (wandbox -l R)

R Example

wandbox-rscript run sample.R

R Example


Ruby

Require files required for runtime are automatically added to the file list.

  • wandbox-ruby
    (wandbox -l Ruby)
  • wandbox-mruby
    (wandbox -l Ruby -c mruby-*)

Ruby Example

wandbox-ruby run sample.rb

Ruby Example


Rust

Module files required for runtime are automatically added to the file list.

  • wandbox-rustc
    (wandbox -l Rust)
  • wandbox-cargo

Rust Example

wandbox-rustc run sample.rs
wandbox-cargo run

Rust Example


Scala

  • wandbox-scalac
    (wandbox -l Scala)

Scala Example

wandbox-scalac run *.scala

Scala Example


SQL

  • wandbox-sqlite
    (wandbox -l SQL)
  • wandbox-sqlite3
    (wandbox -l SQL)

SQL Example

wandbox-sqlite3 run SELECT 'Hello, Wandbox!';

SQL Example


Swift

  • wandbox-swift
    (wandbox -l Swift)

Swift Example

wandbox-swift run main.swift

Swift Example


TypeScript

Import files/modules required for compilation are automatically added to the file list.

  • wandbox-tsc
    (wandbox -l TypeScript)

TypeScript Example

wandbox-tsc run --module es2015 sample.ts

TypeScript Example


Vim script

  • wandbox-vim
    (wandbox -l "Vim script")

Vim script Example

wandbox-vim run -X -N -u NONE -i NONE -V1 -e -s -S sample.vim +qall!

Vim script Example


CONTRIBUTING

CONTRIBUTING

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

wandbox-api-0.9.37.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

wandbox_api-0.9.37-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file wandbox-api-0.9.37.tar.gz.

File metadata

  • Download URL: wandbox-api-0.9.37.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for wandbox-api-0.9.37.tar.gz
Algorithm Hash digest
SHA256 4dd644def4014024f783e82d4a4fa2169ac8efa3b8b8bba48c6fc9fad39cad5e
MD5 0625912b88630aa6eb8b2a6222b160b5
BLAKE2b-256 9fcbd1cc2ec459ddaffc9aed1c69f09784dae68863002888cca3743f0af56897

See more details on using hashes here.

File details

Details for the file wandbox_api-0.9.37-py3-none-any.whl.

File metadata

  • Download URL: wandbox_api-0.9.37-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for wandbox_api-0.9.37-py3-none-any.whl
Algorithm Hash digest
SHA256 087991c1e1e98fa6520c9cb6536db16b0567281bf71e1f07a5fc1540643d051d
MD5 8dff317b69ec0b2d886d6efac1c875e2
BLAKE2b-256 f7316f2442655aca4bb6cf768d81c3374ffc92f75d35ab1d95258737b5327cb4

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