Skip to main content

Ignorely

A flexible CLI tool for filtering and copying files using include/exclude patterns, similar to Git's ignore functionality.

Features

  • File Filtering: List files using include/exclude patterns
  • File Copying: Copy filtered files with various options
  • Unified Export: Filter and copy files in one command
  • Pattern Management: Support for multiple pattern files via table-of-contents files
  • Flexible Output: Support for flat or hierarchical directory structures
  • Dry Run Mode: Preview operations before executing

Installation

pip install ignorely

Or install from source:

git clone <repository-url>
cd ignorely
pip install .

Quick Start

  1. Create pattern files in .ignorely/ directory:

    mkdir .ignorely
    echo ".gitignore" > .ignorely/exclude_tot
    echo "include_patterns.txt" > .ignorely/include_tot
    
  2. List filtered files:

    ignorely ls-files
    
  3. Export filtered files to a directory:

    ignorely export-files output/
    

Commands

ls-files - List filtered files

List files with include/exclude filtering.

ignorely ls-files [OPTIONS]

Options:

  • -o, --output FILE: Save output to file instead of displaying
  • -e, --exclude-tot FILE: File containing exclude pattern files (default: .ignorely/exclude_tot)
  • -i, --include-tot FILE: File containing include pattern files (default: .ignorely/include_tot)

Examples:

# List all filtered files
ignorely ls-files

# Save file list to output.txt
ignorely ls-files -o output.txt

# Use custom pattern files
ignorely ls-files -e custom_exclude.txt -i custom_include.txt

copy-files - Copy files from list

Copy files to output directory based on provided file list.

ignorely copy-files OUTPUT_DIR [OPTIONS]

Options:

  • -l, --list-file FILE: Read file list from file
  • -d, --dry-run: Show what would be copied without actually copying
  • --flatten: Flatten directory structure using divider in filenames
  • --divider CHAR: Character to use as path divider when flattening (default: %)
  • -c, --clean: Clean (remove) output directory before copying

Examples:

# Copy files from stdin
ignorely ls-files | ignorely copy-files output/

# Copy files from file list
ignorely copy-files output/ -l files.txt

# Dry run to preview operations
ignorely copy-files output/ -l files.txt --dry-run

# Flatten directory structure
ignorely copy-files output/ -l files.txt --flatten

# Clean output directory before copying
ignorely copy-files output/ -l files.txt --clean

export-files - Filter and copy in one step

Combines ls-files and copy-files functionality.

ignorely export-files OUTPUT_DIR [OPTIONS]

Options:

  • -e, --exclude-tot FILE: File containing exclude pattern files (default: .ignorely/exclude_tot)
  • -i, --include-tot FILE: File containing include pattern files (default: .ignorely/include_tot)
  • -d, --dry-run: Show what would be copied without actually copying
  • --flatten: Flatten directory structure using divider in filenames
  • --divider CHAR: Character to use as path divider when flattening (default: %)
  • -c, --clean: Clean (remove) output directory before copying

Examples:

# Export filtered files
ignorely export-files output/

# Export with flattened structure
ignorely export-files output/ --flatten

# Dry run export
ignorely export-files output/ --dry-run

# Clean and export
ignorely export-files output/ --clean

Pattern Files

Ignorely uses "table-of-contents" files to manage multiple pattern files:

Exclude Table-of-Contents (.ignorely/exclude_tot)

Lists pattern files containing exclusion rules:

.gitignore
.dockerignore
custom_exclude.txt

Include Table-of-Contents (.ignorely/include_tot)

Lists pattern files containing inclusion rules:

include_patterns.txt
important_files.txt

Pattern File Format

Pattern files use Git-style wildcard patterns:

# This is a comment
*.log
temp/
**/node_modules/
!important.log

Pattern Matching

Ignorely uses the same pattern matching as Git:

  • *: Matches any number of characters except /
  • **: Matches any number of characters including /
  • ?: Matches any single character except /
  • !: Negates a pattern (include instead of exclude)
  • #: Comments (ignored)

Examples

Basic Usage

# Create basic setup
mkdir .ignorely
echo ".gitignore" > .ignorely/exclude_tot
echo "*.py" > include_python.txt
echo "include_python.txt" > .ignorely/include_tot

# List Python files not in .gitignore
ignorely ls-files

# Export Python files to dist/
ignorely export-files dist/

Advanced Filtering

# Multiple exclude patterns
cat > .ignorely/exclude_tot << EOF
.gitignore
.dockerignore
build_ignore.txt
EOF

# Multiple include patterns
cat > .ignorely/include_tot << EOF
source_files.txt
docs_files.txt
EOF

# Export with flattened structure
ignorely export-files release/ --flatten --divider=__

Pipeline Usage

# Filter and process files
ignorely ls-files | grep "\.py$" | ignorely copy-files python_files/

# Export specific patterns
ignorely export-files backup/ -e custom_exclude.txt

Dependencies

  • cleo: CLI framework
  • pathspec: Git-style pattern matching

Requirements

  • Python >= 3.10

License

[Add your license information here]

Contributing

[Add contributing guidelines here]

Metadata

Release files for ignorely 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ignorely 3.0.0
File Size Uploaded Provenance Actions
ignorely-3.0.0.tar.gz 9.8 kB Without provenance Details for ignorely-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ignorely 3.0.0
File Interpreter ABI Platform Actions
ignorely-3.0.0-py3-none-any.whl Python 3 none any Details for ignorely-3.0.0-py3-none-any.whl

Total release size: 20.7 kB

Release files / ignorely-3.0.0.tar.gz

Download URL ignorely-3.0.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
72f1da518210be3193970ec893e2f3e0e66da70357d74d4edb072320a6a5114b
BLAKE2b-256 checksum
How to use checksums
b4a744150688d81701978ce0b1c47fc2d42b69606345e5d9f106a4f5d9360600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Release files / ignorely-3.0.0-py3-none-any.whl

Download URL ignorely-3.0.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09be175199a9ec2cfc6bce4dffbba4aaa2bca192b784d9ef0148212d2814b488
BLAKE2b-256 checksum
How to use checksums
3b3736c91c478819b10e4b25c4c7001314aad5c30b13429a6f179217063e2266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Security for ignorely 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page