Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Flatten nested iterable object

Project description

flati

travis-ci.org coveralls.io pyversion latest version license

Flatten nested iterable object

INSTALLATION

$ pip install flati

USAGE

import flati

iterable = [(1, 2, 3), (4, (5, 6))]
list(flati.flatten(iterable))
# => [1, 2, 3, 4, 5, 6]

# flati.flatten() returns a generator
import types
isinstance(flati.flatten(iterable), types.GeneratorType)
# => True

iterable = [('abc'), ('def', ('g', 'hi'))]
list(flati.flatten(iterable, ignore=str))
# => ['abc', 'def', 'g', 'hi']

CHANGES

0.1.1 (2019-1-28)

  • Support Python 2.7

0.1 (2019-1-27)

  • First release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flati, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size flati-0.1.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page