Skip to main content

tanco

A test-driven teaching environment for programmers.

This is a work in progress. There are videos about it on:

https://www.youtube.com/@tangentstream

If your goal is to work through a coding challenge, detailed setup instructions are here:

https://tangentcode.com/setup

Installation

There are two main ways to install Tanco:

1. From PyPI (Recommended for users):

If you just want to use Tanco to follow a course or run tests, you can install it directly from the Python Package Index (PyPI):

pip install tanco

You can find the package details on PyPI.

2. Editable Install (Recommended for developers):

If you plan to contribute to Tanco development or want the latest changes, clone the repository and install it in editable mode:

git clone https://github.com/tangentcode/tanco.git
cd tanco
pip install -e .

This command links the installed package to your local source code, so any changes you make are immediately effective.

Using the Client

tanco login
cd /path/to/your/project
tanco init
tanco test     # keep doing this until it passes
git commit    # once the test passes
tanco next     # to fetch the next test

inspecting the database

Tanco (both the client and server) creates a sqlite database in ~/.tanco.sdb.

You can override this location by setting the TANCO_SDB environment variable to a different path.

You can inspect the database with the sqlite3 command-line tool.

sqlite3 ~/.tanco.sdb
.schema

Running the Server

First set up a private key, then run quart or hypercorn.

Private Key

The tanco login command lets the command-line client log into the server in a multi-user setup.

In this setup, the server uses a private key to sign a json web token.

To set up the private key, do this:

cd /path/to/tanco-server
ssh-keygen -t rsa -b 4096 -m PEM -f tanco_auth_key.pem

This will also create a public key in tanco_auth_key.pem.pub. This is not currently used for anything.

Running the server

You can run the development server like so:

bash QUART_APP=tanco.app:app quart run # --reload

Or (on platforms that support it) use hypercorn:

hypercorn tanco.app:app # --reload

Local Usage

Tanco is primarily used via its command-line interface.

Running Local Tests from Org Files:

Tanco can now run tests defined directly within an .org file, independent of the server. This is useful for local development, testing, and creating new challenges.

Use the run command with the --tests flag:

tanco run --tests path/to/your/tests.org -c 'your_command'
  • --tests path/to/your/tests.org (or -t): Specifies the org file containing the test definitions.
  • -c 'command': Run the command via the shell. For example:
    tanco run -t tests.org -c 'node your_script.js'
    tanco run -t tests.org -c 'python your_script.py arg1'
    
  • For direct executables, use -- to separate program args:
    tanco run -t tests.org -- ./your_program arg1 arg2
    

Filtering by test name:

Both test and run accept test names to run only specific tests:

tanco test -t tests.org foo bar
tanco run -t tests.org foo bar -c 'python script.py'
tanco run -t tests.org foo bar -- ./my_program

Verbose Output:

You can add the -v or --verbose flag to the run command to print the configuration Tanco is using before executing the tests. This is helpful for debugging paths and arguments:

tanco run -v -t tests.org -c 'python script.py'

Metadata

Release files for tanco 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tanco 0.4.0
File Size Uploaded
tanco-0.4.0.tar.gz 91.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tanco 0.4.0
File Interpreter ABI Platform
tanco-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 181.9 kB

Release files / tanco-0.4.0.tar.gz

Download URL tanco-0.4.0.tar.gz
Size 91.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4550ee5f375604b393d4b38caa6f9b2c597e848152de39f5d4b34ac022bfbfd3
BLAKE2b-256 checksum
How to use checksums
6763ada79044162a71cd1dd756be23f6270bd47f43e166f8e9a39f96262c7e4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / tanco-0.4.0-py3-none-any.whl

Download URL tanco-0.4.0-py3-none-any.whl
Size 90.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8af756284eb9be9d85c88f674380cc8233e85d117a5e2837a6e608dfd577202e
BLAKE2b-256 checksum
How to use checksums
e707bc723f99b2d5cf157876c745a238c6ebb74f45da6013db40560d3f5cc3af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page