Skip to main content

An awesome tool to write small texts on GitHub mosaic

Project description

codecov build PyPI version Python Versions License Documentation Status

awesome-git-mosaic

A simple tool to make cool tricks with your Github activity mosaic

image

Install

Just create a new repo on Github and install like any python lib

pip install awesome-git-mosaic

or

poetry add awesome-git-mosaic

Usage

It comes ready to be used out of the box with dafault settings or you can use its full functionalities by importing on code

Warning
It is recommended to create an empty repo for this purpose only. A lot of files will be created and so a lot of commits (which can be problematic to revert in a working repo). See Reseting.

Default

After installation, you can use with default parameter by running

python -m awesome_git_mosaic <your_text_here[A-Za-z0-9# ]+>

Note
With default params, each character have 5 squares wide plus 1 square of space between letters. So, only 8 characters will appear at time.

Importing on console (or anywhere)

from awesome_git_mosaic.usecases.write_mosaic import WriteMosaic

wm = WriteMosaic()

wm.write('numenor', 50, 2, True, False, True)

Method signature:

def write(
    self,
    message: str,  # what you want to write
    strength: int = 15,  # how many commits each pixel will have (more details in "How it works" section)
    multiply: int = 1,  # number of times to write the message consecutive like "MSGMSGMSG" (more details in "How it works" section)
    with_spaces: bool = True,  # put or not spaces between characters
    background: bool = False,  # put background or not
    inverted: bool = False,  # invert pixels or not
):

Examples

Default

image

Inverted

image

Strengh = 5

image

No spaces

image

Multiple times

image

How it works

Git allow us to set the date and time of a commit, so, we can do it in retrspective or even in the future.

By understanding how Github activity mosaic works, we can figure out wich time correlates to each pixel and translate a matrix of pixels in a list of datetimes. So, for each datetime a commit is made modifying or create an unique file.

Days with more contribution have a lighter green and the light intensity will be dynamic according to the day you have more contributions in the period of time showing in the mosaic. So, to have a good highlighted message, it is recommended to set strength at least as two times the number of max contributions you have in the period.

Each week the leftmost column will disappear. So to make the mosaic looks like a veeeery slow scrolling text, you can set multiply to more than 1.

Warning
Commits and pushes are made automatically by the code. It is HIGHLY RECOMMENDED to create a repo specially for this purpose.

Reseting

You can easily remove everything by deleting the repo where you made the commits.

About

After watch this video from @akshaymarch7 i´ve just had an ideia to play around with the pixels instead of just make it random.

So, why not draw or write something? A few days later and i had a working prototype. Now it is a lib for anyone who want to have fun or contribute with more ideas.

If you enjoyed enough, consider

buy me a coffee

Contributing

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

awesome_git_mosaic-0.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

awesome_git_mosaic-0.1.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file awesome_git_mosaic-0.1.1.tar.gz.

File metadata

  • Download URL: awesome_git_mosaic-0.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for awesome_git_mosaic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 731a50e49382f51c89539f081927875955b743028cd93ba6c02e10bd98b99528
MD5 ee799f843d305df44a04dbf6271e7f6c
BLAKE2b-256 22dcbf28fcacf5f584b2996e688e324f84d338feac99b8977becda995e856f61

See more details on using hashes here.

File details

Details for the file awesome_git_mosaic-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for awesome_git_mosaic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8689ca2ef975b5ca3cb38ce31482fd8ad0ee0b7a8ce70831f45680c0501c6bb
MD5 4e593447e64a6bde355925093d43582f
BLAKE2b-256 2aac5a8dcd1274c958eaa17b16901531c26c23e7f6418445c069f1ca53069636

See more details on using hashes here.

Supported by

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