Skip to main content

nummu (南無)

An animated image maker.

NOTE: this project in WIP and thus interface might change a lot. Be cautious when using in production.

Image Script
helloworld examples/helloworld.py
line examples/line.py
rect examples/rect.py
bubblesort Bubble Sort
heapsort Heap Sort
insertionsort Insertion Sort
mergesort Merge Sort
quicksort Quick Sort
selectionsort Selection Sort
examples/sort.py
image examples/image.py
text examples/text.py

Install

$ pip install nummu

Usage

Nummu is simply a framework so you might want to implement a class having these methods: update(delta), draw(palette). None of them are absolutely required.

class HelloWorld:

    def __init__(self):
        # Do initial work here
        self.position = 0

    def update(self, delta):
        # Do some calculation before draw each frame.
        # The delta is in millisecond unit.
        #
        # Don't forget to raise StopIteration somewhere!
        #
        self.position += delta
        if self.position >= 100:
            raise StopIteration

    def draw(self, pallete):
        # Pallete is simply a numpy.zeros instance.
        # Overwrite any pixels as you want.
        #
        pallete[:, self.position, :] = 255

Basic usage:

# import nummu
from nummu import Nummu

# set file size
nm = Nummu(100, 100)

# add drawer defined previously
nm.add(HelloWorld())

# export to gif
nm.export('helloworld.gif', delay=5)

Check the examples in project repo, and hopefully it might help you!

Develop

$ poetry develop
$ poetry run python examples/helloworld.py

Test

Currently nummu support running on 3.6, 3.7

$ pyenv install 3.6.5
$ pyenv install 3.7.0b2
$ pyenv local 3.6.5 3.7.0b2
$ export PATH=$(pyenv root)/shims:$PATH
$ tox
py36 runtests: commands[0] | poetry develop
py36 runtests: commands[0] | poetry run pytest
py37 runtests: commands[0] | poetry develop
py37 runtests: commands[0] | poetry run pytest
  py36: commands succeeded
  py37: commands succeeded
  congratulations :)

Credit

Thanks Pillow, numpy, numpngw and array2gif! Nummu stands on the shoulder of these giants!

Metadata

Release files for nummu 0.1.9

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

Source distribution (sdist)

Source distribution for nummu 0.1.9
File Size Uploaded
nummu-0.1.9.tar.gz 4.4 kB Details

Built distribution (wheel)

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

Total release size: 11.8 kB

Release files / nummu-0.1.9.tar.gz

Download URL nummu-0.1.9.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
72faf992596a23dda6f32fefd901fe7464e13dfbf3a7bce0eb31ceb98ed774f0
BLAKE2b-256 checksum
How to use checksums
d0e5ca0ab0a294309da55d7548f7c902e4ee786cfb9f2902634b2deb97a4d57f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / nummu-0.1.9-py3-none-any.whl

Download URL nummu-0.1.9-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ffcc6da85b2ade879d945c401f3410f5c167cdffc82ea90b67f78568ca4d94f
BLAKE2b-256 checksum
How to use checksums
0b90fdfa5adc9121de0c67f0aff156ebbaf65395ee74d0cffe2f3c1a2d890fa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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