Tooltils

Latest version: v1.8.0

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

Scan your dependencies

Page 1 of 4

1.8.0

THE biggest update yet

<br><br>

**Major Changes:**
- Python imports are now lazy loaded, this should give a much faster import time for Tooltils and decrease the python cache file size
- Brought the requests.urllib module up to the state of the normal requests module and added some new features to the requests.urllib module
- Fixed some requests bugs and improved logging and redirects for requesting
- Maintenence and optimisation
- Logging is now completely built off of my own custom system, allowing for more reliable use, text formatting and a whole world of other possibilities
- Added a command line interface to be able to do all things related to the cache and config, and to view installation information. It is launched by calling the module directly through the Python interpreter (`python -m tooltils`)

<br><br>

**General**:
- All standard Python module imports are now lazy loaded to boost import performance time, though there is a new config option `universal.lazyLoading`, which can be set to False to disable this behaviour
- Cleaned up unneeded imports from all modules
- Added missing exception class `RequestError` to the API
- Changed one of the features list items in the README
- Logging now has better formatting and text style variation
- Added a new config value, `global.loggingFormat`, information on how to customise it can be found in the config section in the API
- Moved config value `info.disableOnlineContentFetch` to the `global` section of the config
- General fixes and maintenence on all methods changed in this update
- All methods now have parameter description docstrings that appear on Pylinters
- Added more detailed examples for some methods in the API
- Removed examples for most methods for the info module in the API as there was no relative information to go off of to show the effect of the functions
- Added the `typing.Callable` type hint to any parameters that take a method
- Added a new best features section to the README

<br>

**CLI (new)**:
- Added a command line interface to be able to do all things related to the cache and config, and to view installation information. It is launched by calling the module directly through the Python interpreter (`python -m tooltils`)
- Added a CLI section to the CHANGELOG and API

<br>

**Backend**:
- Removed `.gitignore` file as MacOS creates the `.DS_Store` file each time and due to the way gitignore works, it won't be removed unless I explicitly remove it
- Changed how the variables are set for the requests module `openConnection()` to be more optimised
- Removed the non-API listed parameter `_redirectData` in the requests module `openConnection().send()` class method, and instead it is now included in the `**params**` argument that is meant for providing single use request data
- The `filter` parameter is now passed as **"data"** in the tests/build.py file to avoid the deprecation warning giving by Pylance
- Made testing easier
- Changed all appearances of non-tooltils attributes within modules to include an underscore prefix at the start to help differentiate them from tooltils variables in Python linters
- Removed unnecessary variable `sMonths` in the backend variables section of the main module for the methods `date()` and `epoch()`
- Added the `functools.lru_cache` decorater to some methods in the main module for a very slight performance boost
- Tooltils now uses it's own logging system independent of the Python module `logging` as the recommended use for logging was the info module `logger()` class anyway
- Reorganised config and cache table values
- Added the ability to pass the errors module to the info module `logger()` class, and also added more options for passing module names
- Optimisations to all changed content
- Added a `.__repr__()` return method to all class instances, which uses the same code as `.__str__()`
- Fixed a bug where the config would be read based off of the default config instead of the file content
- Types are now compared with the `isinstance(a, (b))` method instead of `type(a) is b` as in pre 3.11 Python, it is around 40% faster
- Renamed the `global` section of the cache and config to `universal`
- All strings with multiple characters are now typed with double quotes, and single character strings use single quotes. This is to be consistent with C++ as I am currently learning

<br>

**Main Module**:
- Added the method `dirVars()`, to get all of the attributes of a Python object and either print them or store them in a formatted matter
- Removed unnecessary `enumerate()` call in the the `interpreter()` class code
- Removed bogus `FileDescriptorOrPath` type hint for all methods
- Renamed `length()` function to `waveLength()`
- Improved exceptions for the `waveLength()` function
- The `waveLength()` function now includes a return type hint for `int`
- Optimised `waveLength()` function slightly
- Made some slight optimisations to the `timeTest()` function
- Added the `clear` parameter to the `style()` method to indicate whether an empty escape sequence should be appended to the string to clear any formatting afterwards
- The default value for the `timezone` parameter in the `date()` method is now None to indicate the current timezone to be used
- Removed the `varName()` method
- Removed logging calls for the `tgzOpen()` method
- Added a new class, `subtractableList`, for creating lists that can be subtracted from using an iterable that isn't a string or dictionary
- Added a new class, `duplicateKeysDict`, to create a custom dictionary that can have duplicate keys inside, also implementing some cool features not present in the normal Python dict
- The `timeTest()` method now uses a different order of function parameters, and now also takes *args and **kwargs to apply to the method being tested
- Removed file suffix check in the `tgzOpen()` method
- The `mstrip()` method has been renamed to `cstrip()` and now accepts a string as the `values` argument, when a string is passed, it clears the input text of each individual charcater in the string. It now also accepts the `strict` argument for if the input characters should match their case. E.g. `cstrip("Hello World!", "eLoR", strict=True)` -> `"Hll Wrld!"`

<br>

**errors**:
- Changed `InvalidWifiConnection` class docstring
- Exception docstrings now show on Python syntax highlighters when called
- Removed `TooltilsOSInfoError` exception
- Changed `RequestError` class docstring

<br>

**info**:
- Changed module docstring
- Fixed a bug in the `logger()` class
- Improved logging
- Changed `logger` class docstring
- Removed `closed` and `.close()` attributes from the `logger()` class
- The level attributes of the `logger()` class will now always be set to the numerical value of the logging level
- Added the ability to use the context manager protocol with the `logger()` class
- The `deleteData()` method may not log to the stream if the currently in use data files had been deleted

<br>

**os**:
- Renamed the `print` parameter for the `system()` and `call()` methods to `output`
- Changed some logging calls for the `system()` method
- When the operating system is BSD, the `info.platform` variable will become the type of BSD, and the `info.detailed_platform` will become **"BSD"**. The same goes for Linux operating systems
- The `system.__str__()` and `.__repr__()` now return the command's exit code instead of the memory address of the command class instance (self)

<br>

**requests**:
- Added a new parameter to the `openConnection()`, `openConnection().change()`, `openConnection().send()` and `request()` class methods, `onStatusError`, which by default is set to the tooltils.errors module `StatusCodeError` class, but can be set to any exception, or None if you don't want an error to be raised when the request status is >= 400
- Fixed a minor issue where if you used the `request()` class with the **"DOWNLOAD"** method, it would instead become a GET request
- Added state checkers to the `openConnection().send()` class method to make sure the connection state is correctly managed; If you try to make a request while the connection is closed, it will now raise an error
- An exception is no longer raised when the page doesn't have a forward slash at the start in the `openConnection().send()` and `request()` class methods
- Optimisations
- Removed all uses of the `HTTP_Port` type hint for the `port` parameters in requesting methods
- Improved requesting error messages and made them look nicer in the exception traceback
- The request will now always be closed with the `request()` class when used with a context manager
- Only `OSError` is caught for gzip file related errors instead of a different exception for Python versions above 3.7
- The `verifiable()` method now catches a general `Exception` statement instead of specific requesting errors
- Fixed a bug where if a request redirected on a `.send()` call with one time use request data, it wouldn't use the specified request data from the `.send()` call
- A redirect to the same host of a request will use the already existing connection reference instead of opening a new connection
- The `override` parameter now works properly for `openConnection` and `request`
- Fixed some redirect bugs
- Changed how logging works for a redirected request, it now no longer floods the output and instead, condenses the important information into one debug call per redirect
- Modified logging calls for requests
- The connection state is now correctly managed when an error is raised on a request
- Fixed a bug where cookies would be added to the request headers incorrectly
- Request added headers are now overridable
- Fixed port formatting error when a setup message is logged with a request
- Each stage of a request is now sent instead of the one function `http.client.HTTPSConnection.request()`, improving the accuracy of logging for the `openConnection()` and `request()` classes. This change does not apply to the urllib module
- Fixed the `advancedContext.redirectLimit` parameter not working for requests
- Added a new config value `connectionCaching`, to control whether connections should be cached and used again later
- The request ID for logging now starts at 1 instead of 0
- An obscure `OSError` windows related error is now caught when your computer's internet connection becomes invalid while trying to connect to a host
- The request ID logging format is now printed as **"C{ID}"** instead of **"R{ID}"** as it makes more sense for `openConnection` when sending multiple requests
- Added a `.__eq__()`, `.__str__()` and `.__repr__()` method to the `advancedContext` class

<br>

**requests.urllib**:
- The interface for this module is now the same as the default requests module (without `openConnection`)
- The method of creating a request has changed, allowing for http use and individual request openers, rather than been applied for all requests (even outside of tooltils)
- Removed the `NoRedirects` class
- Fixed a bug where a request wouldn't be redirected if `redirects` was passed as True in `request()`
- Fixed type hints for the `request()` class return properties
- Improved code readability

<br><br>

1.7.2

Infinite Bugs

<br><br>

**Major Changes:**
- Code predictions and docstrings now work for the os module `info` class

<br><br>

**General**:
- Fixed typo in the API

<br>

**Backend**:
- Added a `.gitignore` file to the repository files to remove the `.DS_Store` file created by MacOS

<br>

**Main Module**:
- Removed the `flush` parameter from the `style()` method because that function does not print text itself, rather it is stored in a string, so you may need to flush the text yourself
- Removed logging from the `interpreter()` class method

<br>

**errors**:
- None

<br>

**info**:
- Changed how the cache control works slightly for the `license` and `long_description` variables
- Fixed the `deleteData()` method

<br>

**os**:
- Changed `info` class `detailed_platform` variable docstring
- The `info` class now has code predictions and docstrings for each variables for Python code highlighters

<br>

**requests**:
- None

<br>

**requests.urllib**:
- None

<br><br>

1.7.1

Murphy's Law

<br><br>

**Major Changes:**
- Added backend optimisation for import performance, it was around 2 seconds to import tooltils each time after this update, but it now only takes on average around under 0.1 seconds. Though the first time you import, there will still be the time it takes to obtain the license and readme from the github, so there will only be around 1.5 seconds of import time for the first time ever importing tooltils

<br><br>

**General**:
- The config value `global.disableConfigMethodValues` is now True by default
- Added fields in the cache and config for the os module and removed the unused sys fields
- The config and cache for tooltils are now stored in the format **"~/.tooltils/{pyv}/{tsv}/"**, pyv being the current Python interpreter version and tsv being the current tooltils version
- The reliability of obtaining the user's home directory is better for managing the cache and config files

<br>

**Backend**:
- Made testing capabilities easier
- Added a type hint to the `bitsize` variable of the os.info module
- Improved code readability where changed

<br>

**Main Module**:
- The `date()` method `format` parameter now accepts an integer for the format which replaces as 0=**"standard"**, 1=**"fancy"**, 2=**"programmer"**
- Modified the `date()` method docstring and added examples for each of the formats inside the docstring
- Improved error messages for the `epoch()` method
- The `epoch()` method now accepts the programmer format from the `date()` method added in version 1.7.0

<br>

**errors**:
- None

<br>

**info**:
- Fixed a PermissionError bug that prevented the tooltils data files from being deleted because they were in use by the program
- Fixed a bug where the `license` and `long_description` variables would have the content of tooltils version 1.6.0 instead of 1.7.0
- Removed broken definitions of functions `enable`, `disable` and `close` of the `logger()` class instance as I accidentally left them in after moving the direct logging calls to the module instead of the `_external.py` file
- Changed the properties in the `logger()` class instance to instead be direct variables as they didn't need to be properties
- Corrected the incorrect logging definitions that were being used in the `enable`, `disable` and `close` functions of the `logger()` class instance
- Removed the `classifiers` variable
- The `Exception` class is now caught when parsing config method values instead of a being a naked try except block
- With the change to how the cache and config are stored, the `deleteData()` method now accepts two different values, the first being `pyv`, to indicate what Python versions to delete the data files for. The second being `tsv`, to indicate what Tooltils versions to delete the data files for. A guide on how to use these parameters can be found in the API
- The `deleteData()` method will now raise an exception if the current tooltils version or Python version data files do not exist, instead of running the code and catching whatever error the functions spit out
- Modified `deleteData()` method docstring

<br>

**os**:
- None

<br>

**os.info** (removed):
- This module has been removed and instead added as a class to the os module under the name `info`
- Heavily optimised how startup works, now the variables are set once they are obtained by the user instead of at startup, except for the known ones `python_version`, `name`, `bitsize`, `interpreter`, `platform` and `detailed_platform`
- Modified `name`, `manufacturer` and `boot_drive` variables' docstrings
- Changed module docstring
- The second object (`platform_version[1]`) of the `platform_version` variable on Windows now returns the type of Windows installation, e.g. **"Home"** or **"Pro"**

<br>

**requests**:
- None

<br>

**requests.urllib**:
- None

<br><br>

1.7.0

Going cold <br>

This will probably be the last tooltils update for a while unless there is some bug I didn't catch. I am working on a project which is similar to Spotify, but free and without ads

<br><br>

**Major Changes:**
- Requests now supports re-usable connections! Utilise it through the `openConnection()` class
- Requests has some small bugfixes and new features like proxies and advanced url checking
- Gave the README and CHANGELOG a small facelift
- The `license` and `long_description` variables in the info module are now fetched from the github repository on first startup, cached then never requested for again
- The sys module has been renamed to OS because that makes more sense
- Fixed and added new advanced implementations for the OS module methods
- Changed backend storage configuration of tooltils data in the `.tooltils` folder within the user's home directory
- The API now has examples for every method and looks a bit nicer
- Fixed major incompatibility issues with Python 3.7
- Logging in the info module `logger()` class now includes the full function stack trace when logging a message
- Minor optimisations

<br><br>

**General**:
- Main files like `LICENSE`, `README.md` and `API.md` will now use grammatical abbreviations like API and README instead of the file name for clarity in the changelog
- Reworded grammar on previous release notes in the changelog
- Added examples for every function and class in the API (a full thorough example going over every parameter and method will come in a future update)
- Added **"Supported"** tab for os dependent functions that may not work on some systems in the API
- Removed the ability to escape the **"$f"** keyword for custom config values as it would just be hard to implement
- Removed the important note in the README about the management of the data file as the object gets destroyed regardless when the code execution ends
- Modified tooltils version tooltip in the README to be coloured teal and have slightly different text
- Changelog items are now sorted into modules and other categories and instead of additions, removals and changes
- The config data is now stored in a seperate file to differentiate material
- Moved version resources into seperate folders within the `.tooltils` location to house other items
- Tweaked README content wording
- The headers variable call in the README code example is now not limited to just the user agent
- Improved API readability
- If a function can return None, it will be included within the code return types for linting and the API
- Removed planned features section from the README because the items that were going to be there were common sense
- Replaced copyright year in LICENSE to range from 2023-2024
- Added best features section to the README to replace the planned features section
- Moved global config value `configMethodCheck` to be directly in the global category so the function value converter will detect those values if necessary
- Replaced `runConfigMethodAlways` with `disableConfigMethodValues` as it wasn't used in the code
- Reorganised requests module `request()` class parameter list to match that of the actual method in the code
- Added necessary tabs like **"Raisable exceptions"** to every method that didn't have it in the API
- Updated old API information for all methods/modules necessary
- Reorganised API modules
- Exception `RuntimeError` will be raised if any config value is the incorrect type
- Added raisable exception `gzip.BadGzipFile` for Python 3.8+ and `OSError` for Python 3.7 in the `tgzOpen()` method within the main module in the API
- Replaced all non Python type hints for file name input parameters with str in all modules
- The default config value for `requests.verifiableCaching` is now True
- Made type hints more concise
- Slightly changed README code example

<br>

**Backend**:
- Refactored the design of the code that needs to be run on the import of tooltils
- Updated core methods in the info module to use the new location for the data file for tooltils introduced in 1.6.0
- Removed `tests/info.py` file
- Added Python versions 3.8 to 3.11 into the `classifiers` table in `pyproject.toml`
- Slightly reformatted code for all changed items in this update to be more readable
- Removed unused type hint classes in all modules
- Compatibility with Python 3.7 was broken because of an oversight I made for a long time, type hints with sub-types had not yet been integrated into the builtin Python types leading to runtime errors in all modules that use this kind of type hint. The fix for this was to use the python standard module `typing` and the subscriptable types within that library
- I accidentally included quotes and backslashes in f-string expressions which is only a Python 3.12 feature. Converted appearance of these expressions to use the str.format() function instead
- The exception class `gzip.BadGzipFile` did not exist until Python 3.8, meaning the logic for importing the correct error and decompressing a gzipped request response body had to be changed a little bit
- Fixed minor Python interpreter feature that converts an object surrounded by parentheses to the object itself
- Removed `classifiers` argument specification in `setup.py`
- The type of supposed integer config values is now checked on startup to be correct, if not raise `RuntimeError`
- Changed how the `tests/build.py` file works slightly
- Added underscores to the start of variables that aren't designed to be accessed directly by the user in the os.info module

<br>

**Main Module**:
- Updated old code example in the file docstring
- Updated the `ANSI_colours` variable docstring
- `style()` method now converts the colour argument to lowercase for cross compatibility
- Fixed invalid text bug with the `cipher()` method
- Changed the `reverseDictSearch()` method return type
- Reworded `interpreter()` class docstring
- New arguments for `interpreter()` class to individually control each language feature
- `timeTest()` function now only accepts one method as input
- Removed logging for `timeTest()` function
- Added a checker to skip the line if it is a blank line in the `interpreter()` method
- Return properties `file` and `output` now use the absolute paths of the files instead of the relative path
- Removed the `full_output` return property in the `interpreter()` method
- Slightly changed how the `cipher()` method works
- Added a new formatter option to the `date()` method, you may now pass **"programmer"** to get an output that looks something like this **"Feb 27 2024, 23:08:49"**

<br>

**errors**:
- Reworded `StatusCodeError.status_codes` variable docstring
- Renamed all `SystemCallError` child exceptions and the exception itself to be derivatives of **"SubprocessError"** to better describe the action taking place
- Reworded all `SubprocessError` exceptions' docstrings
- The default `code` parameter for `SubprocessCodeError` exception is now 0 and has different logic to determine what the error message should be
- Changed default `timeout` parameter for `SubprocessTimeoutError` and added logic to print a different message if the timeout is set
- `SubprocessLookupNotFound` and `SubprocessPermissionError` exceptions now accept the `name` parameter for specifying the shell command or program that could not be found
- Added `message` parameter as a return property to all necessary exceptions that don't already have it listed
- Reorganised exceptions to be sorted in module order
- Added `TooltilsOSInfoError` exception for the os.info module
- Added new return messages for `RequestRedirectError` and `RequestCodecError` exception classes
- The default `limit` parameter for `RequestRedirectError` is now 0, the default `timeout` parameter for `ConnectionTimeoutExpired`
- Added `url` parameter to `ConnectionError`
- Changed how `StatusCodeError` chooses the exception message to be returned, also removing the specified message item in the API for the class
- Reworded `ConnectionTimeoutExpired` exception class docstring
- Added a new exception `InvalidRequestURL` for url specific related errors, takes place over `ValueError` in most cases for requests
- New exception `ActiveRequestError` for general errors within a request for an opened connection in requests

<br>

**info**:
- The variables `license` and `long_description` content are now fetched from the github repository during import. The obtained values will be cached and used infinitely because the content of those files will not be changed, though you may edit the `disableOnlineContentFetch` config value to disable this feature.
- Improved line counter accuracy for `lines` variable
- Removed all logging statements for code that runs on import as there is no way to create a logging object and display those messages before the package has initialised
- Added Python versions 3.8 to 3.11 into the `classifiers` variable
- Modified `deleteData()` method docstring
- Changed how `deleteData()` and `clearData()` methods work slightly
- Added a new variable `release_description`, contains the text of the current version's description text as specified in the github version commit name or changelog version description
- Deleted the variable `i` from the for loop block within the startup code before it has finished
- Logging now includes the full function name when logging a message (e.g. tooltils.requests.request().send()/DEBUG etc.)

<br>

**os** `(previously sys)`:
- Renamed the `sys` module to `os` as it better describes the application of the methods contained inside this module
- Added `strict` parameter for `pID()` method to determine how harsh the name comparison should be when determing found processes
- The Windows implementation of the `pID()` method now uses the win32 api with `ctypes` directly and is a lot more reliable than the previous basic implementation
- The MacOS and Linux implementatin of the `pID()` method now uses the `pgrep` command with arguments so that version is also a lot more reliable than the previous implementation
- The `pID()` method now returns a tuple of found ids
- Reworded docstrings on shell/program interaction methods
- Changed logging call in `exit()` method to the status INFO instead of WARN
- `clear()` method now uses the shell for the Windows version as it wouldn't be able to locate the cls program normally for some reason
- Reworded the module docstring
- All subprocess execution methods now also take a `tuple` as a valid argument type for the `cmds` parameter
- `exit()` method default parameter `details` now has the value '' instead of None
- `system()` method adds more detailed information to exceptions on errors with the child process execution
- Added more detail to the raised exception when an unknown error is caught in the `system()` method
- Modified `system()` logging call
- The logging call in `system()` now happens before a caught exception is raised
- The `ValueError` exception is now raised if an empty string is passed to `cmds` in the `system()` method because otherwise the code will fail
- The `timeout` parameter for `system()`, `check()` and `call()` now accept a float and no longer have a limit
- Removed the `print` parameter from `check()` as to capture the output, the command or program must be able to output something
- Updated the Windows implementation of the `getCurrentWifiName()` method to use the netsh command, providing a much more reliable way of obtaining the wifi network name
- The Linux implementation of the `getCurrentWifiName()` method will now return None if the iwgetid command did not return anything, meaning the current connection is either ethernet or there isn't one
- Improved the reliability of the MacOS implementation of the `getCurrentWifiName()` method

<br>

**os.info**:
- The `platform` variable is now set to `sys.platform` if an unknown system was detected

<br>

**requests**:
- Reworded `status_codes` variable docstring
- Moved code for `connected()`, `ctx()` and `prep_url()` methods to the new `_helpers.py` file since both versions of the requests module utilise these functions
- Fixed `connected()` method
- Requests now supports re-usable connections! Utilise it through the `.requests.openConnection()` class
- Moved `verifiable()` source code into the main requests __init__ file
- `where()` method now guesses the certificates from the normal and openssl variables from the `ssl.get_default_verify_paths()` instance
- `where()` method returns a tuple with the format (path, file)
- Changed default type hint for `port` argument for requesting methods
- Added `proxy` argument to all requesting methods
- `ctx()` method now detects the openssl cert file and uses that instead of the normal cert file from the `ssl.get_default_verify_paths()` function
- The default certificate is now assumed from the `ssl.create_default_context()` function instead of from `ssl.get_default_verify_paths()` in the `ctx()` method when creating the SSLContext instance
- Changed `advancedContext()` function to a class
- Modified `advancedContext()` method docstring
- Error checking for control characters in the url after a request exception wasn't looking up the error and that could've caused some issues, the correct condition has been added
- Added return property `redirected` to the `request()` method to indicate whether the request has been redirected by the url, this wil be False if `redirects` is also False
- All requests `reason` parameter will now utilise the status reason provided by the URL response as well as the status code
- Request methods now accept a float for the `timeout` parameter
- Catch `TimeoutError` in request methods and raise `tooltils.errors.ConnectionTimeoutExpired`
- If a unknown error is received by the http.client response object in a request, raise `tooltils.errors.ConnectionError`
- Updated to the most recent firefox user agent headers if `mask` is True in requests
- Reworded `request()` class docstring
- Added `redirect_loops=False` parameter to requesting methods for whether redirect looping should be allowed for this request
- The `prep_url()` method will now try to determine if the url can be used or if it has a scheme and host etc. An invalid url will now raise the `tooltils.errors.InvalidRequestURL` exception
- All url related errors in requests will also now raise the `tooltils.errors.InvalidRequestURL` exception
- The `connected()` method will now get the host ip address of httpbin.org each time
- Added a solver to change the url scheme depending on whether it is using http or https in the URI and depending on whatever is passed in the `https` argument for requesting
- A request defined by `request()` is now connected during the call to create the request class, and closed after `.send()` is called
- Moved **"Sending request to server"** logging call to happen normally instead of only when extraLogs is True
- The logging call for getting the request response now happens directly after instead of before setting the variables like code and reason in requesting
- The `headers` return variable for requesting is now directly converted to a dictionary instead of looped through and added progressively from the `.getheaders()` method within the HTTPResponse
- A file is now always written using `shutil.copyfileobj()` regardless of if it is binary or not in requesting
- New allowed http methods and functions `options` and `trace`, the `trace` method does not include the `data` or `cookies` argument or allow it according to [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-trace), other methods have been updated to also follow RFC 9110
- Added logging for `connected()` and `verifiable()` methods because they can update the cache
- The default `redirectLimit` parameter is now assumed from the `redirectLimit` variable for request methods when it is not specified
- Renamed return property `verified` to `verify` for the `request()` method
- Improved backend code readability and performance
- The `cert` return property will now be set to None if `verify` or `https` are passed as False in requesting methods
- `cert` is now actually set to the user defined parameter in requesting methods
- The logging call and return method `.__str__()` for the request classes, now determine the https tag based on whether the request is using https instead of whether it has been verified
- If a request returns malformed data, the new exception `ActiveRequestError` is raised
- The `agent` return property is now no longer set to the masked version when `mask=True`
- Requesting now sends a lowercase version of the **"Connection"** header
- Made the `advancedContext` class `SSLContext` parameter None because if you use the class but don't specify a custom SSLContext, it will override the default one
- Replaced `url_response` type hint from requesting methods with `tooltilsResponse`
- Fixed how some properties are type checked in requesting methods
- Added some new extra log calls with the `advancedContext.extraLogs` parameter in request methods
- Modified grammar of existing log calls in request methods
- New return property for request methods, `rID`, starting from 0 on the first connection made and increases each time a new connection is created, it is program execution specific
- Made exceptions more specific in requesting methods
- Added catching for more per-request exceptions with the request methods `.send()` function
- Fixed an obscure bug where the request data couldn't be read if the connection was closed before trying to read it
- Fixed a bug where if the request body was gzipped, instead of decoding that text to get it as plain text, the code would try the ungzipped version of the text and decode that instead, leading to malformed data
- `raw` return type for request methods is now `bytes`
- The `raw` and `text` return properties for request methods are now set when the method is DOWNLOAD
- Added `tooltilsResponse()` class, this is only intended to be used by the requesting methods since there is data that comes from the request reference, but exists so you are able to know the return properties from code highlighters like Pylance. I have also added reading functions to the response like `.read()`, `.readlines()` and `.seek()` for cross compatibility
- The new `tooltilsResponse` class is now returned from the `.send()` request methods and the http method functions, you may also use the `tooltilsResponse` class with the Python context manager protocol (with statement)
- Added `end_url` and `end_agent` properties to the requesting methods return class to find out what the url was redirected to if it was redirected, and to find out the final User-Agent header
- Modified module docstring
- The new `openConnection` class also supports the Python context manager protocol
- The `request` class now also supports the Python context manager protocol

<br>

**requests.urllib**:
- This version of the requests module is now no longer deprecated but won't be receiving feature updates unless there is an issue or a backend conflict with the normal requests module
- Removed requesting utility functions from this module like `ctx()` and `prep_url()`

<br><br>

1.6.0

New year new tooltils <br><br>

**Major Changes:**
- The normal `.requests` module has been deprecated and renamed to `.requests.urllib` in favour of the `.requests.http` module taking it's place as the main requesting interface
- Requesting has some new advanced features
- Logging has been implemented for every method where necessary
- The json file containing data for tooltils is now located within the user's directory under **".tooltils/config-{version}.json"**, this also means config will be saved across different version installs
- The api is even prettier and more usuable now
- Various optimisations

<br><br>

**Additions:**
- Various failsafes for code under certain conditions
- `Raisable exceptions:` tab for all methods where necessary in `API.md`
- `tests/` directory containing files that provide semi-thorough testing for all methods, classes and variables in tooltils
- Other array types to `.halve()` method in the main module
- Logging for all methods where necessary, you can access the output through the custom method `.info.logger()`
- `override` parameter for `.requests.request()` when the method is **"DOWNLOAD"**
- New planned features in `README.md`
- Parameter testing for the `file_name` argument in `.requests.request()`
- Method `deleteData()` to accompany the change in how tooltils config is stored
- Method `tgzOpen(file)` to unzip and decompress .tar.gz files simply
- Variable `releases` in `.info` containing all current versions of tooltils
- `any` typehint to `.requests.request()` sub-method `.read()`
- Advanced settings through the use of the `adv` parameter for `.requests.request()`, adding feauters like a request redirect limit
- New method `advancedContext()` in `.requests` to be passed in the `advContext` parameter in `.requests.request()` providing featues like a request redirect limit
- Requests are now limited to 20 redirects before the new exception `.errors.RequestRedirectError`, you can change this in the config with the value `requests.redirectLimit`
- Input to certain parameters in the code speeding up the process in which it takes `.requests.verifiable()` to check if a request can be verified
- Include standard `.requests` methods in `.requests.urllib`
- Include `defaultVerificationMethod` as a variable in `API.md` for `.requests`
- New exception class in `.errors`, `RequestCodecError` for when none of the specified codecs can be used to translate the text output by the server in `.requests.request()`
- Certain exception classes now have return properties of information that may be necessary to the user
- New parameter, `write_binary` in `.requests.request()` and `.requests.download()` used to indicate whether the downloaded file should be written as binary or plain text
- `port` parameter to `.requests.request()` in 1.5.0 but forgot to mention
- New method `lengthSort(array)` to sort an array by it's length
<br>

**Removals:**
- `python_version_tuple` variable from `.sys.info`
- `.change()` method from `.requests.http.request()` as it wasn't a reusable connection meaning there is no point to be able to change the data
- The github repository code is no longer bundled with the `data.json` file
- The urllib version of the `.requests` module is now deprecated, becoming `.requests.urllib`, the `.requests.http` module takes it place as it is easier to develop and has a better user experience, this also means the urllib version will no longer receive updates unless they are bugs
- The config value `requests.defaultHttpVerificationMethod` has been removed in favour of having one value for both modules
- `html` return property from `.requests.request()`

<br>

**Changes:**
- Various optimisations
- Modified the way the python version is obtained in `.sys.info`
- Reworded `bitsize` variable docstring in `.sys.info`
- Modified some methods so that the correct error is raised on an exception
- Update important note in `README.md` to include what happens to the data file after uninstall
- Modify the way package data is stored to avoid PermissionError when the Python installation is located in an applications folder
- To account for compatibility, package data is now installed into the system's current user directory as `.tooltils/data-{version}.json`
- Fixed typo of code example in main module `__init__.py` file docstring
- I completely forgot Windows has a different way of operating with directories, bruh
- `license` and `long_description` now have to be provided as is in `.info` because they are inacessible without permission errors from `site-packages`
- If no platform is detected from the set list, it will use the sys.platform variable directly in `.sys.info` `platform` and `detailed_platform` variables
- Updated list of variables set for Windows `.sys.info` implementation
- Updated how the `ram` variable is obtained in the Windows implementation of `.sys.info`
- Reorganised and fixed various `API.md` features
- Reworded main module `epoch()` method docstring
- Reworded `.sys.clear()` method docstring
- Reworded `.sys.info.bitsize` docstring
- Slightly changed how `.sys.clear()` method works
- Fixed all typo errors of the word **"interpreter"**
- `.info.logger()` sub-methods are now handled within the class instead of the external handler
- Removed duplicate sub-method definitions in `.info.logger()`
- Sub-methods in `.info.logger()` now set the `disabled` and `closed` variables when called
- Modified `.sys.exit()` method slightly
- `.requests.request()` sub-methods `.read()` and `.readlines()` now get the response body from the `.text` variable instead of reading the request again as you cannot read the request data twice
- Fixed name lookup bug in `.info.logger()` module parameter
- Logging output format date for `.info.logger()` now uses **"%H"** instead of **"%I"** so the output hour is now in 24 hour format
- Logging output module name now utilises the specific module a log is coming from when the logger was initiated for all of tooltils
- The same headers are now added to the request in `.requests.request()` as `.requests.http.request()` when created
- **"Content-Type"** is now only added to the request in `.requests.request()` when the method is either **"POST"** or **"PUT"**
- Catch new `urllib.error.URLError` when wifi is disconnected for `.requests.urllib.request()` method
- The config value `requests.defaultHttpVerificationMethod` has been changed to `requests.defaultVerificationMethod`
- Reworded `.requests.request()` method docstring
- `requests` now uses the config value `defaultVerificationMethod` for the parameter `verify` in all requesting methods
- `API.md` config section now doesn't no longer includes text indicating you are able to use standard library functions
- Modules names are now lowercase in `API.md`
- Rename `.errors.NoHttpConnection` exception class to `InvalidWifiConnection`
- `url` is now defined before the file name is figured out in `.requests.request()` to avoid name errors
- Cookies and authorisation are now only added to the headers just before the request is made in `.requests.request()`
- Split `headers` response variable into `sent_headers` and `resp_headers` when a request is made with `.requests.request()`
- Rename main module `.interpereter()` class to `.interpreter`
- `encoding` parameter in `.requests.request()` will now consist of both **"utf-8"** and **"ISO-8859-1"** as websites like google use the iso latin format
- Return properties `text`, `raw` and `html` are now set if the request method is **"DOWNLOAD"** in `.requests.request()`
- The parameter `encoding` in `.requests.request()` can now be set as a tuple to try multiple encodings at once
- If the request method is **"DOWNLOAD"** in `.requests.request()`, the `.__str__()` method will now return the filename instead of the url
- `.requests.request(method='DOWNLOAD')` now works because I forgot to change the method checker to use the new keyword
- `.requests.put()` method no longer has the get version of the docstring
- When a filename is not present through the parameter or in the url in `.requests.request(method='DOWNLOAD')`, an exception will now be raised
- `agent` parameter in `.requests.request()` is now type checked and takes priority in being set over the `mask` parameter
- Data is now no longer added to the url when supplied in `.requests.request()`
- Re-organised sensical parameters for request methods in `.requests`
- Logging initialisation is now handled within `info.py` instead of the `_external.py` file

<br><br>

1.5.3

PyPi is disorganised <br><br>

**Additions:**
- `author_email`, `maintainer`, `maintainer_email`, `classifiers`, `homepage` and `homepage_issues` variables to `.info` reflecting the data of `setup.py` and `pyproject.toml`
- `tooltils/` base source code directory to the line counter in `.info`
- Ability to specify local `methods` as config values (very basic implementation, also note keyword arguments are not supported yet, but you may use any tooltils method)
- New `config` options for `.requests`
- New roadmap item in `README.md`
- New global `config` option, `configMethodCheck` for caching with the feature of specifying config values as methods

<br>

**Removals:**
- Unnecessary data tables in `pyproject.toml`
- `README.md` is now excluded from the line counter in `.info`

<br>

**Changes:**
- Rename `!setup.py` to `setup.py`
- Finally fix `setup.py` and `pyproject.toml` to fix the installation bug since 1.5.0 (see [rude stackoverflow people](https://stackoverflow.com/questions/77520583/pypi-package-installing-source-code-into-site-packages-folder-directly))
- Modify `.style()` method optimisation to fix bug
- Update `.info` variable docstrings
- Change `license` variable in `.info` to a dict with the structure (name, content)
- Convert `clearData()` method in `.info` to actually have separate code instead of just using `clearCache()` and `clearConfig()`
- Change copyright symbol in `LICENSE` back to **"(c)"** as the license may have been void when it was changed
- Tooltils is now tested on test.pypi.org before each release to prevent future bugs like what happened in 1.5.0
- Modified the `config` section in `API.md` slightly
- Reworded `requests` module roadmap item in `README.md`
- Update all cache config values to check every 20 times instead of 50
- Fix all directory related errors

<br><br>

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.