From 9448002f4260d088ee281874ffa80aa2b231a69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:21:32 +0300 Subject: [PATCH 1/8] Remove trailing newlines in code blocks in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4e6671..0a067c9 100644 --- a/README.md +++ b/README.md @@ -137,14 +137,14 @@ You can set an arbitrary condition under which file traversal will stop using [c 1. If you use the crawler as a one-time object for a single iteration, set the token when creating it: - ```python +```python for path in Crawler('.', token=TimeoutToken(0.0001)): # Limit the iteration time to 0.0001 seconds. print(path) ``` 2. If you plan to use the crawler object several times, use the `go()` method for iteration and pass a new token to it every time: - ```python +```python crawler = Crawler('.') for path in crawler.go(token=TimeoutToken(0.0001)): # Limit the iteration time to 0.0001 seconds. From 893a87595cad2a07c40fbe15e584ab5203d4281a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:23:34 +0300 Subject: [PATCH 2/8] Update example to use print instead of my_linter --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a067c9..35e0ca1 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,8 @@ If you just want to run a function for each file the crawler finds, you don't ha ```python from dirstree import PythonCrawler -PythonCrawler('src', exclude=['tests/**']).apply(my_linter) +# This will print the entire contents of the directory, except for the excluded locations. +PythonCrawler('src', exclude=['tests/**']).apply(print) ``` All of the crawler's settings — extensions, excludes, custom filters, and cancellation tokens — are respected, exactly as they would be during normal iteration. You can also pass a fresh cancellation token to `apply()` itself, the same way you would to `go()`. From 1db5907b20f0eb97dd607df2aa098b45ecb7cb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:24:03 +0300 Subject: [PATCH 3/8] Update section title casing to lowercase in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 35e0ca1..7941a55 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ There are many libraries for traversing directories. You can also do this using - [**Installation**](#installation) - [**Basic usage**](#basic-usage) -- [**Applying a Function to Each Path**](#applying-a-function-to-each-path) +- [**Applying a function to each path**](#applying-a-function-to-each-path) - [**Filtering**](#filtering) - [**Working with Cancellation Tokens**](#working-with-cancellation-tokens) - [**Combination**](#combination) @@ -74,7 +74,7 @@ crawler = Crawler('.', only_files=False) ``` -## Applying a Function to Each Path +## Applying a function to each path If you just want to run a function for each file the crawler finds, you don't have to write the loop yourself — every crawler has an `apply()` method: From 87ef92b9397067882d82af344b25ddbfbd1d61d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:24:31 +0300 Subject: [PATCH 4/8] Update README to use generic Crawler instead of PythonCrawler --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7941a55..a372985 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,10 @@ crawler = Crawler('.', only_files=False) If you just want to run a function for each file the crawler finds, you don't have to write the loop yourself — every crawler has an `apply()` method: ```python -from dirstree import PythonCrawler +from dirstree import Crawler # This will print the entire contents of the directory, except for the excluded locations. -PythonCrawler('src', exclude=['tests/**']).apply(print) +Crawler('src', exclude=['tests/**']).apply(print) ``` All of the crawler's settings — extensions, excludes, custom filters, and cancellation tokens — are respected, exactly as they would be during normal iteration. You can also pass a fresh cancellation token to `apply()` itself, the same way you would to `go()`. From c1ce17fd65713cf065a5315a22e804e1a9d3ed26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:24:43 +0300 Subject: [PATCH 5/8] Remove unnecessary import in README example --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index a372985..aa75e36 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,6 @@ crawler = Crawler('.', only_files=False) If you just want to run a function for each file the crawler finds, you don't have to write the loop yourself — every crawler has an `apply()` method: ```python -from dirstree import Crawler - # This will print the entire contents of the directory, except for the excluded locations. Crawler('src', exclude=['tests/**']).apply(print) ``` From 941774c46cce9f372c55fda0a47cee3ccde7d474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:25:24 +0300 Subject: [PATCH 6/8] Bump version to 0.0.9 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 18743e2..de3b3dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "dirstree" -version = "0.0.8" +version = "0.0.9" authors = [{ name = "Evgeniy Blinov", email = "zheni-b@yandex.ru" }] description = 'Another library for iterating through the contents of a directory' readme = "README.md" From ccc08035ca5b28e08ae0ab83dd68274a8f636c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:29:14 +0300 Subject: [PATCH 7/8] Update README with clearer examples and concise setting description --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa75e36..3d1255a 100644 --- a/README.md +++ b/README.md @@ -79,11 +79,12 @@ crawler = Crawler('.', only_files=False) If you just want to run a function for each file the crawler finds, you don't have to write the loop yourself — every crawler has an `apply()` method: ```python -# This will print the entire contents of the directory, except for the excluded locations. Crawler('src', exclude=['tests/**']).apply(print) ``` -All of the crawler's settings — extensions, excludes, custom filters, and cancellation tokens — are respected, exactly as they would be during normal iteration. You can also pass a fresh cancellation token to `apply()` itself, the same way you would to `go()`. +> ↑ This will print the entire contents of the directory, except for the excluded locations. + +> ⓘ All of the crawler's settings are respected, exactly as they would be during normal iteration. ## Filtering From 192f9575a2869b746213770e5a817e20f5ebd8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BB?= =?UTF-8?q?=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 29 May 2026 13:33:34 +0300 Subject: [PATCH 8/8] Add feature highlights to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d1255a..86eb01e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ There are many libraries for traversing directories. You can also do this using the standard library. What makes this library different: +- 💎 Beautiful, laconic syntax. - ⚗️ Filtering by file extensions, text patterns in [`.gitignore` format](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring), and using custom callables. - 🐍 Natively works with both [`Path` objects](https://docs.python.org/3/library/pathlib.html#basic-use) from the standard library and strings. - ❌ Support for [cancellation tokens](https://github.com/pomponchik/cantok).