src/pylib

Search:
Group by:
Source   Edit  

Nim Pylib

Just write Python code in Nim!

import pylib

The mostly suggested style is

import pkg/pylib

However, omitting the pkg/ prefix shall be fine at most cases:

import pylib

import Python-like stdlib

Cheatsheet for rough alternative between pylib and Python

Nim pylibPython
from pylib/Lib/LIB import nilimport LIB
import pylib/Lib/LIBfrom LIB import *
from pylib/Lib/LIB import XXXimport LIB; from LIB import XXX

---

Wondering how many libs are available in NimPylib?

Here are the Lib Docs.

Templates

template timeit(repetitions: int; statements: untyped): untyped {....deprecated: "will be removed from main pylib since 0.10, import it from `pylib/Lib` instead".}
Deprecated: will be removed from main pylib since 0.10, import it from `pylib/Lib` instead

EXT.

Mimics Pythons timeit.timeit(), output shows more information than Pythons.

Source   Edit  

Exports

write, close, read, read, close, readline, initBufAsPy, readline, write, open, readline, readline, truncate, truncate, raiseOsOrFileNotFoundError, read, close, readline, readline, read, write, raiseOsOrFileNotFoundError, open, read, seek, read, seek, None, NoneType, not, or, PyBool, ==, bool, toBool, toNimBool, ==, and, repr, pybool, not, and, $, True, is, False, ==, or, any, pybool, xor, all, enumerate, SomeSet, set, setattr, <=, isdisjoint, enumerate, PyDictValueView, 'j, ==, contains, pow, SomePyDictView, difference, isinstance, union, symmetric_difference, ^, repr, toPyDict, ==, sort, len, []=, <, +=, None, -, PyDict, items, popitem, +=, difference_update, items, repr, hash, []=, toNimComplex, intersection, slice, pow, -=, complex, clear, filter, ==, ==, id, PySlice1, <=, ==, newPyList, zip, contains, ==, mitems, add, +, get, *, insert, issubclass, imag, clear, ==, difference, filter, /, copy, +, PySlice, len, sorted, pydiscard, repr, repr, map, items, nimArrayAsList, |=, set, ==, +, count, abs, repr, repr, sorted, -, [], newPyListOfCap, hasattr, reverse, slice, list, PyIterator, -, |, $, range, items, iter, -=, <, zip, filter, +=, $, delitem, PySet, max, StopIteration, []=, contains, reversed, pyset, hash, list, []=, <, difference, $, extend, real, hash, newPyList, getattr, discard, newPyIterator, +, |, indices, contains, $, [], repr, pop, min, [], pyset, repr, hash, items, [], [], $, /, repr, *, /, keys, symmetric_difference, items, ==, SomeSinglePyDictView, iter, emptyPyDict, pycomplex, hash, items, /=, []=, sorted, PyList, /, $, set, intersection, index, *=, *, ==, repr, conjugate, pow, symmetric_difference, sort, reversed, union, items, hash, slice, next, get, PyDictKeyView, complex, map, count, clear, []=, -, iter, len, setdefault, []=, $, pycomplex, len, range, pop, hash, items, keys, copy, PyComplex, iter, @, *, set, set, PyDictView, |=, reverse, pop, union, PyDictItemView, values, <, dict, <=, update, pop, items, <=, /, contains, filter, toPyDict, $, items, append, issubset, remove, -, intersection_update, newPySet, values, ==, +, input, getPtr, newPyList, +, list, range, &=, pop, pyset, delitem, hash, extend, pyset, setLen, contains, intersection, &, index, items, iter, set, *=, hash, [], update, []=, len, *, pysetLit, PyRange, getattr, -, +, toNimSlice, list, pyset, *, hash, issuperset, *, print, list, from_bytes, int, NimInt, as_integer_ratio, conjugate, int, long, to_bytes, float, float, long, int, float, int, int, int, bit_length, long, long, nimint, /, <<, %, <>, ArithmeticError, <, **, ZeroDivisionError, **, <, %, ==, <=, ==, <>, <=, **, >>=, divmod, //, ==, <<=, >>, %, **=, **, //=, %=, removeprefix, endsWith, maketrans, substr, ==, str, ascii, NoneType, +=, partition, endsWith, startsWith, maketrans, +=, TranslateAction, ord, translate, str, bin, str, rf, u, TranslateTableVal, StringLike, split, strip, isspace, ==, str, endsWith, rstrip, isalpha, *, rindex, center, ==, Fr, split, contains, ascii, rstrip, replace, endsWith, contains, endsWith, format, toNimString, +, count, repr, lstrip, u, TranslateTableABC, runeAtPos, chr, +=, removesuffix, None, pyrepr, rsplit, capitalize, split, startsWith, startsWith, translate, format, split, center, title, replace, maketrans, [], count, ljust, toNimStr, repr, [], TranslateValType, [], TypedTranslateTableABC, toPyStr, PyStr, and, isupper, $, startsWith, isascii, index, rjust, hex, translate, reversed, rpartition, rsplit, runeLenAt, fr, str, count, chars, istitle, len, toPyStr, Rf, str, splitlines, expandtabs, toPyStr, splitlines, not, islower, runes, casefold, join, upper, ascii, contains, getChar, rfind, ljust, find, strip, oct, +, TranslateTable, lstrip, $, zfill, startsWith, StrTypedTranslateTable, rsplit, isascii, or, translate, byteLen, ord1, items, ascii, len, rjust, f, lower, <>, fspath, *, endsWith, b, b, maketrans, substr, PyBytes, rindex, ==, istitle, hex, endsWith, count, bytes, isupper, $, hex, +=, partition, startsWith, isascii, index, bytes, rjust, +=, ord, endsWith, substr, bytes, reversed, rpartition, getCharPtr, find, isspace, rb, Br, title, count, split, contains, chars, count, endsWith, Rb, +, isalpha, *, bytes, rindex, center, @, startsWith, split, br, +, splitlines, removeprefix, expandtabs, splitlines, replace, not, islower, rstrip, hex, casefold, toNimString, +, count, join, repr, upper, split, contains, lstrip, getChar, strip, rfind, bytes, ljust, find, strip, hasChar, rstrip, +, lstrip, +=, zfill, rfind, startsWith, rsplit, capitalize, or, translate, byteLen, index, items, hex, count, startsWith, startsWith, endsWith, bytes, translate, split, fromhex, len, bytes, center, rsplit, removesuffix, replace, rjust, rsplit, [], count, +, ljust, lower, [], pybytes, translate, fspath, *, bytes, [], []=, hex, <, <=, maketrans, substr, PyBytes, rindex, ==, Br, endsWith, endsWith, getChar, startsWith, replace, <=, +=, partition, b, bytes, +=, getCharPtr, ord, substr, bytes, find, clear, rb, copy, bytearray, rstrip, split, strip, ==, br, endsWith, rstrip, isalpha, *, bytes, rindex, center, len, split, contains, +, removeprefix, +, replace, newPyByteArray, hex, istitle, toNimString, +, count, repr, lstrip, startsWith, [], count, endsWith, ljust, zfill, +=, bytearray, removesuffix, $, []=, capitalize, chars, <, hex, count, bytearray, extend, bytes, translate, split, toNimString, bytes, center, title, newPyByteArray, rsplit, [], count, append, delitem, pybytes, translate, [], [], items, isupper, $, startsWith, startsWith, isascii, index, [], rjust, hex, reversed, rpartition, getCharPtr, PyByteArray, isspace, rsplit, count, reverse, chars, count, Rb, len, @, startsWith, BytesLike, splitlines, expandtabs, splitlines, not, split, islower, ljust, casefold, join, fromhex, upper, b, contains, getChar, strip, rfind, bytes, +=, remove, find, bytearray, hasChar, ==, toPyBytes, +, lstrip, rfind, pop, bytearray, bytearray, rsplit, or, translate, byteLen, index, items, endsWith, *=, []=, newPyByteArray, rjust, bytes, +, lower, fspath, *, bytes, insert, async, define, def, lambda, unpack, pass, with, del, :=, class, tonim