skillfed

formic2

An implementation of Apache Ant FileSet and Globs

formic2 v1.0.3 890.7K downloads/30d#4,803 on PyPI3
Copyleft license GPLv3+ Abandoned released

What it is and what it does

Formic is a Python port of Apache Ant's FileSet and glob pattern system, letting you specify sets of files using include and exclude patterns rather than enumerating them individually. It adds support for the ** wildcard (matching any number of directory levels) and can recursively scan directory trees, which Python's built-in glob and fnmatch modules do not handle as flexibly.

You can use formic2 from the command line to find files matching complex patterns, or import it into Python code to iterate over matching file paths. It automatically excludes common VCS directories and Python cache directories by default. The package has no external runtime dependencies and supports Python 2.6+ and 3.4+, but has not been maintained since 2018-05-25.

Use it for:

  • Build scripts that need to find all Python source files while excluding test directories and __init__.py files
  • Command-line file discovery with complex patterns to pipe into other tools
  • Batch operations on files matching Ant-style glob patterns in a large directory tree
  • Migrating build logic from Apache Ant or Maven projects to Python while preserving glob semantics

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Formic implements Apache Ant FileSet and glob patterns to find files recursively using include/exclude rules, including the ** wildcard for matching arbitrary directory levels.

No. While formic2 has no runtime dependencies and low install friction, it has been abandoned since 2018-05-25 with no maintenance. The GPLv3+ copyleft license also restricts use in proprietary code. For modern Python projects, consider using standard library alternatives or actively maintained packages.

Install

formic2 on PyPI

pip

pip install formic2

uv

uv add formic2

poetry

poetry add formic2

Installing formic2

Before you install

Installation is straightforward with no runtime dependencies. However, the project has been abandoned since 2018-06-01 with no releases since 2018-05-25, so maintenance and bug fixes are not forthcoming.

License in practice

Licensed under GPLv3+, a copyleft license. Any code that imports and uses formic2 must be compatible with GPLv3+ terms, including potential source code disclosure obligations.

Quickstart

pip install formic2

import formic
fileset = formic.FileSet(include="**.py",
                         exclude=["**/*test*/**", "test_*"],
                         directory="./")
for file_name in fileset:
    print(file_name)

Verify before relying

  • Whether the package works reliably on Python versions released after 2018-05-25
  • Current status of reported issues on GitHub given the abandoned maintenance status
  • Whether default excludes still match modern Python directory structures

Package facts

License GPLv3+ (copyleft)
Python support supports the current Python release (>=2.6, <4)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 3,003 days since the last release
Last repo commit
First released
Downloads 890,716/month — #4,803 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: formic2-1.0.3-py2-none-any.whl; formic2-1.0.3-py3-none-any.whl

Keywords: Apache Ant, glob, recurse, FileSet, file utilities, find, fnmatcher

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Programming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: LibrariesTopic :: Utilities

Tags

ant glob patterns pythonrecursive file matchingapache fileset implementationpython file discoveryglob with exclude patternsdirectory tree searchwildcard file finding
file-discoverybuild-automationant-compatible

More Libraries packages