Data Science Toolbox
Project description
resverman
Simplified resource version management + storage tools
dstools
A collection of utility tools for data science projects.
Installation
To install the package from your local repository, navigate to the root directory of this project in your terminal and run:
pip install .
Usage
Here are some examples of how to use the core components of dstools:
Resource Management (dstools.resource_management)
Manage versioned resources like datasets or models.
# Example usage (conceptual - requires specific implementation details)
from dstools.resource_management import Resource
# Define or load a resource configuration
# config = {'storage': ..., 'versioning': ...}
# data_resource = Resource(name='my_dataset', config=config)
# Access a specific version
# latest_data = data_resource.get_version('latest')
# Add a new version
# new_data = ...
# data_resource.add_version(data=new_data, message='Updated data with new features')
print("Resource management features allow tracking and accessing different versions of assets.")
# Note: Actual usage depends on the specific implementation within resource.py and resource_config.py
(Please refer to the specific classes and methods within src/dstools/resource_management for detailed implementation)
Reporting (dstools.reporting)
Log metrics and information during your processes.
from dstools.reporting import Reporter
# Initialize a reporter (e.g., console reporter)
reporter = Reporter() # Assuming a default or configured reporter
# Report metrics
reporter.report_metric("accuracy", 0.95)
reporter.report_metric("loss", 0.12)
# Report information
reporter.report_info("Training completed.", details={"epochs": 10})
print("\nReporting allows structured logging of metrics and events.")
(See src/dstools/reporting/reporter.py for reporter options and configuration)
Storage (dstools.storage)
Interact with different storage backends using handlers.
# Example usage (conceptual - requires specific handler implementation)
# from dstools.storage import StorageFactory # Assuming a factory pattern
#
# # Configure and get a storage handler (e.g., local storage)
# local_storage = StorageFactory.get_handler(type='local', config={'base_path': '/data/my_project'})
#
# # Save data
# data_to_save = {"key": "value"}
# local_storage.save('my_data.json', data_to_save)
#
# # Load data
# loaded_data = local_storage.load('my_data.json')
# print(f"\nLoaded data from storage: {loaded_data}")
print("\nStorage handlers provide a consistent interface for different backends (e.g., local, S3).")
# Note: Actual usage depends on the handler implementations in src/dstools/storage/handlers/
(Explore src/dstools/storage/handlers/ for available storage types and their usage)
Time Measurement (dstools.common.time_measure)
Measure the execution time of code blocks easily.
import time
from dstools.common.time_measure import DurationMeasure, TimeUnit
print("\nUsing DurationMeasure to time an operation:")
with DurationMeasure(action='data processing', unit=TimeUnit.MILLISECONDS) as dm:
# Simulate some work
time.sleep(0.15)
print(f"Measured duration: {dm.duration:.2f} {dm._get_unit_suffix(dm.used_unit)}")
# Example with automatic unit fallback
print("\nTiming a very short operation:")
with DurationMeasure(action='quick check', unit=TimeUnit.SECONDS, fallback=True) as dm_short:
pass # Very fast operation
print(f"Measured duration: {dm_short.duration:.2f} {dm_short._get_unit_suffix(dm_short.used_unit)}")
(See src/dstools/common/time_measure.py for more details)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_dstools-0.1.4.tar.gz.
File metadata
- Download URL: python_dstools-0.1.4.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e7a022573e3ee83737dd76ff16009f75d14b4dbb4c180af1d78b1df9cdd3e64
|
|
| MD5 |
7e2c4e8522336aab5afd9c9a207983fe
|
|
| BLAKE2b-256 |
5c97d08e1f5b84a5d49ddacecc1141deed84b8821fd63ca44cac3ad3661279d6
|
Provenance
The following attestation bundles were made for python_dstools-0.1.4.tar.gz:
Publisher:
python-publish.yml on ronpik/dstools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_dstools-0.1.4.tar.gz -
Subject digest:
0e7a022573e3ee83737dd76ff16009f75d14b4dbb4c180af1d78b1df9cdd3e64 - Sigstore transparency entry: 202043841
- Sigstore integration time:
-
Permalink:
ronpik/dstools@36e3505660a1cba239c73a16f4023c7cf371e4a5 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ronpik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@36e3505660a1cba239c73a16f4023c7cf371e4a5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file python_dstools-0.1.4-py3-none-any.whl.
File metadata
- Download URL: python_dstools-0.1.4-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63d3c328b24b523b5984d51b0aec78d7a577533ab119a7127f431e40ef9b23f0
|
|
| MD5 |
71b757f07349b8c33ace6a272447fda8
|
|
| BLAKE2b-256 |
5f2e22312543df09f3f56f8d359fbfa19fd95a6740ef78281967ac0889af1e88
|
Provenance
The following attestation bundles were made for python_dstools-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on ronpik/dstools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_dstools-0.1.4-py3-none-any.whl -
Subject digest:
63d3c328b24b523b5984d51b0aec78d7a577533ab119a7127f431e40ef9b23f0 - Sigstore transparency entry: 202043842
- Sigstore integration time:
-
Permalink:
ronpik/dstools@36e3505660a1cba239c73a16f4023c7cf371e4a5 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/ronpik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@36e3505660a1cba239c73a16f4023c7cf371e4a5 -
Trigger Event:
release
-
Statement type: