gitlas.core Module
This is the core module responsible for the inner workings of the gitlas package. gitlas does not have any external dependencies.
Modules Imported
gitlas makes use of python standard library and imports the following three libraries
imports from python standard library
- json : For JSON export capabilities.
- re : For matching re patterns in the log files.
- datetime : For Conversion of date/time data.
Class Descriptions in gitlas.core
module
1. Class gitlas.core.Commit
:
The gitlas.core.Commit
class is basically a barebones class which is used internally for storing properties of a single git commit which makes it easier to access and manage commit data.
Base Methods in gitlas.core.Commit
Method name | |
---|---|
1. | Constructor (__init__ ) method |
2. | setattr (__setattr__ ) method |
3. | getattr (__getattr__ ) method |
4. | delattr (__delattr__ ) method |
Properties stored in gitlas.core.Commit
Property Name | DataType | |
---|---|---|
1. | author | [str] |
2. | authorEmail | [str] |
3. | comment | [str] |
4. | time | [str] |
5. | date | [str] |
6. | day | [str] |
7. | year | [str] |
8. | month | [str] |
9. | timezone | [str] |
10. | hashid | [str] |
11. | isMerger | [Boolean] |
More Properties can be added or changed on calling setattr()
method
All Properties except isMerger are stored as strings (The date time objects are converted from string later when they are required .)
2. Class gitlas.core.Log
:
gitlas.core.Log
is the main class where the logfile is filtered ,Seperated as indivisual commits and stored as Commit objects. There are some utility statistics methods available as well.
Base Methods in gitlas.core.Log
Method name | |
---|---|
1. | Constructor (__init__ ) method |
2. | setattr (__setattr__ ) method |
3. | getattr (__getattr__ ) method |
4. | delattr (__delattr__ ) method |
5. | string (__str__ ) method |
6. | representation (__repr_ ) method |
StatInfo Methods in gitlas.core.Log
Method name | |
---|---|
1. | mergeCounts() |
2. | commitCounts() |
3. | specificWeekDayStats() |
4. | activeDevelopmentDuration() |
5. | singleMonthStats() |
6. | yearStats() |
7. | authorStats() |
Properties stored in gitlas.core.Log
Property Name | DataType | |
---|---|---|
1. | commits | [list] |
2. | filename | [str] |
3. | type | [str] |
using commit as first word in a comment message
The Bug originates from the fact that re matches the word 'commit' and then stores the hash value associated to it however if the comment message also has commit word as first word gtilas may fail to recognize the commit and may cause trouble.
Functions in gitlas.core
module
These are some functions available for working with git Log data and many of them are used internally within the package.
Functions Available in gitlas.core
Function Name | Description | |
---|---|---|
1. | monthNumberSwap | Generates the month number based on the shorhand name of the month. |
2. | datetimeConvertor | Converts raw date/time data into an object of datetime class. |
3. | joinString | This method joins a list of strings to a input string.returns a string object. |
4. | JSONEncoder | Encodes Log/CommitObject Data into the JSON format. However do note that only Commit/Log objects are supported. |
5. | JSONExport | Exports the Object data as an JSON file to save the object permanantely. |
6. | analyzeDataOverall | Analyzes all data in different Parameters. |