Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

AnimatedWordCloudTimelapse

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

AnimatedWordCloudTimelapse

Animate a timelapse of word cloud

  • 1.0.9
  • PyPI
  • Socket score

Maintainers
2

AnimatedWordCloud ver 1.0.9

Codacy Badge unit-testcodecov

AnimatedWordCloud animates the timelapse of your words vector.

Examples!

Using Elon Musk's tweets.
(C) Elon Musk

output_elon

Procedure Notebook

How to use?

Requirements

Python (3.8 <= version <= 3.12)

install

BE CAREFUL of the name

❌AnimatedWordCloud
✅AnimatedWordCloudTimelapse

pip install AnimatedWordCloudTimelapse

coding

See Example Notebook for details

Using default configuration
from AnimatedWordCloud import animate

# data must be list[("time name", dict[str, float])]
timelapse_wordvector = [
    (
        "time_0",   #time stamp
        {
            "hanshin":0.334,    #word -> weight
            "chiba":0.226
        }
    ),
    (
        "time_1",
        {
            "hanshin":0.874,
            "fujinami":0.609
        }
    ),
    (
        "time_2",
        {
            "fujinami":0.9,
            "major":0.4
        }
    )
]

# animate!
# the animation gif path is in this variable!
path = animate(timelapse_wordvector)
Editing configuration
from AnimatedWordCloud import animate, Config

config = Config(
    what_you_want_to_edit = editing_value
)

timelapse = # adding time lapse data

#give the config to second parameter
animate(timelapse, config)
Parameters of Config

All has default value, so just edit what you need

parameter nametypemeaning
font_pathstrPath to the font file.
output_pathstrParh of the output directory
max_wordsintmax number of the words in the screen
max_font_sizeintMaximum font size of the word
min_font_sizeintMinimum font size of the word
image_widthintWidth of the image
image_heightintHeight of the image
background_colorstrBackground color.
This is based on Pillow.Image.new()
color_mapstrcolor map used for coloring words
This is based on matplotlib colormap
allocation_strategystr(literal)allocation algorithm method. This will change the allocation of the words in the output.
There is "magnetic" now.
image_divisionintprecision of allocation calculation. Higher the preciser, but calculation slower
movement_reluctancefloatReluctance of the movement of the word. If higher, the word tends to stay near to the previous position.
verbositystr(literal)logging.
silent: nothing
minor: bars to know the progress
debug: all progress. noisy
transition_symbolstrwritten in the image
starting_time_stampstrtime stamp of the first frame (before the first time stamp in the input timelapse data)
duration_per_interpolation_frameintmilliseconds per interpolation frame
duration_per_static_frameintmilliseconds per staic (frame correspond to timestamp of wordvector) frame
n_frames_for_interpolationinthow many frames will be generated for interpolation between each frames
interpolation_methodstr(literal)The method of making movement
There is "linear" now
drawing_time_stampboolWhether to draw time stamp on the image
time_stamp_colorstrColor of the time stamp. This is based on Pillow ImageColor
time_stamp_font_sizeintFont size of the time stamp.
If None(default), it will be set to 75% of max_font_size
time_stamp_positiontuple[int, int]Position of the time stamp.
If None(default), it will be set to (image_width0.75, image_height0.75) which is right bottom.
intermediate_frames_idstrStatic images of each frame of itermediate product will be saved as "{intermediateframes_id}{frame_number}.png".
If None(default), this will be set randomly.

Want to contribute?

Look at CONTRIBUTING.md first.

Maintainers

Want to support?

⭐Give this project a star⭐
This is our first OSS project, ⭐star⭐ would make us very happy⭐⭐⭐

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc