import math import operator import re from pydash.functions import Curry, CurryRight from pydash import *
All public functions are available from the main module.
import pydash
pydash.<function>
This is the recommended way to use pydash.
# OK (importing main module)
import pydash
pydash.where({})
# OK (import from main module)
from pydash import where
where({})
# NOT RECOMMENDED (importing from submodule)
from pydash.collections import where
Only the main pydash module API is guaranteed to adhere to semver. It's possible that backwards incompatibility outside the main module API could be broken between minor releases.
There is a special py_
instance available from pydash
that supports method calling and method chaining from a single object:
from pydash import py_
# Method calling
py_.initial([1, 2, 3, 4, 5]) == [1, 2, 3, 4]
# Method chaining
py_([1, 2, 3, 4, 5]).initial().value() == [1, 2, 3, 4]
# Method aliasing to underscore suffixed methods that shadow builtin names
py_.map is py_.map_
py_([1, 2, 3]).map(_.to_string).value() == py_([1, 2, 3]).map_(_.to_string).value()
The py_
instance is basically a combination of using pydash.<function>
and pydash.chain
.
A full listing of aliased py_
methods:
_.object
ispydash.arrays.object_
_.slice
ispydash.arrays.slice_
_.zip
ispydash.arrays.zip_
_.all
ispydash.collections.all_
_.any
ispydash.collections.any_
_.filter
ispydash.collections.filter_
_.map
ispydash.collections.map_
_.max
ispydash.collections.max_
_.min
ispydash.collections.min_
_.reduce
ispydash.collections.reduce_
_.pow
ispydash.numerical.pow_
_.round
ispydash.numerical.round_
_.sum
ispydash.numerical.sum_
_.property
ispydash.utilities.property_
_.range
ispydash.utilities.range_
pydash.arrays
pydash.chaining
pydash.collections
pydash.functions
pydash.numerical
pydash.objects
pydash.predicates
pydash.strings
pydash.utilities