Code Monkey home page Code Monkey logo

js-itertools's Introduction

๐Ÿ› ๏ธ js-itertools License


ยฉ xkcd.com

Python's iterable and iterator library for JavaScript. Parent is js-library.

โš ๏ธ Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {cycle} from '@iterable-iterator/cycle';
import {chain} from '@iterable-iterator/chain';
cycle( chain( [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] ) ) ; // 0 1 2 3 4 5 0 1 ...

๐Ÿ“ฐ Description

The goal of this project is to make (the parts that interest me of) the following python constructs/idioms/libraries available in JavaScript under the AGPL-3.0 license.

The corresponding software library used to be released as a monolith. It has since been split up into multiple packages.

๐ŸŒณ Hierarchy

The packages are released under multiple npm @scopes. Extra features are marked with a *.

๐Ÿ”— More references in Python and JavaScript

js-itertools's People

Contributors

a-flying-potato avatar danez avatar greenkeeper[bot] avatar greenkeeperio-bot avatar make-github-pseudonymous-again avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

js-itertools's Issues

frame

itertools.frame( 2 , "ABCD" ) ; // AB BC CD

very large and infinite generators issue

There are some generators that do not work well with infinite (or very large) generators. For some of them it is not so important (product, permutations, combinations ). However, the current implementation of group(by) could be changed to handle these kind of generators more efficiently. For an example of how to do see the Python 3.4 docs.

product on arrays

itertools.product currently merges arrays due to the use of concat in the code : this is not the defined behaviour. When fixed should increase major since it will break older code depending on this "feature".

exhaust and consume

Allows to empty a finite generator. Better solution than list because there is no buffer involved.

very large and infinite generators issue

There are some generators that do not work well with infinite (or very large) generators. For some of them it is not so important (product, permutations, combinations ). However, the current implementation of group(by) could be changed to handle these kind of generators more efficiently. For an example of how to do see the Python 3.4 docs.

by

itertools.by( 2 , "ABCDE" ) ; // AB CD E

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.