Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_dstools-0.1.4.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_dstools-0.1.4-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

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

Hashes for python_dstools-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0e7a022573e3ee83737dd76ff16009f75d14b4dbb4c180af1d78b1df9cdd3e64
MD5 7e2c4e8522336aab5afd9c9a207983fe
BLAKE2b-256 5c97d08e1f5b84a5d49ddacecc1141deed84b8821fd63ca44cac3ad3661279d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_dstools-0.1.4.tar.gz:

Publisher: python-publish.yml on ronpik/dstools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for python_dstools-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 63d3c328b24b523b5984d51b0aec78d7a577533ab119a7127f431e40ef9b23f0
MD5 71b757f07349b8c33ace6a272447fda8
BLAKE2b-256 5f2e22312543df09f3f56f8d359fbfa19fd95a6740ef78281967ac0889af1e88

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_dstools-0.1.4-py3-none-any.whl:

Publisher: python-publish.yml on ronpik/dstools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page