From 99204d7f31f5da1259e6c46116c94352fc0b4091 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 11 Oct 2023 22:42:23 +0200 Subject: [PATCH 1/5] refactor: move the source code to the src directory --- {toolbox => src/toolbox}/__init__.py | 0 {toolbox => src/toolbox}/config/__init__.py | 0 {toolbox => src/toolbox}/config/config.py | 0 {toolbox => src/toolbox}/config/config_option.py | 0 {toolbox => src/toolbox}/data/__init__.py | 0 {toolbox => src/toolbox}/data/mappers.py | 0 {toolbox => src/toolbox}/data/value_extractor.py | 0 {toolbox => src/toolbox}/files/__init__.py | 0 {toolbox => src/toolbox}/files/csv_file.py | 0 {toolbox => src/toolbox}/files/file.py | 0 {toolbox => src/toolbox}/files/file_manager.py | 0 {toolbox => src/toolbox}/files/json_file.py | 0 {toolbox => src/toolbox}/files/path.py | 0 {toolbox => src/toolbox}/files/pickle_file.py | 0 {toolbox => src/toolbox}/logging/__init__.py | 0 {toolbox => src/toolbox}/logging/config.py | 0 {toolbox => src/toolbox}/logging/log_file.py | 0 {toolbox => src/toolbox}/testing/__init__.py | 0 {toolbox => src/toolbox}/testing/decorators.py | 0 {toolbox => src/toolbox}/testing/test_case.py | 0 {toolbox => src/toolbox}/time/__init__.py | 0 {toolbox => src/toolbox}/time/weekday.py | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {toolbox => src/toolbox}/__init__.py (100%) rename {toolbox => src/toolbox}/config/__init__.py (100%) rename {toolbox => src/toolbox}/config/config.py (100%) rename {toolbox => src/toolbox}/config/config_option.py (100%) rename {toolbox => src/toolbox}/data/__init__.py (100%) rename {toolbox => src/toolbox}/data/mappers.py (100%) rename {toolbox => src/toolbox}/data/value_extractor.py (100%) rename {toolbox => src/toolbox}/files/__init__.py (100%) rename {toolbox => src/toolbox}/files/csv_file.py (100%) rename {toolbox => src/toolbox}/files/file.py (100%) rename {toolbox => src/toolbox}/files/file_manager.py (100%) rename {toolbox => src/toolbox}/files/json_file.py (100%) rename {toolbox => src/toolbox}/files/path.py (100%) rename {toolbox => src/toolbox}/files/pickle_file.py (100%) rename {toolbox => src/toolbox}/logging/__init__.py (100%) rename {toolbox => src/toolbox}/logging/config.py (100%) rename {toolbox => src/toolbox}/logging/log_file.py (100%) rename {toolbox => src/toolbox}/testing/__init__.py (100%) rename {toolbox => src/toolbox}/testing/decorators.py (100%) rename {toolbox => src/toolbox}/testing/test_case.py (100%) rename {toolbox => src/toolbox}/time/__init__.py (100%) rename {toolbox => src/toolbox}/time/weekday.py (100%) diff --git a/toolbox/__init__.py b/src/toolbox/__init__.py similarity index 100% rename from toolbox/__init__.py rename to src/toolbox/__init__.py diff --git a/toolbox/config/__init__.py b/src/toolbox/config/__init__.py similarity index 100% rename from toolbox/config/__init__.py rename to src/toolbox/config/__init__.py diff --git a/toolbox/config/config.py b/src/toolbox/config/config.py similarity index 100% rename from toolbox/config/config.py rename to src/toolbox/config/config.py diff --git a/toolbox/config/config_option.py b/src/toolbox/config/config_option.py similarity index 100% rename from toolbox/config/config_option.py rename to src/toolbox/config/config_option.py diff --git a/toolbox/data/__init__.py b/src/toolbox/data/__init__.py similarity index 100% rename from toolbox/data/__init__.py rename to src/toolbox/data/__init__.py diff --git a/toolbox/data/mappers.py b/src/toolbox/data/mappers.py similarity index 100% rename from toolbox/data/mappers.py rename to src/toolbox/data/mappers.py diff --git a/toolbox/data/value_extractor.py b/src/toolbox/data/value_extractor.py similarity index 100% rename from toolbox/data/value_extractor.py rename to src/toolbox/data/value_extractor.py diff --git a/toolbox/files/__init__.py b/src/toolbox/files/__init__.py similarity index 100% rename from toolbox/files/__init__.py rename to src/toolbox/files/__init__.py diff --git a/toolbox/files/csv_file.py b/src/toolbox/files/csv_file.py similarity index 100% rename from toolbox/files/csv_file.py rename to src/toolbox/files/csv_file.py diff --git a/toolbox/files/file.py b/src/toolbox/files/file.py similarity index 100% rename from toolbox/files/file.py rename to src/toolbox/files/file.py diff --git a/toolbox/files/file_manager.py b/src/toolbox/files/file_manager.py similarity index 100% rename from toolbox/files/file_manager.py rename to src/toolbox/files/file_manager.py diff --git a/toolbox/files/json_file.py b/src/toolbox/files/json_file.py similarity index 100% rename from toolbox/files/json_file.py rename to src/toolbox/files/json_file.py diff --git a/toolbox/files/path.py b/src/toolbox/files/path.py similarity index 100% rename from toolbox/files/path.py rename to src/toolbox/files/path.py diff --git a/toolbox/files/pickle_file.py b/src/toolbox/files/pickle_file.py similarity index 100% rename from toolbox/files/pickle_file.py rename to src/toolbox/files/pickle_file.py diff --git a/toolbox/logging/__init__.py b/src/toolbox/logging/__init__.py similarity index 100% rename from toolbox/logging/__init__.py rename to src/toolbox/logging/__init__.py diff --git a/toolbox/logging/config.py b/src/toolbox/logging/config.py similarity index 100% rename from toolbox/logging/config.py rename to src/toolbox/logging/config.py diff --git a/toolbox/logging/log_file.py b/src/toolbox/logging/log_file.py similarity index 100% rename from toolbox/logging/log_file.py rename to src/toolbox/logging/log_file.py diff --git a/toolbox/testing/__init__.py b/src/toolbox/testing/__init__.py similarity index 100% rename from toolbox/testing/__init__.py rename to src/toolbox/testing/__init__.py diff --git a/toolbox/testing/decorators.py b/src/toolbox/testing/decorators.py similarity index 100% rename from toolbox/testing/decorators.py rename to src/toolbox/testing/decorators.py diff --git a/toolbox/testing/test_case.py b/src/toolbox/testing/test_case.py similarity index 100% rename from toolbox/testing/test_case.py rename to src/toolbox/testing/test_case.py diff --git a/toolbox/time/__init__.py b/src/toolbox/time/__init__.py similarity index 100% rename from toolbox/time/__init__.py rename to src/toolbox/time/__init__.py diff --git a/toolbox/time/weekday.py b/src/toolbox/time/weekday.py similarity index 100% rename from toolbox/time/weekday.py rename to src/toolbox/time/weekday.py From 53b2ebd4ad8e75c900dd2365dd4c504d5ee0bd20 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 11 Oct 2023 22:44:46 +0200 Subject: [PATCH 2/5] chore: update the project setup to use the src folder --- pyproject.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 086f001..a95b677 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,3 +32,18 @@ disable = [ "R0903", # (too-few-public-methods) "R0913", # (too-many-arguments) ] + +[tool.setuptools] +package-dir = { "" = "src" } + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.coverage.run] +branch = true +relative_files = true +source = ["src"] + +[tool.coverage.paths] +source = ["src"] +tests = ["tests/"] From 82ed8f123a97899cfb18a8779967f4852d1d8a99 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 11 Oct 2023 22:46:13 +0200 Subject: [PATCH 3/5] chore: update the scripts --- format.sh | 2 +- pydoc.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/format.sh b/format.sh index 42c1f03..dd4ac4b 100755 --- a/format.sh +++ b/format.sh @@ -1,2 +1,2 @@ #!/bin/sh -black toolbox +black src diff --git a/pydoc.sh b/pydoc.sh index f50e55d..55daa1d 100755 --- a/pydoc.sh +++ b/pydoc.sh @@ -4,5 +4,5 @@ lazydocs \ --ignored-modules tests \ --overview-file=README.md \ --validate \ - . + src rm docs/.pages From 871bd61da5d2e10f717bbc96e11235e1cd95765b Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 11 Oct 2023 22:46:39 +0200 Subject: [PATCH 4/5] doc: update the documentation --- README.md | 1 + docs/toolbox.config.config.md | 34 ++++++++++++++-------------- docs/toolbox.config.config_option.md | 24 ++++++++++---------- docs/toolbox.config.md | 2 +- docs/toolbox.data.mappers.md | 10 ++++---- docs/toolbox.data.md | 2 +- docs/toolbox.data.value_extractor.md | 8 +++---- docs/toolbox.files.csv_file.md | 22 +++++++++--------- docs/toolbox.files.file.md | 12 +++++----- docs/toolbox.files.file_manager.md | 26 ++++++++++----------- docs/toolbox.files.json_file.md | 14 ++++++------ docs/toolbox.files.md | 2 +- docs/toolbox.files.path.md | 18 +++++++-------- docs/toolbox.files.pickle_file.md | 18 +++++++-------- docs/toolbox.logging.config.md | 6 ++--- docs/toolbox.logging.log_file.md | 26 ++++++++++----------- docs/toolbox.logging.md | 2 +- docs/toolbox.md | 2 +- docs/toolbox.testing.decorators.md | 4 ++-- docs/toolbox.testing.md | 2 +- docs/toolbox.testing.test_case.md | 8 +++---- docs/toolbox.time.md | 2 +- docs/toolbox.time.weekday.md | 18 +++++++-------- 23 files changed, 132 insertions(+), 131 deletions(-) diff --git a/README.md b/README.md index f987a04..7cfb1c8 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ cd py-toolbox python3 -m venv ".venv" source "./venv/bin/activate" pip install -r requirements.txt +pip install -e . ``` **Note:** For deactivating the virtual env, call the command `deactivate`. diff --git a/docs/toolbox.config.config.md b/docs/toolbox.config.config.md index e554c4e..81e63a5 100644 --- a/docs/toolbox.config.config.md +++ b/docs/toolbox.config.config.md @@ -1,6 +1,6 @@ - + # module `toolbox.config.config` A class for handling a configuration. @@ -40,7 +40,7 @@ config = Config({"foo": "bar", "value": 42}) --- - + ## class `Config` Handles a configuration. @@ -101,7 +101,7 @@ data = config.get_config() config.set_config(data) ``` - + ### method `__init__` @@ -145,7 +145,7 @@ config = Config({"foo": "bar"}, --- - + ### method `choices` @@ -181,7 +181,7 @@ config.choices("bar") # () --- - + ### method `describe` @@ -217,7 +217,7 @@ config.describe("bar") # "" --- - + ### method `drop` @@ -253,7 +253,7 @@ config.drop("bar") # False --- - + ### method `get` @@ -295,7 +295,7 @@ config.get("bar", "foo") # "foo" --- - + ### method `get_config` @@ -326,7 +326,7 @@ config.get_config() # {"foo": "bar"} --- - + ### method `get_option` @@ -362,7 +362,7 @@ config.get_option("bar") # None --- - + ### method `get_options` @@ -393,7 +393,7 @@ config.get_options() # [{"name": "foo", "value": "bar", "default": None, ...}] --- - + ### method `has` @@ -429,7 +429,7 @@ config.has("bar") # False --- - + ### method `keys` @@ -465,7 +465,7 @@ print(list(keys)) # ["foo"] --- - + ### method `reset` @@ -503,7 +503,7 @@ config.reset("bar") # Create the option "bar" with the value None --- - + ### method `reset_config` @@ -534,7 +534,7 @@ config.get_config() # {"foo": None} --- - + ### method `set` @@ -581,7 +581,7 @@ config.set("bar", "bar") # Create the option "bar" with the value "bar" --- - + ### method `set_config` @@ -622,7 +622,7 @@ config.set_config({"foo": "bar"}) --- - + ### method `set_option` diff --git a/docs/toolbox.config.config_option.md b/docs/toolbox.config.config_option.md index 7878268..6050ba3 100644 --- a/docs/toolbox.config.config_option.md +++ b/docs/toolbox.config.config_option.md @@ -1,6 +1,6 @@ - + # module `toolbox.config.config_option` A class for handling config options. @@ -30,7 +30,7 @@ print(age.get()) # 20 --- - + ## function `create_options` @@ -76,7 +76,7 @@ for option in create_options([ --- - + ## class `ConfigOption` Handles a config option. @@ -115,7 +115,7 @@ name.set("John") print(name.get()) # "John" ``` - + ### method `__init__` @@ -242,7 +242,7 @@ The current value of the option. --- - + ### method `cast` @@ -266,7 +266,7 @@ Casts and format a value to what is expected by the config option. --- - + ### method `copy` @@ -298,7 +298,7 @@ print(name is name2) # False --- - + ### method `get` @@ -333,7 +333,7 @@ print(name.get()) # "John" --- - + ### method `get_dict` @@ -362,7 +362,7 @@ print(name.get_dict()) # {"name": "foo", "value": "bar", "default": None, ...} --- - + ### method `reset` @@ -380,7 +380,7 @@ Resets the option to its default value. --- - + ### method `set` @@ -429,7 +429,7 @@ print(name.get()) # "bob" --- - + ### method `set_default` @@ -476,7 +476,7 @@ print(name.get()) # "" --- - + ### method `set_description` diff --git a/docs/toolbox.config.md b/docs/toolbox.config.md index 53212a2..5c14fce 100644 --- a/docs/toolbox.config.md +++ b/docs/toolbox.config.md @@ -1,6 +1,6 @@ - + # module `toolbox.config` The `config` package provides classes for handling a configuration. diff --git a/docs/toolbox.data.mappers.md b/docs/toolbox.data.mappers.md index b60a2c4..793a4ba 100644 --- a/docs/toolbox.data.mappers.md +++ b/docs/toolbox.data.mappers.md @@ -1,6 +1,6 @@ - + # module `toolbox.data.mappers` A collection of data mappers. @@ -34,7 +34,7 @@ print(mapper("3.753.323,184")) # 3753323.184 --- - + ## function `passthrough` @@ -71,7 +71,7 @@ print(passthrough({})) # {} --- - + ## function `boolean` @@ -119,7 +119,7 @@ print(boolean({})) # False --- - + ## function `decimal` @@ -158,7 +158,7 @@ print(mapper("3.753.323,184")) # 3753323.184 --- - + ## class `ValueMapper` The interface for a value mapper. diff --git a/docs/toolbox.data.md b/docs/toolbox.data.md index 2de4d98..5097f29 100644 --- a/docs/toolbox.data.md +++ b/docs/toolbox.data.md @@ -1,6 +1,6 @@ - + # module `toolbox.data` A collection of data utilities. diff --git a/docs/toolbox.data.value_extractor.md b/docs/toolbox.data.value_extractor.md index cd9f648..8610fea 100644 --- a/docs/toolbox.data.value_extractor.md +++ b/docs/toolbox.data.value_extractor.md @@ -1,6 +1,6 @@ - + # module `toolbox.data.value_extractor` A tool for extracting values from a set of possible entries. @@ -20,7 +20,7 @@ print([extractor.extract(row) for row in data]) # ["2023-10-06", "2023-02-20", " --- - + ## class `ValueExtractor` Extracts a value from a set of possible entries. @@ -43,7 +43,7 @@ data = [{"date": "2023-10-06"}, {"day": "2023-02-20"}, {"time": "2023-06-12"}] print([extractor.extract(row) for row in data]) # ["2023-10-06", "2023-02-20", "2023-06-12"] ``` - + ### method `__init__` @@ -106,7 +106,7 @@ The mapper applied to cast and format the extracted value. --- - + ### method `extract` diff --git a/docs/toolbox.files.csv_file.md b/docs/toolbox.files.csv_file.md index 1a16cad..1602a77 100644 --- a/docs/toolbox.files.csv_file.md +++ b/docs/toolbox.files.csv_file.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.csv_file` A simple API for reading and writing CSV files. @@ -57,7 +57,7 @@ with file: --- - + ## function `read_csv_file` @@ -123,7 +123,7 @@ for row in read_csv_file('path/to/file', iterator=True): --- - + ## function `write_csv_file` @@ -189,7 +189,7 @@ write_csv_file('path/to/file', csv_data, encoding='UTF-8', dialect='excel') --- - + ## function `read_zip_csv` @@ -265,7 +265,7 @@ with open('path/to/file.zip', 'rb') as file: --- - + ## class `CSVFile` Offers a simple API for reading and writing CSV files. @@ -310,7 +310,7 @@ with file(create=True): csv = file.read_file() ``` - + ### method `__init__` @@ -566,7 +566,7 @@ size = file.size --- - + ### method `close` @@ -604,7 +604,7 @@ file.close() --- - + ### method `read` @@ -648,7 +648,7 @@ csv_data = [row for row in file] --- - + ### method `read_file` @@ -699,7 +699,7 @@ for row in file.read_file(iterator=True): --- - + ### method `write` @@ -746,7 +746,7 @@ with file(create=True): --- - + ### method `write_file` diff --git a/docs/toolbox.files.file.md b/docs/toolbox.files.file.md index 6a27173..61ab9e2 100644 --- a/docs/toolbox.files.file.md +++ b/docs/toolbox.files.file.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.file` A collection of utilities for accessing files. @@ -43,7 +43,7 @@ content = read_zip_file(data) --- - + ## function `get_file_mode` @@ -107,7 +107,7 @@ with open('path/to/file', get_file_mode(binary=True)) as file: --- - + ## function `read_file` @@ -159,7 +159,7 @@ data = read_file('path/to/file', binary=True) --- - + ## function `write_file` @@ -214,7 +214,7 @@ write_file('path/to/file', data, binary=True) --- - + ## function `fetch_content` @@ -277,7 +277,7 @@ data = fetch_content("http://example.com/data", binary=True) --- - + ## function `read_zip_file` diff --git a/docs/toolbox.files.file_manager.md b/docs/toolbox.files.file_manager.md index 31e7b7d..4c5dda3 100644 --- a/docs/toolbox.files.file_manager.md +++ b/docs/toolbox.files.file_manager.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.file_manager` A simple class for reading and writing files. @@ -36,7 +36,7 @@ with file: --- - + ## class `FileManager` Offers a simple API for reading and writing files. @@ -74,7 +74,7 @@ with file(create=True): content = file.read_file() ``` - + ### method `__init__` @@ -293,7 +293,7 @@ size = file.size --- - + ### method `check` @@ -355,7 +355,7 @@ else: --- - + ### method `close` @@ -393,7 +393,7 @@ file.close() --- - + ### method `create_path` @@ -428,7 +428,7 @@ else: --- - + ### method `delete` @@ -467,7 +467,7 @@ file.delete() --- - + ### method `exists` @@ -499,7 +499,7 @@ if file.exists(): --- - + ### method `open` @@ -560,7 +560,7 @@ data = [dat for dat in file] --- - + ### method `read` @@ -601,7 +601,7 @@ with file: --- - + ### method `read_file` @@ -640,7 +640,7 @@ data = file.read_file() --- - + ### method `write` @@ -686,7 +686,7 @@ with file(create=True): --- - + ### method `write_file` diff --git a/docs/toolbox.files.json_file.md b/docs/toolbox.files.json_file.md index a5710d7..6136e89 100644 --- a/docs/toolbox.files.json_file.md +++ b/docs/toolbox.files.json_file.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.json_file` A simple API for reading and writing JSON files. @@ -49,7 +49,7 @@ with file: --- - + ## function `read_json_file` @@ -91,7 +91,7 @@ json_data = read_json_file('path/to/file', encoding='UTF-8') --- - + ## function `write_json_file` @@ -146,7 +146,7 @@ write_json_file('path/to/file', json_data, encoding='UTF-8', indent=2) --- - + ## class `JSONFile` Offers a simple API for reading and writing JSON files. @@ -187,7 +187,7 @@ with file(create=True): json = file.read_file() ``` - + ### method `__init__` @@ -424,7 +424,7 @@ size = file.size --- - + ### method `read` @@ -464,7 +464,7 @@ with file: --- - + ### method `write` diff --git a/docs/toolbox.files.md b/docs/toolbox.files.md index bb32c80..4b9a6c9 100644 --- a/docs/toolbox.files.md +++ b/docs/toolbox.files.md @@ -1,6 +1,6 @@ - + # module `toolbox.files` The `files` package provides several utilities for handling files. diff --git a/docs/toolbox.files.path.md b/docs/toolbox.files.path.md index 98e12ff..5b1e993 100644 --- a/docs/toolbox.files.path.md +++ b/docs/toolbox.files.path.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.path` A collection of utilities around file paths. @@ -51,7 +51,7 @@ else: --- - + ## function `get_module_path` @@ -86,7 +86,7 @@ path = get_module_path('foo') --- - + ## function `get_module_folder_path` @@ -121,7 +121,7 @@ path = get_module_folder_path('foo') --- - + ## function `get_application_path` @@ -156,7 +156,7 @@ app_path = get_application_path('my_package') --- - + ## function `get_application_name` @@ -191,7 +191,7 @@ print(get_application_name('my_package')) --- - + ## function `get_file_path` @@ -227,7 +227,7 @@ filename = get_file_path('path/to/file', 'my_package') --- - + ## function `create_file_path` @@ -267,7 +267,7 @@ else: --- - + ## function `delete_path` @@ -315,7 +315,7 @@ else: --- - + ## function `get_cache_path` diff --git a/docs/toolbox.files.pickle_file.md b/docs/toolbox.files.pickle_file.md index dab0f54..bad0f34 100644 --- a/docs/toolbox.files.pickle_file.md +++ b/docs/toolbox.files.pickle_file.md @@ -1,6 +1,6 @@ - + # module `toolbox.files.pickle_file` A simple API for reading and writing pickle files. @@ -54,7 +54,7 @@ with file: --- - + ## function `read_pickle_file` @@ -106,7 +106,7 @@ for obj in read_pickle_file('path/to/file', iterator=True): --- - + ## function `write_pickle_file` @@ -156,7 +156,7 @@ write_pickle_file('path/to/file', data) --- - + ## class `PickleFile` Offers a simple API for reading and writing pickle files. @@ -200,7 +200,7 @@ file.write_file(data) data = file.read_file() ``` - + ### method `__init__` @@ -439,7 +439,7 @@ size = file.size --- - + ### method `read` @@ -483,7 +483,7 @@ data = [obj for obj in file] --- - + ### method `read_file` @@ -534,7 +534,7 @@ for obj in file.read_file(iterator=True): --- - + ### method `write` @@ -581,7 +581,7 @@ with file(create=True): --- - + ### method `write_file` diff --git a/docs/toolbox.logging.config.md b/docs/toolbox.logging.config.md index 74904d3..b24666e 100644 --- a/docs/toolbox.logging.config.md +++ b/docs/toolbox.logging.config.md @@ -1,6 +1,6 @@ - + # module `toolbox.logging.config` A collection of utilities for logging purpose. @@ -29,7 +29,7 @@ if __name__ == "__main__": --- - + ## function `setup_file_logging` @@ -68,7 +68,7 @@ setup_file_logging('path/to/file.log') --- - + ## function `handle_uncaught_exceptions` diff --git a/docs/toolbox.logging.log_file.md b/docs/toolbox.logging.log_file.md index 33965fa..483788c 100644 --- a/docs/toolbox.logging.log_file.md +++ b/docs/toolbox.logging.log_file.md @@ -1,6 +1,6 @@ - + # module `toolbox.logging.log_file` A custom logger that writes directly to a file. @@ -40,7 +40,7 @@ logger.error('An error occurred: %s', error) --- - + ## class `LogFile` Offers a similar API to the Python builtin loggers for logging to a custom file. @@ -68,7 +68,7 @@ logger = LogFile() logger.info('The received value is %d', value) ``` - + ### method `__init__` @@ -233,7 +233,7 @@ print(logger.name) --- - + ### method `close` @@ -266,7 +266,7 @@ logger.close() # not necessary since it will be called automatically upon exit. --- - + ### method `debug` @@ -306,7 +306,7 @@ logger.debug('For debug purpose: %d given to %s', value, action) --- - + ### method `delete` @@ -335,7 +335,7 @@ logger.delete() --- - + ### method `error` @@ -375,7 +375,7 @@ logger.error('An error occurred: %s', error) --- - + ### method `info` @@ -415,7 +415,7 @@ logger.info('The received value is %d', value) --- - + ### method `log` @@ -459,7 +459,7 @@ logger.log(logging.ERROR, 'An error occurred: %s', error) --- - + ### method `open` @@ -492,7 +492,7 @@ logger.info('Something was done at %s', datetime.now()) --- - + ### method `set_format` @@ -527,7 +527,7 @@ logger.set_format('[%(asctime)s][%(levelname)s]: %(message)s') --- - + ### method `set_level` @@ -562,7 +562,7 @@ logger.set_level(logging.DEBUG) --- - + ### method `warn` diff --git a/docs/toolbox.logging.md b/docs/toolbox.logging.md index b7478e2..36566db 100644 --- a/docs/toolbox.logging.md +++ b/docs/toolbox.logging.md @@ -1,6 +1,6 @@ - + # module `toolbox.logging` The `logging` package provides several utilities for logging purpose. diff --git a/docs/toolbox.md b/docs/toolbox.md index 3180b45..e54b605 100644 --- a/docs/toolbox.md +++ b/docs/toolbox.md @@ -1,6 +1,6 @@ - + # module `toolbox` `py-toolbox` is a collection of utilities offering solutions to a set of common problems. diff --git a/docs/toolbox.testing.decorators.md b/docs/toolbox.testing.decorators.md index 0dbf9c3..8e37125 100644 --- a/docs/toolbox.testing.decorators.md +++ b/docs/toolbox.testing.decorators.md @@ -1,6 +1,6 @@ - + # module `toolbox.testing.decorators` A collection of decorators for testing purpose. @@ -28,7 +28,7 @@ def test_addition(self, title, params, expected): --- - + ## function `test_cases` diff --git a/docs/toolbox.testing.md b/docs/toolbox.testing.md index edbba91..67b6552 100644 --- a/docs/toolbox.testing.md +++ b/docs/toolbox.testing.md @@ -1,6 +1,6 @@ - + # module `toolbox.testing` The `testing` package provides utilities for testing purpose. diff --git a/docs/toolbox.testing.test_case.md b/docs/toolbox.testing.test_case.md index a8d1950..e7e5607 100644 --- a/docs/toolbox.testing.test_case.md +++ b/docs/toolbox.testing.test_case.md @@ -1,6 +1,6 @@ - + # module `toolbox.testing.test_case` Extends the default Python TestCase with more assertions. @@ -23,7 +23,7 @@ class TestMyStuff(testing.TestCase) --- - + ## class `TestCase` Test class with additional assertions. @@ -33,7 +33,7 @@ Test class with additional assertions. --- - + ### method `assertListsAlmostEqual` @@ -74,7 +74,7 @@ class TestMyStuff(testing.TestCase) --- - + ### method `assertListsNotAlmostEqual` diff --git a/docs/toolbox.time.md b/docs/toolbox.time.md index f9efaf2..ef464e3 100644 --- a/docs/toolbox.time.md +++ b/docs/toolbox.time.md @@ -1,6 +1,6 @@ - + # module `toolbox.time` A collection of time related utilities. diff --git a/docs/toolbox.time.weekday.md b/docs/toolbox.time.weekday.md index 778176e..9c6286e 100644 --- a/docs/toolbox.time.weekday.md +++ b/docs/toolbox.time.weekday.md @@ -1,6 +1,6 @@ - + # module `toolbox.time.weekday` A tool for getting the date of a weekday. @@ -47,7 +47,7 @@ print(weekday.previous_date("2023-10-06", True)) # "2023-10-06" --- - + ## class `Weekday` Gets the date of a weekday given a particular date. @@ -80,7 +80,7 @@ print(weekday.previous_date("2023-10-06")) # "2023-09-29" print(weekday.previous_date("2023-10-06", True)) # "2023-10-06" ``` - + ### method `__init__` @@ -126,7 +126,7 @@ print(weekday.previous_date("2023-10-06", True)) # "2023-10-06" --- - + ### method `closest` @@ -164,7 +164,7 @@ print(weekday.closest(SUNDAY)) # -2 --- - + ### method `closest_date` @@ -210,7 +210,7 @@ print(weekday.closest_date("2023-10-06")) # "2023-10-06" --- - + ### method `next` @@ -248,7 +248,7 @@ print(weekday.next(SUNDAY)) # 5 --- - + ### method `next_date` @@ -297,7 +297,7 @@ print(weekday.next_date("2023-10-06", True)) # "2023-10-06" --- - + ### method `previous` @@ -335,7 +335,7 @@ print(weekday.previous(SUNDAY)) # 2 --- - + ### method `previous_date` From 63f98bdf505ab4959b1d95ab067969d6e78afb16 Mon Sep 17 00:00:00 2001 From: jsconan Date: Wed, 11 Oct 2023 22:51:17 +0200 Subject: [PATCH 5/5] chore: update the changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31372b0..9a760d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Move the package to the `src` directory. + ### Added - `get_cache_path(name, create)` - Gets the path to a cache folder.