pseek 3.3.1__tar.gz → 3.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,10 @@ jobs:
10
10
 
11
11
  runs-on: ubuntu-latest
12
12
 
13
+ concurrency:
14
+ group: pseek-pypi-publish
15
+ cancel-in-progress: false
16
+
13
17
  permissions:
14
18
  contents: read
15
19
 
@@ -51,3 +55,4 @@ jobs:
51
55
  uses: pypa/gh-action-pypi-publish@release/v1
52
56
  with:
53
57
  password: ${{ secrets.PYPI_API_TOKEN }}
58
+ skip-existing: true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pseek
3
- Version: 3.3.1
3
+ Version: 3.4.1
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -28,7 +28,70 @@ Project-URL: Repository, https://github.com/grootle/pseek
28
28
 
29
29
  # Pseek
30
30
 
31
- Fast and powerful command-line search tool for finding files, directories, and text content.
31
+ Fast and powerful command-line search tool for finding files, directories, and text content.
32
+
33
+ ## Table of Contents
34
+
35
+ * [Features](#features)
36
+ * [Installation](#installation)
37
+ * [Install from PyPI](#install-from-pypi-recommended)
38
+ * [Install from Source](#install-from-source)
39
+ * [Basic Usage](#basic-usage)
40
+ * [Command Options Table](#command-options)
41
+ * [Specifying the Root Directory](#specifying-the-root-directory)
42
+ * [Search Types](#search-types)
43
+ * [File Names](#search-file-names)
44
+ * [Directory Names](#search-directory-names)
45
+ * [File Contents](#search-file-contents)
46
+ * [All Types Simultaneously](#search-everywhere)
47
+ * [Query Modes](#query-modes)
48
+ * [Case Sensitive](#case-sensitive-search)
49
+ * [Whole Word](#whole-word-search)
50
+ * [Regular Expression (Regex)](#regular-expression-search)
51
+ * [Fuzzy](#fuzzy-search)
52
+ * [Fuzzy Similarity Threshold](#fuzzy-similarity-threshold)
53
+ * [Expression Queries](#expression-queries)
54
+ * [Operators](#supported-operators)
55
+ * [AND](#and)
56
+ * [OR](#or)
57
+ * [NOT](#not)
58
+ * [PARENTHESES](#parentheses)
59
+ * [Prefixes](#expression-prefixes)
60
+ * [Regex](#regex)
61
+ * [Case Sensitive](#case-sensitive)
62
+ * [Whole Word](#whole-word)
63
+ * [Fuzzy](#fuzzy)
64
+ * [Combined Prefixes](#combined-prefixes)
65
+ * [Automatic Filtering](#automatic-filtering)
66
+ * [Manual Filtering](#manual-filtering)
67
+ * [Globs](#globs)
68
+ * [Extension](#extension-filters)
69
+ * [Path](#path-filters)
70
+ * [Include](#include-paths)
71
+ * [Exclude](#exclude-paths)
72
+ * [Regex Path](#regex-path-filters)
73
+ * [Include](#include)
74
+ * [Exclude](#exclude)
75
+ * [Size](#size-filtering)
76
+ * [Depth](#depth)
77
+ * [Archive Search](#archive-search)
78
+ * [Nested Archives](#nested-archives)
79
+ * [Archive Filters](#archive-filters)
80
+ * [Depth](#archive-depth)
81
+ * [Extension](#extension-filters-1)
82
+ * [Path](#path-filters-1)
83
+ * [Size](#size-filter)
84
+ * [What's RAR Backend, and How to Configure It](#rar-backend)
85
+ * [Output Options](#output-options)
86
+ * [Show Full Paths](#show-full-paths)
87
+ * [Paths Only](#paths-only)
88
+ * [Context](#context)
89
+ * [Timeout](#timeout)
90
+ * [Statistics](#statistics)
91
+ * [Result Statistics](#result-statistics)
92
+ * [Search Statistics](#search-statistics)
93
+ * [Search time](#search-time)
94
+ * [Requirements](#requirements)
32
95
 
33
96
  ## Features
34
97
 
@@ -141,6 +204,7 @@ psk -- --path
141
204
  | `--no-require-git` | When this flag is given, source control ignore files such as .gitignore are respected even if no git repository is present. By default, Pseek will only respect filter rules from source control ignore files when Pseek detects that the search is executed inside a source control repository. For example, when a .git directory is observed |
142
205
  | `--hidden` | Search hidden files and directories. By default, hidden files and directories are skipped. Note that if a hidden file or a directory is whitelisted in an ignore file, then it will be searched even if this flag isn't provided. Similarly if a hidden file or directory is given explicitly as path argument or include option |
143
206
  | `--follow` | Follow symbolic links while traversing directories. This behavior is disabled by default. Symbolic link loops and broken links are automatically skipped. Symbolic links are given explicitly as path argument or include option then they will be searched even if this flag is disabled |
207
+ | `--glob` | Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs |
144
208
  | `--archive` | Enable search within archive files (e.g. `zip`, `rar`, `7z`, `gz`, `bz2`, `xz`, `tar`, `tar.gz`, `tar.bz2`, `tar.xz`) |
145
209
  | `--arc-depth` | Limit nested archive to given depth range. By default, there is no limit |
146
210
  | `--arc-ext`, `--arc-exc-ext` | Filter by file extension inside archive files |
@@ -151,7 +215,7 @@ psk -- --path
151
215
  | `--paths-only` | Only show matching file paths for content search |
152
216
  | `--stats` | Show search statistics including result counts and search time |
153
217
 
154
- ## Specifying the root directory
218
+ ## Specifying the Root Directory
155
219
 
156
220
  To search a specific directory, path can be given as a second argument:
157
221
 
@@ -233,7 +297,7 @@ psk error\d+ --regex
233
297
 
234
298
  Example matches: `error1`, `error25`, `error999`
235
299
 
236
- ## Fuzzy Search
300
+ ### Fuzzy Search
237
301
 
238
302
  Fuzzy search allows approximate matching.
239
303
 
@@ -245,7 +309,9 @@ psk apple --fuzzy
245
309
 
246
310
  Can match: `appl`, `appel`, `aple`
247
311
 
248
- ### Fuzzy Similarity Threshold
312
+ > **Note:** To improve performance, highlighting of matches is automatically disabled if the `--fuzzy` flag is enabled and the `--word` flag is disabled.
313
+
314
+ #### Fuzzy Similarity Threshold
249
315
 
250
316
  ```bash
251
317
  psk apple --fuzzy --fuzzy-level 90
@@ -275,6 +341,8 @@ Enable:
275
341
  psk '("error" or "warning") and not "debug"' --expr
276
342
  ```
277
343
 
344
+ > **Note:** When using `--expr`, queries are double-quoted and backslashes have special meaning. Ordinary queries use JSON-style escaping, so `\n` and `\t` represent newline and tab characters, respectively. Use `\\n` or `\\t` to search for those literal sequences. Regex queries (`r"..."`) preserve regex escapes, which are interpreted by the regex engine.
345
+
278
346
  ### Supported Operators
279
347
 
280
348
  #### AND
@@ -361,7 +429,7 @@ Example:
361
429
  psk 'f"apple"' --expr
362
430
  ```
363
431
 
364
- ### Combined Prefixes
432
+ #### Combined Prefixes
365
433
 
366
434
  Prefixes can be combined.
367
435
 
@@ -391,51 +459,86 @@ Allowed modes: `r`, `c`, `w`, `f`, `rc`, `cr`, `cw`, `wc`, `cf`, `fc`, `wf`, `fw
391
459
 
392
460
  > **Note:** Whole word matching and regex matching cannot be used at the same time, because we can use `\b` in regex to enable whole word matching: `r"\btext\b"`
393
461
 
394
- ## Context
462
+ ## Automatic Filtering
395
463
 
396
- Show context lines around each match. The value is specified as `BEFORE:AFTER`:
464
+ Pseek automatically filters files and directories during recursive searches using the same ignore-matching backend and ignore-rule semantics used by [ripgrep](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering).
397
465
 
398
- ```bash
399
- --context 2 # 2 lines before and after
400
- --context 2:0 # 2 lines before, none after
401
- --context 0:2 # none before, 2 lines after
402
- --context 2:5 # 2 lines before, 5 lines after
403
- --context 2: # 2 lines before, none after
404
- --context :2 # none before, 2 lines after
405
- --context 0 # matching lines only
406
- ```
466
+ By default, Pseek will ignore all of the following:
407
467
 
408
- Nearby matches whose context ranges overlap or directly touch are combined into a single group.
468
+ 1. Files and directories that match glob patterns in these sources:
469
+ * `.gitignore` globs. This includes .gitignore files in parent directories that are part of the same git repository. (Unless the `--no-require-git` flag is given)
470
+ * `.git/info/exclude`
471
+ * Git's global ignore file configured through `core.excludesFile`
472
+ * `.ignore` globs, which take precedence over all gitignore globs when there's a conflict. This includes `.ignore` files in parent directories.
473
+ * Ignore files from parent directories, when applicable (Unless the `--no-ignore-parent` flag is given)
474
+ 2. Binary files for content search. (any file with a NUL byte to be binary)
475
+ 3. Hidden files and directories. (A file or directory is considered hidden if its base name starts with a dot character `.`)
476
+ 4. Symbolic links aren't followed
409
477
 
410
- ## Depth
478
+ All of these things can be toggled using various flags:
411
479
 
412
- Controls how deep the search goes inside directories.
480
+ 1. You can disable all git-related filtering with the `--no-ignore` flag.
481
+ 2. Hidden files and directories can be searched with the `--hidden` flag.
482
+ 3. Symbolic links can be searched with the `--follow` flag.
413
483
 
414
- A depth of `0` means that only base path's immediate contents are searched; subdirectories are not entered.
484
+ For convenience, you can use the `--unrestricted` flag. This flag disables all the automatic filters mentioned above except the filter related to binary files for searching file contents.
485
+
486
+ The ignore rules are interpreted using the same matching and precedence semantics as ripgrep. When ignore files at different directory levels define conflicting rules, rules from a **deeper directory take precedence over rules inherited from its parent directories**.
487
+
488
+ Within the same directory level, ignore sources are applied with the following precedence, from highest to lowest:
415
489
 
416
490
  ```text
417
- project/ ← base directory
418
- ├── file.txt ← depth 0
419
- ├── folder1/ ← depth 0
420
- │ ├── file.txt ← depth 1
421
- │ └── folder2/ ← depth 1
422
- │ └── file.txt ← depth 2
491
+ .ignore
492
+ .gitignore
493
+ .git/info/exclude
494
+ global Git excludes (core.excludesFile)
423
495
  ```
424
496
 
425
- `--depth` can be specified multiple times to search non-contiguous depth ranges:
497
+ ## Manual Filtering
498
+
499
+ ### Globs
500
+
501
+ Filter files and directories using glob patterns. The `--glob` option can be specified multiple times to include or exclude paths from the search.
502
+
503
+ Pseek uses the same Git-style glob syntax and override precedence as [ripgrep](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#manual-filtering-globs).
504
+
505
+ Use a glob without a leading `!` to include matching paths:
426
506
 
427
507
  ```bash
428
- --depth 0 # Direct contents only
429
- --depth 1 # One level inside
430
- --depth 2:4 # Depths 2 through 4
431
- --depth 2 --depth 5:7 # Depths 2 and 5 through 7
432
- --depth :2 # Depths 0 through 2
433
- --depth 3: # Depth 3 and deeper
508
+ # Search only Python files
509
+ psk TODO --glob '*.py'
510
+
511
+ # Search Python and Rust files
512
+ psk TODO --glob '*.py' --glob '*.rs'
434
513
  ```
435
514
 
436
- If `--depth` is not specified, the search has no depth limit.
515
+ Use a leading `!` to exclude matching paths:
516
+
517
+ ```bash
518
+ # Exclude Python files
519
+ psk TODO --glob '!*.py'
520
+
521
+ # Include Python files, but exclude test files
522
+ psk TODO --glob '*.py' --glob '!*.test.py'
523
+ ```
437
524
 
438
- ## Extension Filters
525
+ > **Note:** The `!` prefix has the opposite meaning from its use in `.gitignore` files. With `--glob`, a pattern without `!` includes matching paths, while a pattern prefixed with `!` excludes them.
526
+
527
+ You can provide multiple `--glob` options. When multiple patterns match the same path, **the last matching pattern takes precedence**.
528
+
529
+ ```bash
530
+ # Include Python files, exclude tests, then include a specific test file
531
+ psk TODO \
532
+ --glob '*.py' \
533
+ --glob '!*.test.py' \
534
+ --glob important.test.py
535
+ ```
536
+
537
+ Command-line glob patterns take precedence over Pseek's automatic ignore rules, such as supported `.gitignore`, `.ignore`, Git exclude, and global Git ignore rules.
538
+
539
+ For more details about the ignore rules applied automatically, see [Automatic Filtering](#automatic-filtering).
540
+
541
+ ### Extension Filters
439
542
 
440
543
  Include only specific extensions:
441
544
 
@@ -449,9 +552,9 @@ Exclude extensions:
449
552
  psk TODO --exclude-ext exe --exclude-ext dll
450
553
  ```
451
554
 
452
- ## Path Filters
555
+ ### Path Filters
453
556
 
454
- ### Include Paths
557
+ #### Include Paths
455
558
 
456
559
  ```bash
457
560
  psk TODO \
@@ -461,7 +564,7 @@ psk TODO \
461
564
 
462
565
  Only search inside those paths.
463
566
 
464
- ### Exclude Paths
567
+ #### Exclude Paths
465
568
 
466
569
  ```bash
467
570
  psk TODO \
@@ -473,23 +576,23 @@ Skip those paths.
473
576
 
474
577
  > **Note:** The include and exclude paths will be combined with path argument.
475
578
 
476
- ## Regex Path Filters
579
+ ### Regex Path Filters
477
580
 
478
- ### Include
581
+ #### Include
479
582
 
480
583
  ```bash
481
584
  psk TODO \
482
585
  --re-include src/.*
483
586
  ```
484
587
 
485
- ### Exclude
588
+ #### Exclude
486
589
 
487
590
  ```bash
488
591
  psk TODO \
489
592
  --re-exclude "node_modules|dist"
490
593
  ```
491
594
 
492
- ## Size Filtering
595
+ ### Size Filtering
493
596
 
494
597
  | Syntax | Meaning |
495
598
  | ------------------------- | ------------------------------ |
@@ -526,41 +629,34 @@ Files between `1 MiB` and `10 MiB` will not match.
526
629
 
527
630
  > **Note:** Directory sizes are not calculated recursively. When `--size` is used, directories are automatically excluded from the search results.
528
631
 
529
- ## Automatic filtering
530
-
531
- Pseek automatically filters files and directories during recursive searches using the same ignore-matching backend and ignore-rule semantics used by [ripgrep](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering).
532
-
533
- By default, Pseek will ignore all of the following:
534
-
535
- 1. Files and directories that match glob patterns in these sources:
536
- * `.gitignore` globs. This includes .gitignore files in parent directories that are part of the same git repository. (Unless the `--no-require-git` flag is given)
537
- * `.git/info/exclude`
538
- * Git's global ignore file configured through `core.excludesFile`
539
- * `.ignore` globs, which take precedence over all gitignore globs when there's a conflict. This includes `.ignore` files in parent directories.
540
- * Ignore files from parent directories, when applicable (Unless the `--no-ignore-parent` flag is given)
541
- 2. Binary files for content search. (any file with a NUL byte to be binary)
542
- 3. Hidden files and directories. (A file or directory is considered hidden if its base name starts with a dot character `.`)
543
- 4. Symbolic links aren't followed
544
-
545
- All of these things can be toggled using various flags:
632
+ ### Depth
546
633
 
547
- 1. You can disable all git-related filtering with the `--no-ignore` flag.
548
- 2. Hidden files and directories can be searched with the `--hidden` flag.
549
- 3. Symbolic links can be searched with the `--follow` flag.
634
+ Controls how deep the search goes inside directories.
550
635
 
551
- For convenience, you can use the `--unrestricted` flag. This flag disables all the automatic filters mentioned above except the filter related to binary files for searching file contents.
636
+ A depth of `0` means that only base path's immediate contents are searched; subdirectories are not entered.
552
637
 
553
- The ignore rules are interpreted using the same matching and precedence semantics as ripgrep. When ignore files at different directory levels define conflicting rules, rules from a **deeper directory take precedence over rules inherited from its parent directories**.
638
+ ```text
639
+ project/ ← base directory
640
+ ├── file.txt ← depth 0
641
+ ├── folder1/ ← depth 0
642
+ │ ├── file.txt ← depth 1
643
+ │ └── folder2/ ← depth 1
644
+ │ └── file.txt ← depth 2
645
+ ```
554
646
 
555
- Within the same directory level, ignore sources are applied with the following precedence, from highest to lowest:
647
+ `--depth` can be specified multiple times to search non-contiguous depth ranges:
556
648
 
557
- ```text
558
- .ignore
559
- .gitignore
560
- .git/info/exclude
561
- global Git excludes (core.excludesFile)
649
+ ```bash
650
+ --depth 0 # Direct contents only
651
+ --depth 1 # One level inside
652
+ --depth 2:4 # Depths 2 through 4
653
+ --depth 2 --depth 5:7 # Depths 2 and 5 through 7
654
+ --depth :2 # Depths 0 through 2
655
+ --depth 3: # Depth 3 and deeper
562
656
  ```
563
657
 
658
+ If `--depth` is not specified, the search has no depth limit.
659
+
564
660
  ## Archive Search
565
661
 
566
662
  Enable archive support:
@@ -571,6 +667,8 @@ psk TODO --archive
571
667
 
572
668
  Supported formats: `zip`, `rar`, `7z`, `gz`, `bz2`, `xz`, `tar`, `tar.gz`, `tar.bz2`, `tar.xz`
573
669
 
670
+ > **Note:** [Automatic filters](#automatic-filtering) and [--glob](#globs) option don't work on archive files
671
+
574
672
  ### Nested Archives
575
673
 
576
674
  Pseek supports nested archives for multi-file archive containers (zip, rar, 7z, tar and compressed tar formats). Nested archive traversal means Pseek can search inside an archive that itself contains other archives (for example `a.zip` containing `b.7z` containing `c.tar.gz`).
@@ -589,6 +687,8 @@ Pseek can search:
589
687
  backup.zip::source.7z::notes.txt
590
688
  ```
591
689
 
690
+ ## Archive Filters
691
+
592
692
  ### Archive Depth
593
693
 
594
694
  The concept of depth in archive is different from `--depth`. Depth in archive is calculated based on nested archives. Each archive that is inside another archive counts as one level of depth.
@@ -610,8 +710,6 @@ Meaning `archive level 3` and `archive level 4` won't be searched.
610
710
 
611
711
  > **Note:** `--arc-depth 0` means perform the search only within this current archive and don't enter nested archives.
612
712
 
613
- ## Archive Filters
614
-
615
713
  ### Extension Filters
616
714
 
617
715
  ```bash
@@ -690,7 +788,23 @@ psk TODO --content --paths-only
690
788
 
691
789
  Useful for very large result sets.
692
790
 
693
- ## Timeout
791
+ ### Context
792
+
793
+ Show context lines around each match. The value is specified as `BEFORE:AFTER`:
794
+
795
+ ```bash
796
+ --context 2 # 2 lines before and after
797
+ --context 2:0 # 2 lines before, none after
798
+ --context 0:2 # none before, 2 lines after
799
+ --context 2:5 # 2 lines before, 5 lines after
800
+ --context 2: # 2 lines before, none after
801
+ --context :2 # none before, 2 lines after
802
+ --context 0 # matching lines only
803
+ ```
804
+
805
+ Nearby matches whose context ranges overlap or directly touch are combined into a single group.
806
+
807
+ ### Timeout
694
808
 
695
809
  Stop the search automatically after a specified number of seconds.
696
810
 
@@ -702,7 +816,7 @@ psk TODO --timeout 0.5
702
816
 
703
817
  If the search exceeds the limit, it will be terminated. Results found before the search is terminated are still displayed.
704
818
 
705
- ## Search Statistics
819
+ ### Statistics
706
820
 
707
821
  Display a summary of the search, including result counts, scanned paths, archive information, and search time.
708
822
 
@@ -730,7 +844,7 @@ Search
730
844
  Search time: 0.128s
731
845
  ```
732
846
 
733
- ### Result statistics
847
+ #### Result Statistics
734
848
 
735
849
  * **Files matched** — Number of files whose names matched the query.
736
850
  * **Directories matched** — Number of directories whose names matched the query.
@@ -738,7 +852,7 @@ Search time: 0.128s
738
852
  * **Lines matched** — Number of lines containing one or more matches.
739
853
  * **Matches** — Total number of matches found in the contents of the files.
740
854
 
741
- ### Search statistics
855
+ #### Search Statistics
742
856
 
743
857
  * **Files scanned** — Number of files examined during the search.
744
858
  * **Archives scanned** — Number of archives processed, including nested archives found inside other archives.
@@ -748,7 +862,7 @@ When `--archive` is enabled, file and directory statistics can also include path
748
862
 
749
863
  `Directories scanned` can be `0` when the search path contains no subdirectories. The root search directory itself isn't counted as a scanned directory.
750
864
 
751
- ### Search time
865
+ #### Search time
752
866
 
753
867
  Time spent performing the search.
754
868