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 methods | lists, 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 |
data | process, keep and reduce collections; text tables and table files; statistics |
linear | matrices: operators, solving, inverses, decompositions |
sort | sorting by a function, field or position; the classic algorithms |
search | finding items by a rule; the classic search algorithms |
Numbers and chance
| Library |
What it's for |
math | square roots, rounding, powers |
random | random values of any shape; pick, shuffle, sample |
Text
| Library |
What it's for |
strings | finding, cutting and joining text |
pattern | regular expressions: match, find, replace, split |
Files, system and settings
| Library |
What it's for |
system | arguments, environment, files and folders, the program itself |
config | settings in TOML, JSON and .env files |
Internet
| Library |
What it's for |
http | web requests |
json | JSON text and files |
server | a web server from a map of routes |
Databases
| Library |
What it's for |
sql | SQLite files, PostgreSQL and MySQL servers |
Time
| Library |
What it's for |
time | dates, time zones, date arithmetic, waiting |
schedule | many requests, commands or queries at once |
Security
| Library |
What it's for |
crypt | hashes, encodings, ids, passwords, encryption |
Development
| Library |
What it's for |
test | check, verify, validate, turtle test (guide: testing) |
log | log lines with levels, to the screen or a file |
Top