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
mainanddev) 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_fromstringhas 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
itemlimitnow 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.FolderStructureis 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
slashis now totally deprecated; usefolderendinstead.
0.4.2
v0.4.0
Added
- pathlib Path objects now accepted by
sd.seedir(). All other arguments apply as normal; arguments accepting callables (maskandformatter) 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.pyand theFolderStructureclassfolderstructurehelpers.pyhas 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
SeedirErrorhas been removed. All uses have been replaced with more appropriate errors, mainlyValueErrororTypeError
v0.3.1
Added
- Additional functionality to the
formatterparameter: can now dynamically set other seedir arguments as well as styling ones - Added a
sticky_formatterparameter for causing the formatter changes to continue through sub-directories. - Additional test cases for
formatter - Add
folderend&fileendtokens for setting characters at end of line. Default styles have been updated to include these. - Additional documentation, specifically for
formatterbut 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
slashis on warning for removal after addition offolderend.
v0.3.0
Added
formatterparameter 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
FolderStructureclass inseedir.realdirmodule - 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
copymethod inFakedir.delete(), which prevented non-list arguments - the
walk_applymethod 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.pymodule, which is aided byfolderstructurehelpers.py(this contains many functions that were previously inseedir.seedirandseedir.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=0with abeyondstring now produces just the root folder (this was incorrect before) - with
beyond='content', empty folders are only shown when thedepthlimitis crossed - trailing separators or slashes no longer cause the name of the root folder to be empty
- using
Added more test cases
- More
unittestshave been added toseedir/tests/tests.py.
Overhaul documentation
- The examples Jupyter notebook has been removed, in favor of a
gettingstarted.mdfile which has been added to the main page of the API docs. - The getting started README as well as the
seedir.fakedirmodule are nowdoctest-able. - New style added to the API docs.
seedir.seedirmodule has been renamed toseedir.realdirto avoid some of my confusions- added an
exampledirto thedocsfolder for some examples
Other changes
nameparameter added toseedir.fakedir.randomdir- some changes to
seedir.fakedir.fakedir_fromstringto handle some more failed cases. - now convert some arguments to
boolorintin the command line tool words,FakeItemremoved from package namespace
v0.1.4
v0.1.3
Added more example usage to docstrings.
v0.1.2
- new
maskparameter 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