Turtle

Library › The Turtle library

The Turtle library

Everything that comes with Turtle beyond its core syntax, one page per library. A library is turned on with import at the top of a file (import data); the built-in types and file statements need none. For the language itself, see the reference.

From the terminal: turtle doc lists every library function; turtle doc sql shows one library, turtle doc sql_update one function: what each argument is, what it gives back, and an example.

Built in

Page What's in it
Built-in types and methodslists, sets, maps, text and numbers, and their methods
Files, shell commands and modules[read], [write], [append], [directory], sys, import

Data

Library What it's for
dataprocess, keep and reduce collections; text tables and table files; statistics
linearmatrices: operators, solving, inverses, decompositions
sortsorting by a function, field or position; the classic algorithms
searchfinding items by a rule; the classic search algorithms

Numbers and chance

Library What it's for
mathsquare roots, rounding, powers
randomrandom values of any shape; pick, shuffle, sample

Text

Library What it's for
stringsfinding, cutting and joining text
patternregular expressions: match, find, replace, split

Files, system and settings

Library What it's for
systemarguments, environment, files and folders, the program itself
configsettings in TOML, JSON and .env files

Internet

Library What it's for
httpweb requests
jsonJSON text and files
servera web server from a map of routes

Databases

Library What it's for
sqlSQLite files, PostgreSQL and MySQL servers

Time

Library What it's for
timedates, time zones, date arithmetic, waiting
schedulemany requests, commands or queries at once

Security

Library What it's for
crypthashes, encodings, ids, passwords, encryption

Development

Library What it's for
testcheck, verify, validate, turtle test (guide: testing)
loglog lines with levels, to the screen or a file
Top