$npx skillfedfor your agent

first

Return the first true value of an iterable.

Worth itPyPI Python ModulesReleased Mar 2019785.1K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — first-2.0.2-py2.py3-none-any.whl
v2.0.2 · released 2019-03-07

Yes. This is a stable, MIT-licensed utility with zero dependencies and low install friction. It solves a genuine readability problem in Python iteration patterns. Use it when you find yourself writing next(filter(...)) or generator comprehensions with conditionals—first() is clearer and more Pythonic. The 2019 release date is not a concern given the code's simplicity and the active repository.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python, no runtime dependencies, and actively maintained with recent commits.
  • Last release was 2019-03-07, but repository shows ongoing activity as of 2026-03-15.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.

last release 2019-03-07 (2717 days) · last repo commit 2026-03-15 · 156 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 785,098 downloads/mo, #5,069 on PyPI

Verify before relying

from first import first

# Basic usage
result = first([0, None, False, [], (), 42])
print(result)  # Output: 42

# With key function
result = first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)
print(result)  # Output: 4

# With default
result = first([0, None, False, [], ()], default=42)
print(result)  # Output: 42
  • Whether the package is actively maintained beyond the 2019 release date, despite recent repository commits.
Same gist for agents: .md · .json

What it is and what it does

first is a minimal utility that extracts the first truthy value from an iterable, returning None (or a specified default) if no such value exists. It solves a common Python pattern that would otherwise require awkward constructs like next(filter(...)) or generator expressions with conditional logic.

The package provides a single function with three parameters: the iterable to search, an optional key function to customize how truthiness is evaluated (similar to how sorted() uses key), and an optional default to return when no true value is found. It has no dependencies and works across Python 2 and 3 implementations, making it a drop-in replacement for verbose iteration patterns, particularly useful in regex matching chains or filtering operations where readability matters.

Use it for

  • Extract the first matching regex result from multiple compiled patterns without nested conditionals or repeated match calls.
  • Find the first non-empty or non-zero value in a sequence of candidates with a single readable function call.
  • Select the first element satisfying a custom condition (e.g., first even number) using a key function instead of filter + next.
  • Provide a fallback value when iterating through optional results that may all be falsy.
  • Simplify common patterns in data validation pipelines where you need the first valid or non-null result.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a stable, MIT-licensed utility with zero dependencies and low install friction. It solves a genuine readability problem in Python iteration patterns. Use it when you find yourself writing next(filter(...)) or generator comprehensions with conditionals—first() is clearer and more Pythonic. The 2019 release date is not a concern given the code's simplicity and the active repository.

Install

first on PyPI

Before you install

Low friction: pure Python, no runtime dependencies, and actively maintained with recent commits. Last release was 2019-03-07, but repository shows ongoing activity as of 2026-03-15.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.

Quickstart

from first import first

# Basic usage
result = first([0, None, False, [], (), 42])
print(result)  # Output: 42

# With key function
result = first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)
print(result)  # Output: 4

# With default
result = first([0, None, False, [], ()], default=42)
print(result)  # Output: 42

Verify before relying

  • Whether the package is actively maintained beyond the 2019 release date, despite recent repository commits.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 2,717 days since the last release
Last repo commit
First released
Downloads785,098 / month, #5,069 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Evidence: first-2.0.2-py2.py3-none-any.whl

Tags

Capabilities
first true value from iterableget first matching elementfilter and return firstiterable first elementconditional first matchfirst truthy valueselect first from sequence
Topics
iteration-utilityfunctional-programming

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “first true value from iterable”

  • firstReturns the first true value from an iterable, with optional key…
  • nr-streamProvides functional-style utilities for Python including Optional,…
  • iterable-ioWraps iterables (generators, lists, etc.) as file-like objects so…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also nr-stream · pyfunctional · iterfzf · iterproxy · real-regex · pipe · fuzzysearch · simpleeval · google-re2 · seqlog