node-python-funcs v0.1.3
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)
Param | Type |
---|---|
string | string |
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
- dict
- new dict(value)
- .items() ⇒
array
- .clear()
- .get(key, [def]) ⇒
object
|array
|string
|function
|boolean
|number
- .pop(key, [def]) ⇒
*
- .setdefault(key, [def]) ⇒
*
- .keys() ⇒
array
- .update(other)
- .values() ⇒
array
new dict(value)
Param | Type | Description |
---|---|---|
value | object | The 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
Param | Type | Default |
---|---|---|
key | string | |
def | * |
dict.pop(key, def) ⇒ *
Kind: instance method of dict
Param | Type | Default |
---|---|---|
key | string | |
def | * |
dict.setdefault(key, def) ⇒ *
Kind: instance method of dict
Param | Type | Default |
---|---|---|
key | string | |
def | * |
dict.keys() ⇒ array
Kind: instance method of dict
dict.update(other)
Kind: instance method of dict
Param | Type |
---|---|
other | object |
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
Param | Type | Default | Description |
---|---|---|---|
start | number | The starting number. Defaults to 0. | |
stop | number | The end number. | |
step | number | 1 | Specifies 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
Param | Type |
---|---|
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
Param | Type | Description |
---|---|---|
string | string | The string you want split. |
sep | string | The 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
Param | Type | Default | Description |
---|---|---|---|
string | string | The string you want split. | |
sep | string | The seperator by which you want the string to be split | |
maxCount | number | The maximum count of times you wish to split |
chunks(l, n)
Yield successive n-sized chunks from l.
Kind: global function
Param | Type |
---|---|
l | array |
n | number |