Sphobjinv

Latest version: v2.3.1

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

Scan your dependencies

Page 3 of 3

2.0.0

Added

* Loading remote inventories from the CLI now will
perform an automatic walk along the directory structure of the
provided URL, searching for the objects.inv file of the
documentation set.
* The above URL walking functionality is exposed for API use
at sphobjinv.fileops.urlwalk.

Changed

* Instances of DataObjStr and DataObjBytes are NO LONGER IMMUTABLE.
Working with Inventory instances was going to be far too cumbersome
with immutable DataObjStr instances in .objects.

2.0.0rc1

Fixed

* API code no longer contains any `sys.exit` calls;
CLI interactions should now be properly segregated from the internal API.

Added

* API
* Data for individual objects encapsulated in the new `.data.DataObjStr` and
* `.data.DataObjBytes` classes
* Instances of these objects provide granular access to the contained data
* Instances are *immutable*, but expose an `evolve()` method for creating new,
(optionally) modified instances.
* Entire inventory contents, as a `list` of `DataObjStr`, encapsulated in
`.inventory.Inventory` instances
* `Inventory` instances are anticipated to be the primary point of user interface to
inventory data
* `.suggest()` method added, exploiting fuzzy string searching by
[`fuzzywuzzy`](https://pypi.org/project/fuzzywuzzy) for rapid searching of
inventories for objects of interest
* Import of remote `objects.inv` files via `urllib.request` and `certifi` implemented.
* Helper methods are provided for working with the `objects.inv` shorthands for object
URI and display-name information, on both `DataObj...` and `Inventory` instances.
* `readjson`/`writejson` helper functions added to `.fileops`
* JSON schema added to `.schema` for use with
[`jsonschema`](https://pypi.org/project/jsonschema) to validate incoming data
during `Inventory` instantiation from JSON
* Command-line interface
* Add `suggest` subparser, for recommendation of matching objects
within an input inventory
* Add ability to read and write JSON inventories
* Add ability to use a remote `objects.inv` file (arbitrary filename) as input,
specified by URL
* Add arguments to:
* Expand/contract the `objects.inv` URI and 'display name' abbreviations
* Force overwrite of an existing output file without prompting
* Silence all output (mainly intended for scripting applications);
includes automatic overwriting of an existing output file
* Various arguments to control the output of a `sphobjinv suggest` invocation

Changed

* `readfile`/`writefile` changed to `readbytes`/`writebytes`
and moved to new `.fileops` submodule
* `decode`/`encode` changed to `decompress`/`compress` and moved to new `.zlib` submodule
* `p_data`/`p_comments` regex patterns renamed with `pb_` prefix to indicate they are
`bytes`, not `str` patterns
* CLI
* Commands for (de)compressing `objects.inv` files changed to a more general `convert`
subparser, due to addition of JSON output option
* Default filename/extension assumptions removed from input file argument,
as multiple input formats make the logic here complicated enough
it's not worth messing with

1.0.0

Features

* Flexible commandline encode and decode of objects.inv
files, in terms of file names and input/output locations
* Programmatic conversion via API is available, but
potentially buggy due to poor segregation of cmdline
behaviors. This is to be fixed.

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.