# pytils

> pytils

Latest version **1.40.3** (published 2018-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install pytils
pnpm add pytils
yarn add pytils
bun add pytils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.40.3 |
| Published | 2018-01-23 |
| First published | 2016-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NPM pytils |
| Maintainers | heyderpd |
| Keywords | ramda, python, utils, lib |

## Links

- npm: https://www.npmjs.com/package/pytils
- Repository: https://github.com/heyderpd/npm-pytils
- Homepage: https://github.com/heyderpd/npm-pytils#readme
- Issues: https://github.com/heyderpd/npm-pytils/issues
- npm.io page: https://npm.io/package/pytils

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.40.3 (latest) — 2018-01-23
- 1.40.2 — 2018-01-23
- 1.40.1 — 2017-08-18
- 1.40.0 — 2017-08-15
- 1.39.2 — 2017-07-02
- 1.39.1 — 2017-07-02
- 1.39.0 — 2017-07-02
- 1.35.2 — 2017-06-27
- 1.35.1 — 2017-06-23
- 1.33.0 — 2017-06-23
- 1.32.2 — 2017-06-22
- 1.32.1 — 2017-06-22
- 1.32.0 — 2017-06-22
- 1.31.0 — 2017-06-17
- 1.30.1 — 2017-06-17
- … 15 more at https://npm.io/package/pytils/versions

## README

# pytils: functions utils like python
many functions that use to simplify my javascript and that the syntax is inspired by python and ramda

## I will help if you have any difficulty =)
Contact me by [github:heyderpd](https://github.com/heyderpd). I'll be glad to help you.

## Thanks for [npm~lucasmreis](https://www.npmjs.com/~lucasmreis)
```javascript
npm install --save pytils
```

## Example:
```terminal
const p = require('pytils')

p.compose = function ( _arrayOfFunctions ) // return function waiting for input
p.curry   = function ( _function ) // return function waiting for input
p.path [curry] = function ( _arrPathOfProps, _object ) // return prop of _object in path or undefined
p.reduce = ( _object , fx ) // do each of any type, pass to function var's (key, value) to return a value

p.copy    = ( _object ) // copy any types
p.length  = ( _object ) // get length of any type, return -1 if can't
p.keys    = ( _object ) // get keys of any type, return [] if can't
p.values  = ( _object ) // get values of any type, return [] if can't
p.hasProp = ( _object , prop ) // of any type, return true or false

p.type     = function ( _object ) // return type of var in a string
p.isType   = function ( _object , _type_need) // return true or false
p.isString = function ( _object ) // return true or false
p.isNumber = function ( _object ) // return true or false
p.isArray  = function ( _object ) // return true or false
p.isObject = function ( _object ) // return true or false
p.isFunction = function ( _object ) // return true or false
p.isAOF  = function ( _object ) // return true or false if is isArray OR isObject OR isFunction
p.isNull = function ( _object ) // return true or false
p.isUndefined = function ( _object ) // return true or false

p.toObject = ( _array ) // convert array to object, return object have values of array in keys of object
p.arrayDiff = ( _array base , _array compare ) // compare two array and return the diff values of base
p.invertObj = ( _object ) // convert object keys in value and value in keys
p.uniq = ( _array ) // get unique values of array, work with simple var's
p.eq1True   = ( _array ) // if is a array of one value of true, return true
p.uniqWith  = ( _comparator, _array ) // foreach array and return unique itens with comparator
p.uniqObject  = ( _objectA, _objectB ) // compare all prop of two object and return if is equal
p.ojbFromVals = ( _array ) // create object from array values
p.ifThrow = ( bool, string ) // trow text erro if bool is true

var _function = function( key, value ) { console.log('item: ', keys, ' = ', value) }
p.map [curry] = ( _function , _object ) // do each of any type, pass to function var's (key, value)
p.mapx = ( _object , _function ) // do each of any type, pass to function var's (key, value)

var _dictionary = { toA, 'fromB', toC: 'fromD' }
p.translate [curry] = ( _dictionary, _array ) // translate object using dictionary of props
```

---
_Source: https://npm.io/package/pytils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
