0.1.3 • Published 4 years ago

node-python-funcs v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

node-python-funcs

Implements various Python functions and methods for use in Node

Docs

Classes

Functions

str

Class to imitate Python str

Kind: global class

new str(string)

ParamType
stringstring

str.partition() ⇐ partition

Kind: instance method of str Extends: partition

str.split() ⇐ split

Kind: instance method of str Extends: split

dict

Class to imitate Python dicts

Kind: global class

new dict(value)

ParamTypeDescription
valueobjectThe native JavaScript object you wish to

dict.items() ⇒ array

Kind: instance method of dict

dict.clear()

Kind: instance method of dict

dict.get(key, def) ⇒ object | array | string | function | boolean | number

Kind: instance method of dict

ParamTypeDefault
keystring
def*

dict.pop(key, def) ⇒ *

Kind: instance method of dict

ParamTypeDefault
keystring
def*

dict.setdefault(key, def) ⇒ *

Kind: instance method of dict

ParamTypeDefault
keystring
def*

dict.keys() ⇒ array

Kind: instance method of dict

dict.update(other)

Kind: instance method of dict

ParamType
otherobject

dict.values() ⇒ array

Kind: instance method of dict

range(start, stop, step)

Function to imitate Python's range function Returns an Array that produces a sequence of integers from start (inclusive) to stop (exclusive) by step.

Kind: global function

ParamTypeDefaultDescription
startnumberThe starting number. Defaults to 0.
stopnumberThe end number.
stepnumber1Specifies the increment (or decrement). Defaults to 1.

len(thing) ⇒ number

Function to imitate Python's len() function. Wrapper function around the .length property.

Kind: global function

ParamType
thing*

partition(string, sep) ⇒ array

Function to imitate Python's str.split() method, since JavaScript can't split x times

Kind: global function Returns: array - An Array containing the split string

ParamTypeDescription
stringstringThe string you want split.
sepstringThe seperator by which you want the string to be split

split(string, sep, maxCount) ⇒ array

Function to imitate Python's str.split method, since JavaScript can't split x times

Kind: global function Returns: array - An Array containing the split string

ParamTypeDefaultDescription
stringstringThe string you want split.
sepstringThe seperator by which you want the string to be split
maxCountnumberThe maximum count of times you wish to split

chunks(l, n)

Yield successive n-sized chunks from l.

Kind: global function

ParamType
larray
nnumber