Skip to main content

CoCluReMiG - COmmit CLUstering and REpository MIning for Git

A simple to use library for mining git repositories.

Usage

Commit graph

import cocluremig.utils.gitutils as gitutils

#get git repository (saved by default to tempdir)
repo = gitutils.get_repo("https://github.com/mmonschau/cocluremig")

#get commit_graph
(edges, commits) = gitutils.get_edge_list(repo)

Pre-Defined Commit Metric

import cocluremig.utils.gitutils as gitutils
import cocluremig.analyzer.commit.analyzers as c_analyzers

repo = gitutils.get_repo("https://github.com/mmonschau/cocluremig")

file_type_analyzer = c_analyzers.get_file_number_per_extension_analyzer(repo)

for c in c_analyzers.get_all_commits(repo):
    
    c_analyzers.get_basic_commit_data(c)
    # sha, date_committed, date_authored, signed, author_name, author_mail, committer_name, committer_mail
    file_type_analyzer.apply_metric(c)
    # {'py':26,'md':1,'toml':1,'cfg':1}

Own Commit Metric

import cocluremig.utils.gitutils as gitutils
import cocluremig.analyzer.commit
import cocluremig.analyzer.commit.analyzers
import cocluremig.analyzer.commit.base_analyzer
import cocluremig.analyzer.commit.blob_inspectors

repo = gitutils.get_repo("https://github.com/mmonschau/cocluremig")

def get_tokens(blob):
    text = cocluremig.analyzer.commit.blob_inspectors.get_text_representation(blob)
    # import git ...
    tokens = set(text.split())
    return tokens
    

analyzer = cocluremig.analyzer.base_analyzer.RepoFileMetricAnalyzer(repo,get_tokens,lambda x,y : x.union(y), set() )

for c in cocluremig.analyzer.get_all_commits(repo):
    analyzer.apply_metric(c)
    # {if, is, for, in, ...}

Other exmaples

see samples-folder

LICENSE

GPLv3+

I decided to use GPL because it is really annoying for reproduction if researchers just publish some random pseudocode in a paper. This enforces further development on this library to be public.

Metadata

Release files for CoCluReMiG 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CoCluReMiG 0.1
File Size Uploaded
CoCluReMiG-0.1.tar.gz 35.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CoCluReMiG 0.1
File Interpreter ABI Platform
CoCluReMiG-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 77.4 kB

Release files / CoCluReMiG-0.1.tar.gz

Download URL CoCluReMiG-0.1.tar.gz
Size 35.4 kB
Tags Source
SHA-256 checksum
How to use checksums
68d42ee63e7a86e4453b93ba1ec7c5d38ad098ffb618b8aa32f3841d749cae3a
BLAKE2b-256 checksum
How to use checksums
dc190b6202ae1463ba70aba8d0b2e8cb24340fac77616638f067f120a26ab4ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

Release files / CoCluReMiG-0.1-py3-none-any.whl

Download URL CoCluReMiG-0.1-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c1e335ab55944e6dfc708ba837173a1dec172c02d0d8cdbdeed13abd38efae6
BLAKE2b-256 checksum
How to use checksums
6dc7616acc792444fdb577be4a13a068f387d622b034e9314e5fc4d8a4440e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page