Plots programming language usage over time in a git repository to an SVG file.
Project description
git-repo-language-trends
Plots programming language usage over time in a git repository to an SVG file.
Available output file formats are:
.svg
- Scalable Vector Graphics.png
- Portable Graphics Format (coming soon).csv
- Comma-separated values (coming soon).tsv
- Tab-separated values (coming soon)
Example command and its SVG output:
% cd ~/src/cpython
% git-repo-language-trends --max-commits 30 --min-interval-days 365 .c+.h .py
Installation
Installation requires pip>=19.0
. When in doubt, begin by upgrading pip
:
python3 -m pip install --upgrade pip
Then simply do
python3 -m pip install git-repo-language-trends
Usage
First go to the git repository for a project.
% cd ~/src/your-project
Then run the tool, passing the file extensions for the languages you are interested in as positional arguments:
% git-repo-language-trends .java .kt
For language with multiple file extensions such as C, you can use the +
syntax
which will automatically summarize line counts from both file extensions. To
compare C and Rust:
% git-repo-language-trends .c+.h .rs
Method
Programming langauge usage is determined by the total number of newlines in files with a given file extension.
More examples
TODO
Performance
This program is pretty fast, because it uses the pygit2 wrapper for the C library libgit2. On a low-end computer (with an Intel(R) Celeron(R) J4005 CPU @ 2.00GHz) it counts ~400 000 lines per second.
TODO
- port integration tests
- Print output file path
- Support tsv and csv
- Use top 3 extension when invoked without arguments
- Add --list
- --version output with git hash
- handle shallow clones
- png output
- limit size of cache
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
Built Distribution
File details
Details for the file git-repo-language-trends-0.0.2.tar.gz
.
File metadata
- Download URL: git-repo-language-trends-0.0.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb36a98f1d3094d2c45b7d0fbd5734ad355cff0b2cb6efd2d40ae89383f905d |
|
MD5 | 45fa2a3934bd473450ae6b4d71a852d7 |
|
BLAKE2b-256 | 9d8490b2a3aa1c3903fad40ea0d3ff4bc2383d7fc2eb3a6400ba28fd30dede83 |
File details
Details for the file git_repo_language_trends-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: git_repo_language_trends-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e60356cca22a2ebd0b018004f3324b37c05dca38f2db8bc8529ed9eca17011d |
|
MD5 | 33633971177699a61bb137e72f169892 |
|
BLAKE2b-256 | fc6bf15ffea3f12bb30966dec5459ea74661d46b3aeeba0602b0d51161d74414 |