Socket
Socket
Sign inDemoInstall

zydmayday-pamda

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    zydmayday-pamda

A small clone of ramda


Maintainers
1

Readme

pamda

This is a repo try to copy https://github.com/ramda/ramda in python.

install

For whom wants to use this package.

> pip install zydmayday-pamda
> pip install zydmayday-pamda -U # get the latest

Usage

>>> from pamda import curry
>>> def sum(a, b, c): return a + b + c
>>> curry(sum)(1)(2, 3)
6
>>> import pamda as R # similar to ramda syntax
>>> def sum(a, b, c): return a + b + c
>>> R.curry(sum)(1)(2, 3)
6

Contribute

For whom wants to contribute to this repo.

# see: https://pre-commit.com/ for more details
$ pre-commit install # install hooks

Check the latest branch to be released in here.

Checkout new branch from that release branch and create PR.

CheckList

Functions supported now.

  • __
  • add
  # different from ramda, ramda treat null as 0
  >>> R.add(None, None) # float('nan)
  • addIndex
  • adjust
  • all
    • Transducer part is not fully tested.
  • allPass
  • always
  • And (and is a keyword in python)
  • andThen
  • any
  • anyPass
  • ap
  • aperture
  • append
  • apply
  • applySpec
  • applyTo
  • ascend
  • assoc
  • assocPath
  • binary
  • bind
  • both
  • call
  • chain
  • clamp
  • clone
  • collectBy
  • comparator
  • complement
  • compose
  • composeWith
  • concat
  • cond
  • construct
  • constructN
  • converge
  • count
  • countBy
  • curry
  • curryN
  • dec
  • defaultTo
  • descend
  • difference
  • differenceWith
  • dissoc
  • dissocPath
  • divide
  • drop
  • dropLast
  • dropLastWhile
  • dropRepeats
  • dropRepeatsWith
  • dropWhile
  • either
  • empty
  • endsWith
  • eqBy
  • eqProps
  • equals
  • evolve
  • F
  • filter
  • find
  • findIndex
  • findLast
  • findLastIndex
  • flatten
  • flip
  • forEach
  • forEachObjIndexed
  • fromPairs
  • groupBy
  • groupWith
  • gt
  • gte
  • has
  • hasIn
  • hasPath
  • head
  • identical
  • identity
  • ifElse
  • inc
  • includes
  • indexBy
  • indexOf
  • init
  • innerJoin
  • insert
  • insertAll
  • intersection
  • intersperse
  • into
  • invert
  • invertObj
  • invoker
  • is
  • isEmpty
  • isNil
  • join
  • juxt
  • keys
# When using R.keys(obj) and obj is a class instance, we use obj.__dict__ as keys.
class A:
  c = 'not included'
  def __init__(self):
    self.a = 1
    self.b = 2
a = A()
R.keys(a) # ['a', 'b']
  • keysIn
  • last
  • lastIndexOf
  • length
  • lens
  • lensIndex
  • lensPath
  • lensProp
  • lift
  • liftN
  • lt
  • lte
  • Map (map is a keyword in python)
  • mapAccum
  • mapAccumRight
  • mapObjIndexed
  • match
  • mathMod
  • max
  • maxBy
  • mean
  • median
  • memoizeWith
  • mergeAll
  • mergeDeepLeft
  • mergeDeepRight
  • mergeDeepWith
  • mergeDeepWithKey
  • mergeLeft
  • mergeRight
  • mergeWith
  • mergeWithKey
  • min
  • minBy
  • modify
  • modifyPath
  • modulo
  • move
  • multiply
  • nAry
  • negate
  • none
  • not
  • nth
  • nthArg
  • o
  • objOf
  • of
  • omit
  • on
  • once
  • or
  • otherwise
  • over
  • pair
  • partial
  • partialObject
  • partialRight
  • partition
  • path
  • pathEq
  • pathOr
  • paths
  • pathSatisfies
  • pick
  • pickAll
  • pickBy
  • pipe
  • pipeWith
  • pluck
  • prepend
  • product
  • project
  • promap
  • prop
  • propEq
  • propIs
  • propOr
  • props
  • propSatisfies
  • range
  • reduce
  • reduceBy
  • reduced
  • reduceRight
  • reduceWhile
  • reject
  • remove
  • repeat
  • replace
  • reverse
  • scan
  • sequence
  • set
  • slice
  • sort
  • sortBy
  • sortWith
  • split
  • splitAt
  • splitEvery
  • splitWhen
  • splitWhenever
  • startsWith
  • subtract
  • sum
  • symmetricDifference
  • symmetricDifferenceWith
  • T
  • tail
  • take
  • takeLast
  • takeLastWhile
  • takeWhile
  • tap
  • test
  • thunkify
  • times
  • toLower
  • toPairs
  • toPairsIn
  • toString
  • toUpper
  • transduce
  • transpose
  • traverse
  • trim
  • tryCatch
  • type
  • unapply
  • unary
  • uncurryN
  • unfold
  • union
  • unionWith
  • uniq
  • uniqBy
  • uniqWith
  • unless
  • unnest
  • until
  • unwind
  • update
  • useWith
  • values
  • valuesIn
  • view
  • when
  • where
  • whereAny
  • whereEq
  • without
  • xor
  • xprod
  • zip
  • zipObj
  • zipWith

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc