Table of Contents
About The Repository
This repository provides a Python internal DSL (Domain Specific Language) to model sampling workflows for MSR (Mining Software Repositories) studies. The DSL offers a structured and intuitive approach to define, execute, and analyze complex data sampling and processing workflows commonly used in software engineering research.
Project Structure
PythonWorkflowDSL/
├── pyproject.toml # Python package configuration
├── README.md # Project documentation
└── src/
└── sampling_mining_workflows_dsl/ # Main DSL package
├── __init__.py # Package initialization
├── CompleteWorkflow.py # Complete workflow implementation
├── toolbox.py # Utility functions and tools
├── Workflow.py # Core workflow class
├── WorkflowBuilder.py # Builder pattern for workflows
├── analysis/ # Statistical analysis modules
│ └── ... # Chi-square, coverage, distribution analysis
├── constraint/ # Constraint system
│ └── ... # Boolean constraints and comparators
├── element/ # Data element management
│ ├── loader/ # Data loader implementations
│ └── writer/ # Data writer implementations
├── exec_visualizer/ # Execution visualization
│ └── ... # Local server and visualization tools
├── metadata/ # Metadata system
│ └── ... # Boolean, date, string metadata types
├── operator/ # Workflow operators
│ ├── clustering/ # Clustering operators
│ ├── selection/ # Selection operators (filter/sampling)
│ └── set_algebra/ # Set algebra operations
└── test/ # Test files and examples
└── ... # JSON test data and workflow examples
Getting Started
Prerequisites
Before using this DSL, ensure you have Python 3.8+ installed on your system.
Recommended: install and use uv
Starting from scratch
uv inituv pip install https://github.com/RomainLefeuvre/samplingMiningWorkflowDSL.git
you can also use the published version on pypi
pip install sampling-mining-workflows-dsl
Template Repository
A complete template with examples is available at:
git@github.com:RomainLefeuvre/msr_papers_sampling_workflows.git
Clone the template to get started quickly:
git clone https://github.com/RomainLefeuvre/SamplinMiningWorkflowDSLTemplate.git
Dev environment installation
If you want to contribute to this repository, you can clone and setup locally this project :
-
Clone this repository:
git clone https://github.com/RomainLefeuvre/SamplingMiningWorflowDSL.git cd SamplingMiningWorflowDSL
-
(Recommended) Install dependencies with
uv:
uv sync
- Activate the virtual environment created by
uv:
source .venv/bin/activate
Usage
Basic Workflow Example
from sampling_mining_workflows_dsl.WorkflowBuilder import WorkflowBuilder
from sampling_mining_workflows_dsl.element.loader.LoaderFactory import LoaderFactory
from sampling_mining_workflows_dsl.element.writer.WriterFactory import WritterFactory
from sampling_mining_workflows_dsl.metadata.Metadata import Metadata
# Define metadata for your data
id_metadata = Metadata.of_string("id")
language_metadata = Metadata.of_string("language")
commit_count_metadata = Metadata.of_integer("commitNb")
# Create loaders and writers
json_loader = LoaderFactory.json_loader
json_writer = WritterFactory.json_writer
# Create a basic sampling workflow
workflow = (
WorkflowBuilder()
.input(json_loader("input_data.json", id_metadata, commit_count_metadata, language_metadata))
.filter_operator("commitNb > 1000")
.random_selection_operator(50)
.output(json_writer("output_data.json"))
)
# Execute the workflow
results = workflow.execute_workflow()
License
Distributed under the GNU General Public License v3.0. See LICENSE for more information.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Release files for sampling-mining-workflows-dsl 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sampling_mining_workflows_dsl-0.0.4.tar.gz | 518.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sampling_mining_workflows_dsl-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 593.2 kB
Release files / sampling_mining_workflows_dsl-0.0.4.tar.gz
| Download URL | sampling_mining_workflows_dsl-0.0.4.tar.gz |
|---|---|
| Size | 518.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
075b89173de9f58bd412d4094f9ee0e3255fe57f52f92962c3d6f470cc5cf1f3
|
|
BLAKE2b-256 checksum How to use checksums |
80598eb5c1f181e6670159902912bbcd596e19dfbfe3f3c5a424293cd24f6186
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sampling_mining_workflows_dsl-0.0.4-py3-none-any.whl
| Download URL | sampling_mining_workflows_dsl-0.0.4-py3-none-any.whl |
|---|---|
| Size | 74.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8aa57da186c4c114ad9e76abb74ac17bb25fce5c8e459ac460368e1f73ff1db4
|
|
BLAKE2b-256 checksum How to use checksums |
e8a7707ee1f355e4e56eee2f5c7b8929b1416ae1d64b1d89f281c8db3a788100
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|