src/pylib

Search:
Group by:
Source   Edit  

Welcome to NimPyLib 0.9.11

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.

Warning: std/lenientops was imported automatically. Compile with -d:pylibNoLenient to disable it if you wish to do int->float conversions yourself

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, read, close, readline, readline, read, write, open, read, seek, read, seek, None, NoneType, or, or, and, not, or, PyBool, ==, bool, toBool, toNimBool, ==, and, repr, pybool, not, and, $, True, is, False, ==, or, and, any, pybool, xor, all, min, upper, center, <=, maketrans, repr, min, float, rindex, -=, ==, -, find, ascii, count, int, len, +=, partition, fr, reversed, endsWith, maketrans, checkLenientOps, msg, float, items, osErrorMsgWithPath, min, bytes, remove, slice, raiseExcWithPath, str, clear, filter, [], rindex, format, TranslateTableVal, id, PyByteArray, <=, ==, repr, isdigit, zip, round, print, ==, PyFrozenSet, getPtr, [], byteLen, ascii, rstrip, replace, clear, repr, endsWith, count, indices, contains, ConnectionResetError, GeneratorExit, int, newPyOSError, TranslateTableABC, $, ==, slice, &, len, repr, iter, set, $, raiseErrno, zip, len, +=, bytearray, startsWith, dirImpl, $, toPyDict, max, pyrepr, reversed, <, chars, endsWith, hash, $, contains, pow, newPyList, toNimString, bytes, pydiscard, maketrans, PermissionError, isascii, count, msg, delitem, pyset, float, repr, sorted, items, [], imag=, TranslateValType, osErrorMsgWithPath, round, newPyList, raiseExcWithPath2, /, rstrip, **, *, $, items, lstrip, min, iter, and, clear, bytearray, [], pow, raiseExcWithPath, hasattr, set, *=, []=, rsplit, Fr, istitle, /, FileNotFoundError, map, count, -, min, -, len, setdefault, ==, contains, ==, PyComplex, len, startsWith, []=, real=, BytesLike, FileExistsError, substr, $, toPyStr, splitlines, +, PyDictItemView, split, islower, endsWith, +=, pop, rjust, join, upper, b, /, $, checked_as_integer_ratio, append, issubset, remove, +=, as_integer_ratio, ==, nextImpl, input, repr, newStopIteration, TranslateTable, IsADirectoryError, zip, PyTComplex, lower, <, pyset, isascii, or, round, *, newPyFrozenSet, PyOSError, *=, int, casefold, delitem, repr, +, PyRange, getattr, -, lower, ==, *, add, getattr, ==, newPySet, hex, union, split, ==, pybytes, str, pow, SomePyDictView, isinstance, **, hex, format, sort, difference, max, extend, rpartition, +=, <=, UnicodeError, delitem, symmetric_difference, ProcessLookupError, PyBytes, [], ArithmeticError, set, rb, bytearray, contains, [], split, intersection, symmetric_difference, isspace, str, ascii, mitems, startsWith, rstrip, isalpha, pow, imag, real, to_bytes, NoneType, +, **=, complex, title, replace, len, difference, endsWith, split, count, *, |=, []=, ==, +, repr, abs, errnoMsg, toPySlice, bit_length, b, splitlines, intersection, count, $, items, -=, runeAtPos, +, frozenset, union, ljust, pairs, max, min, PySlice, PyOSError, contains, ZeroDivisionError, <, ChildProcessError, startsWith, add_from_bytes, translate, TypeError, clear, NameError, items, center, dict, KeyboardInterrupt, rsplit, $, pop, +=, +=, int, toNimStr, max, getCharPtr, TypedTranslateTableABC, SomeSinglePyDictView, items, index, isdisjoint, delitem, PyList, NotADirectoryError, symmetric_difference, NotImplementedError, ord1, max, newPyListOfCap, <=, ascii, $, -=, bit_count, int, delitem, reversed, items, hash, slice, [], format, [], delitem, set, iter, chars, repr, Rb, pycomplex, sorted, +, tryOsOp, iter, bytearray, pow, ==, []=, PyDictView, str, repr, min, reverse, PyDictKeyView, rjust, as_integer_ratio, &=, <, casefold, repr, startsWith, frozenset, split, isupper, istitle, max, +=, symmetric_difference, set, bytearray, intersection, hasChar, startsWith, difference_update, oct, +, difference, index, +, SomePySet, partition, +, StopAsyncIteration, toPyDict, index, max, center, int, <, pow, str, rjust, startsWith, reversed, +, isalpha, <, newBlockingIOError, pow, chars, hash, <=, complex, conjugate, discard, br, translate, newUnicodeDecodeError, hash, hash, hash, get, [], reverse, hex, pysetLit, dir, PyDict, bytes, TimeoutError, ljust, TranslateAction, ord, to_chars, toNimComplex, pow, find, complex, is_integer, next, rf, []=, +, StringLike, newPyListOfStr, newPyList, /=, contains, **, endsWith, toNimString, translate, bytes, SomeSet, newUnicodeDecodeError, replace, float_fromhex, removeprefix, toPyBytes, len, sorted, hash, maketrans, newPyList, map, hex, get, Comparable, [], rsplit, <, int, list, PyIterator, count, range, *, update, chr, endsWith, complex, filter, removesuffix, delitem, dir, StopIteration, []=, J, pyset, []=, float, union, count, bytes, ==, rsplit, repr, getattr, popitem, newPyIterator, +, replace, items, contains, newPyOSError, $, repr, ljust, [], ord, **, $, toPyStr, byteLen, pow, copy, newPyList, len, /=, InterruptedError, /, $, @, nextImpl, newStopIteration, startsWith, isascii, *=, +, *, endsWith, pow, **, sort, rpartition, getCharPtr, isspace, as_someinteger_ratio, to_bytes, complex, count, $, splitlines, frozenset, is_integer, items, $, expandtabs, from_bytes, items, AttributeError, Rf, tryOsOp, -=, ==, lstrip, ==, +, []=, []=, frozenset, RuntimeError, PyDictValueView, union, rstrip, runes, StrTypedTranslateTable, newBlockingIOError, not, contains, None, bytes, ljust, find, newPyListOfStr, intersection_update, values, endsWith, UnicodeDecodeError, rsplit, list, range, zfill, min, bytearray, contains, **, endsWith, PyOSError, issuperset, |, from_bytes, tryOsOp, Br, noWeirdTarget, toNimString, raiseExcWithPath, keys, [], bytes, toNimSlice, list, pow, fromhex, translate, raiseExcWithPath, bytes, list, bytes, enumerate, <=, setattr, -, enumerate, 'j, long, filter, round, getChar, *=, newPyByteArray, []=, setattr, rfind, -, union, startsWith, items, split, <=, substr, ConnectionRefusedError, translate, bin, BlockingIOError, copy, u, set, PySlice1, difference, strip, StopIterationT, long, removeprefix, frozenset, *, insert, issubclass, rindex, center, raiseErrnoT, str, filter, /, round, split, $, nimArrayAsList, dirImpl, getChar, ConnectionError, hash, toNimString, count, *=, repr, contains, newPyList, lstrip, -, hasattr, strip, map, capitalize, len, []=, pop, split, +=, pop, append, +=, rfind, pyset, newPyFrozenSet, int, or, capitalize, ==, -, hex, extend, BlockingIOError, items, contains, title, *, intersection, min, [], tryOsOp, +=, items, ==, iter, emptyPyDict, pycomplex, <=, items, substr, PyStr, <, len, isupper, max, index, startsWith, BrokenPipeError, index, int, rjust, hash, conjugate, translate, reverse, next, runeLenAt, /=, list, BlockingIOError, PyLibKey, update, []=, count, getattr, newPyByteArray, range, $, toPyStr, copy, @, u, *, |=, splitlines, expandtabs, ==, ==, not, values, hex, rsplit, |, zfill, keys, fromhex, raiseErrnoWithPath, long, getChar, strip, rfind, strip, newPySet, symmetric_difference, <, removesuffix, islower, lstrip, pop, PySet, extend, <>, ConnectionAbortedError, setLen, intersection, SystemExit, +=, items, iter, max, hash, [], fspath, []=, newPyByteArray, *, j, pop, <=, frozenset, long, f, pyset, join, difference, translate, NimInt, fspath, *, ^, items, nimint, insert, /, <<, %, <>, <, &, **, &=, **, <, %, ==, <=, |, <<=, **, ^, <=, **, ==, >>=, //=, |=, ~, %, ==, divmod, >>, <>, //, **=, **, ^=, %=, osErrorMsgWithPath, raiseExcWithPath2, RuntimeError, AttributeError, newStopIteration, ConnectionError, BlockingIOError, GeneratorExit, newUnicodeDecodeError, ChildProcessError, newBlockingIOError, raiseErrnoWithPath, InterruptedError, $, NotADirectoryError, newStopIteration, errnoMsg, NotImplementedError, BrokenPipeError, TimeoutError, UnicodeError, TypeError, msg, raiseExcWithPath, osErrorMsgWithPath, UnicodeDecodeError, raiseErrno, tryOsOp, ConnectionRefusedError, IsADirectoryError, raiseExcWithPath, noWeirdTarget, $, ArithmeticError, tryOsOp, BlockingIOError, StopAsyncIteration, PyOSError, ConnectionAbortedError, raiseErrnoT, SystemExit, tryOsOp, FileNotFoundError, PyOSError, ConnectionResetError, BlockingIOError, StopIterationT, tryOsOp, PyOSError, NameError, newBlockingIOError, $, KeyboardInterrupt, raiseExcWithPath, newUnicodeDecodeError, newPyOSError, StopIteration, PermissionError, ProcessLookupError, msg, FileExistsError, newPyOSError, raiseExcWithPath, ZeroDivisionError, async, define, init_subclass, def, new, lambda, PySignatureSupportGenerics, unpack, pass, with, del, :=, class, tonim