Releases: earnestt1234/seedir
Releases · earnestt1234/seedir
v0.5.1
Mainly some additions to improve the development cycle for seedir:
Added
- GitHub workflows for testing the code (on pushes and pulls to
main
anddev
) and for uploading to PyPI (on new release). - Created a pyproject.toml
- Add CONTRIBUTING.md for instructions on how to contribute to the project
Changed
seedir.fakedir.fakedir_fromstring
has been refactored. The logic is essentially the same, but there have been some simplifications and more comments have been added.
v0.5.0
Added
- The
itemlimit
now accepts a 2-tuple as an argument, indicating a separate limit for folders and files (respectively). - Added two parameters for handling errors when trying to list the children of a directory:
acceptable_listdir_errors
: One or more error types (Exceptions
) which are ignored when occurring during a directory listing call. E.g., a permissions error.denied_string
: String to add to follow directory entries for which the error was triggered.
- More test cases added
Changed
- The main algorithm for folder tree traversal has been refactored.
- The unit tests are now structured for pytest.
seedir.folderstructure.FolderStructure
is now an abstract class that cannot be directly instantiated. The functions that previously needed to be provided as arguments for the constructor must now be implemented as part of a subclass (see getting started for an example)
Deprecated
slash
is now totally deprecated; usefolderend
instead.
0.4.2
v0.4.0
Added
- pathlib Path objects now accepted by
sd.seedir()
. All other arguments apply as normal; arguments accepting callables (mask
andformatter
) will see pathlib objects.
Changed
-
[emoji is now an optional dependency](#12). It can be installed with
pip install seedir[emoji]
. An error is raised if the emoji style is requested without emoji installed. -
Reorganization of
folderstructure.py
and theFolderStructure
classfolderstructurehelpers.py
has been removed. Most of the functions implemented there have become methods ofFolderStucture
.- FolderStructure has been made more user-friendly, and can now be initialized with less functions.
- There are no longer separate "real dir"/"fake dir" functions for handing item filtering/sorting.
-
Item inclusion is now prioritized above exclusion for include/exclude folders/files. The order of precedence now is mask (1), inclusion (2), exclusion (3). The code in this function was generally rewritten to be more concise (
FolderStructure._filter_items()
). -
More examples in the getting started readme.
Fixed
- Typos in documentation
- Removal of IPYNB checkpoints
Removed
- The
SeedirError
has been removed. All uses have been replaced with more appropriate errors, mainlyValueError
orTypeError
v0.3.1
Added
- Additional functionality to the
formatter
parameter: can now dynamically set other seedir arguments as well as styling ones - Added a
sticky_formatter
parameter for causing the formatter changes to continue through sub-directories. - Additional test cases for
formatter
- Add
folderend
&fileend
tokens for setting characters at end of line. Default styles have been updated to include these. - Additional documentation, specifically for
formatter
but also some smaller tweaks
Changed
- The CLI was revamped, now using argparse instead of getopts. More seedir options were added.
- The
seedir.printing.format_indent()
method now modifies dictionaries in place, rather than creating a new one - the
FakeDir.realize()
method no longer creates a reference to unused file variable
Fixed
- Fix the words.txt file not being closed after opening 🤦
Deprecated
slash
is on warning for removal after addition offolderend
.
v0.3.0
Added
formatter
parameter for more customizable diagrams- FakeDir methods for creating files/folders now return references to the objects created
- A
copy()
method for FakeDirs - A
siblings()
method for FakeDirs
Changed
- Documentation updates
- Added code blocks to examples in docstrings
- replaced the "cheatsheet.png" image in the Getting Started section with a markdown link
- remove broken link to
FolderStructure
class inseedir.realdir
module - fixed some examples in docstrings and readmes
- in getting started, redo examples to omit empty folders (which are omitted by GitHub)
- replace
'\s'
with' '
inseedir.fakedir.fakedir_fromstring()
- Remove .DS_Store files (thanks @timweissenfels)
- Reverted API doc style back to pdoc3 default
Fixed
- remove call to
copy
method inFakedir.delete()
, which prevented non-list arguments - the
walk_apply
method is now applied to the calling folder, rather than just children
v0.2.0
Improvements to the main seedir()
algorithm
- There is now a single function which generates folder structure strings for both real directories and seedir "fake" ones. The main algorithm is contained in the new
folderstructure.py
module, which is aided byfolderstructurehelpers.py
(this contains many functions that were previously inseedir.seedir
andseedir.fakedir
). - The code is now simpler and (hopefully) more readable than the previous version.
- Some small changes to the functionality of fringe cases:
- using
depthlimit=0
with abeyond
string now produces just the root folder (this was incorrect before) - with
beyond='content'
, empty folders are only shown when thedepthlimit
is crossed - trailing separators or slashes no longer cause the name of the root folder to be empty
- using
Added more test cases
- More
unittests
have been added toseedir/tests/tests.py
.
Overhaul documentation
- The examples Jupyter notebook has been removed, in favor of a
gettingstarted.md
file which has been added to the main page of the API docs. - The getting started README as well as the
seedir.fakedir
module are nowdoctest
-able. - New style added to the API docs.
seedir.seedir
module has been renamed toseedir.realdir
to avoid some of my confusions- added an
exampledir
to thedocs
folder for some examples
Other changes
name
parameter added toseedir.fakedir.randomdir
- some changes to
seedir.fakedir.fakedir_fromstring
to handle some more failed cases. - now convert some arguments to
bool
orint
in the command line tool words
,FakeItem
removed from package namespace
v0.1.4
v0.1.3
Added more example usage to docstrings.
v0.1.2
- new
mask
parameter for functionally filtering items, used byseedir.seedir
,seedir.FakeDir.seedir
, andseedir.fakedir
:
# example
import os
import seedir as sd
# only print directories
sd.seedir(mask=lambda x : os.path.isdir(x))
- updated examples notebook
- updated tests for
mask
- updated documentation