Ubelt

Latest version: v1.3.6

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 11

1.1.0

Added
* New method: `ub.timeparse` can parse the result of `ub.timestamp` into a
`datetime` object. Can optionally use `dateutil.parser.parse` under the hood.
* `ub.Path.ls` a convenience function that aliases `list(path.iterdir())`.
* `ub.Path.walk` to wrap `os.walk`.

Changed
* Register `pathlib.Path` with `ub.repr2`
* Can now register global `ub.repr2` extensions via `ub.repr2.register`
* Can now register global `ub.hash_data` extensions via `ub.hash_data.register`
* Removed deprecated arguments from `ubelt.cmd`.
* `ub.CacheStamp` will now check the mtime and size to quickly check if the products
have changed and force expiration.
* `ub.CacheStamp` now takes an `expires` keyword arg, which will keep the cache valid
only for the specified amount of time.
* `ub.CacheStamp` now takes an `hash_prefix` keyword arg, which will check that it
matches the hash of the product.
* `ub.cmd` now has a `system` argument for modularity with `os.system`.
* `ub.cmd` now accepts a `timeout` argument (tee support is pending).
* `ub.JobPool` now contains a protected `_prog` variable allowing the user
finer-grained progress controls.
* `ub.JobPool` now contains a convenience method `join` that executes all jobs
and returns a list of results.
* `ub.timestamp` can now accept a `datetime` object as an argument, and will return
the timestamp for that object.
* The `ubelt.util_download.grabdata` function now uses `CacheStamp` instead of
implementing its own stamp solution.
* The `ubelt.util_hash.HashableExtensions` implementation was updated to use
`functools.singledispatch` instead of the custom solution. This seems faster
and should not have any API impact.

Deprecated
* `product` and `cfgstr` arguments to `CacheStamp.expired`
* `product` and `cfgstr` arguments to `CacheStamp.renew`
* Passing `hasher` as an instance to functions like `grabdata` or `CacheStamp`
can cause unexpected hashes as they may be used more than once.

Fixed
* `ub.hash_data` now recognizes subclasses of registered types.
* `ub.timestamp()` has been outputting incorrect (negated) UTC offsets. This is now fixed.
* `ub.timestamp()` now works correctly when the year has less than 4 digits.

1.0.1

Fixed

* Bug where six was used but not listed as a dependency. Six is now removed as a dependency.
* Fixed out of date docs in some places.

1.0.0

Added

* :func:`ubelt.Path.appdir` which functions like the `get_app_*_dir` methods in `util_platform`.
* Add `tail` argument to :func:`ubelt.Path.augment` and :func:`ubelt.util_path.augpath`
* Add json `backend` option to Cacher.

Changed
* `IndexableWalker` behavior has been changed, each time `iter` is called it
resets its global state.
* Remove support for Python 2.7 and Python 3.5
* Removed deprecated functions scheduled for removal.
* :func:`ubelt.util_dict.dict_diff` now preserves original dictionary order in Python 3.7+.
* `ub.hash_data` can now hash slice objects.
* INTENTION OF BREAKING CHANGE NOTIFICATION: `ubelt.util_format.repr2` may no longer sort
dictionaries by default. Looking into a backwards compatible way to work around this.

0.11.1

Added
* More `ubelt.Path` extensions for `delete`
* Add `timeout` parameter to `ubelt.download`

Changed
* Modified default `ubelt.Path` behavior for `touch` to return a self-reference for chaining

0.11.0

Added
* Added `ubelt.Path`, as an extension and quicker-to-type version of pathlib.Path with extra functionality.
* Added `progkw` as argument to `JobPool.as_completed` to control progress reporting
* Added `progkw` as argument to `ub.download` / `ub.grabdat` to control progress reporting
* Added `util_zip` with the `zopen` function. Access a file inside a zipfile with a standard `open` like interface.


Fixed
* `ubelt.hash_data` now handles non-numeric float values.
* `ubelt.chunks` now works correctly when nchunks is specified.

Changed

* Changed default of `_hashable_sequence` `types` arg from True to False to be
consistent, but kept existing types=True behavior in hashable extensions. Changes
should be backwards compatible, but in the future we may introduce a breaking
change to make hash behavior more consistent.

0.10.2

Added
* Added pyi type annotation files. (Used a custom script to export docstring type annotations)
* Added `default` keyword argument to signature of `ub.peek`

Fixed
* Added `map` function to the executor classes.
* `ub.Executor` now correctly returns itself from `__enter__`
* Docstrings now have better type annotations
* ProgIter had a bug in `time_thresh`, where it was never used (modified adjustment rules).
* Fixed performance regression in ProgIter

Changed
* New CI GPG Keys: Erotemic-CI: 70858F4D01314BF21427676F3D568E6559A34380 for
reference the old signing key was 98007794ED130347559354B1109AC852D297D757.
* Verbose test from symlink previously showed "real -> link" which makes no
sense because a link should be the object that "is pointing". Thus it now
shows "link -> real"
* `ub.download` should now generate less stdout text
* New in-repo "dev" benchmarks

Page 3 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.