AnimatedWordCloudTimelapse


NameAnimatedWordCloudTimelapse JSON
Version 1.0.9 PyPI version JSON
download
home_pagehttps://github.com/konbraphat51/AnimatedWordCloud/tree/main
SummaryAnimate a timelapse of word cloud
upload_time2024-05-02 06:08:54
maintainerNone
docs_urlNone
authorkonbraphat51, superhotdogcat
requires_python>=3.8
licenseMIT License
keywords nlp world cloud animation natural language processing video visualization data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AnimatedWordCloud ver 1.0.9

<a href="https://codeclimate.com/github/konbraphat51/AnimatedWordCloud/maintainability"><img src="https://api.codeclimate.com/v1/badges/7a03252f77e7af46dc0f/maintainability" /></a>
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/20a71da0d9d841a2af236f6362a08ae7)](https://app.codacy.com/gh/konbraphat51/AnimatedWordCloud/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![unit-test](https://github.com/konbraphat51/AnimatedWordCloud/actions/workflows/python-tester.yml/badge.svg?branch=main)](https://github.com/konbraphat51/AnimatedWordCloud/actions/workflows/python-tester.yml)[![codecov](https://codecov.io/gh/konbraphat51/AnimatedWordCloud/graph/badge.svg?token=4OOX0GSJDJ)](https://codecov.io/gh/konbraphat51/AnimatedWordCloud)

AnimatedWordCloud animates the timelapse of your words vector.

## Examples!

Using [Elon Musk's tweets](https://data.world/adamhelsinger/elon-musk-tweets-until-4-6-17).  
(C) Elon Musk

![output_elon](https://github.com/konbraphat51/AnimatedWordCloud/assets/101827492/89052c20-b228-42d8-921e-ebae9f7e30a0)

[Procedure Notebook](https://github.com/konbraphat51/AnimatedWordCloudExampleElon)

## 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](https://github.com/konbraphat51/AnimatedWordCloudExampleElon) for details

#### Using default configuration

```python
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

```python
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 name                   | type            | meaning                                                                                                                                                            |
| -------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| font_path                        | str             | Path to the font file.                                                                                                                                             |
| output_path                      | str             | Parh of the output directory                                                                                                                                       |
| max_words                        | int             | max number of the words in the screen                                                                                                                              |
| max_font_size                    | int             | Maximum font size of the word                                                                                                                                      |
| min_font_size                    | int             | Minimum font size of the word                                                                                                                                      |
| image_width                      | int             | Width of the image                                                                                                                                                 |
| image_height                     | int             | Height of the image                                                                                                                                                |
| background_color                 | str             | Background color. <br>This is based on [Pillow.Image.new()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.new)                            |
| color_map                        | str             | color map used for coloring words<br>This is based on [matplotlib colormap](https://matplotlib.org/stable/users/explain/colors/colormaps.html)                     |
| allocation_strategy              | str(literal)    | allocation algorithm method. This will change the allocation of the words in the output. <br> There is "magnetic" now.                                             |
| image_division                   | int             | precision of allocation calculation. Higher the preciser, but calculation slower                                                                                   |
| movement_reluctance              | float           | Reluctance of the movement of the word. If higher, the word tends to stay near to the previous position.                                                           |
| verbosity                        | str(literal)    | logging.<br>silent: nothing<br>minor: bars to know the progress<br>debug: all progress. noisy                                                                      |
| transition_symbol                | str             | written in the image                                                                                                                                               |
| starting_time_stamp              | str             | time stamp of the first frame (before the first time stamp in the input timelapse data)                                                                            |
| duration_per_interpolation_frame | int             | milliseconds per interpolation frame                                                                                                                               |
| duration_per_static_frame        | int             | milliseconds per staic (frame correspond to timestamp of wordvector) frame                                                                                         |
| n_frames_for_interpolation       | int             | how many frames will be generated for interpolation between each frames                                                                                            |
| interpolation_method             | str(literal)    | The method of making movement<br>There is "linear" now                                                                                                             |
| drawing_time_stamp               | bool            | Whether to draw time stamp on the image                                                                                                                            |
| time_stamp_color                 | str             | Color of the time stamp. This is based on [`Pillow ImageColor`](https://pillow.readthedocs.io/en/stable/reference/ImageColor.html#color-names)                     |
| time_stamp_font_size             | int             | Font size of the time stamp.<br>If None(default), it will be set to 75% of max_font_size                                                                           |
| time_stamp_position              | tuple[int, int] | Position of the time stamp.<br>If None(default), it will be set to (image_width*0.75, image_height*0.75) which is right bottom.                                    |
| intermediate_frames_id           | str             | Static images of each frame of itermediate product will be saved as "{intermediate*frames_id}*{frame_number}.png".<br>If None(default), this will be set randomly. |

## Want to contribute?

Look at [CONTRIBUTING.md](CONTRIBUTING.md) first.

### Maintainers

- [Konbraphat51](https://github.com/konbraphat51): Head Author  
  [![Konbraphat51 icon](https://github.com/konbraphat51.png)](https://github.com/konbraphat51)

- [SuperHotDogCat](https://github.com/SuperHotDogCat): Author  
  [![SuperHotDogCat](https://github.com/SuperHotDogCat.png)](https://github.com/SuperHotDogCat)

## Want to support?

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/konbraphat51/AnimatedWordCloud/tree/main",
    "name": "AnimatedWordCloudTimelapse",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "NLP, World Cloud, Animation, Natural Language Processing, video, Visualization, Data Science",
    "author": "konbraphat51, superhotdogcat",
    "author_email": "konbraphat51@gmail.com, siromisochan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/cc/6e3305a0d95256697cf355660716ef60c156aa7a932c1f53125dd7a91e4e/animatedwordcloudtimelapse-1.0.9.tar.gz",
    "platform": null,
    "description": "# AnimatedWordCloud ver 1.0.9\n\n<a href=\"https://codeclimate.com/github/konbraphat51/AnimatedWordCloud/maintainability\"><img src=\"https://api.codeclimate.com/v1/badges/7a03252f77e7af46dc0f/maintainability\" /></a>\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/20a71da0d9d841a2af236f6362a08ae7)](https://app.codacy.com/gh/konbraphat51/AnimatedWordCloud/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[![unit-test](https://github.com/konbraphat51/AnimatedWordCloud/actions/workflows/python-tester.yml/badge.svg?branch=main)](https://github.com/konbraphat51/AnimatedWordCloud/actions/workflows/python-tester.yml)[![codecov](https://codecov.io/gh/konbraphat51/AnimatedWordCloud/graph/badge.svg?token=4OOX0GSJDJ)](https://codecov.io/gh/konbraphat51/AnimatedWordCloud)\n\nAnimatedWordCloud animates the timelapse of your words vector.\n\n## Examples!\n\nUsing [Elon Musk's tweets](https://data.world/adamhelsinger/elon-musk-tweets-until-4-6-17).  \n(C) Elon Musk\n\n![output_elon](https://github.com/konbraphat51/AnimatedWordCloud/assets/101827492/89052c20-b228-42d8-921e-ebae9f7e30a0)\n\n[Procedure Notebook](https://github.com/konbraphat51/AnimatedWordCloudExampleElon)\n\n## How to use?\n\n### Requirements\n\nPython (3.8 <= version <= 3.12)\n\n### install\n\n**BE CAREFUL of the name**\n\n\u274cAnimatedWordCloud  \n\u2705AnimatedWordCloudTimelapse\n\n```\npip install AnimatedWordCloudTimelapse\n```\n\n### coding\n\nSee [Example Notebook](https://github.com/konbraphat51/AnimatedWordCloudExampleElon) for details\n\n#### Using default configuration\n\n```python\nfrom AnimatedWordCloud import animate\n\n# data must be list[(\"time name\", dict[str, float])]\ntimelapse_wordvector = [\n    (\n        \"time_0\",   #time stamp\n        {\n            \"hanshin\":0.334,    #word -> weight\n            \"chiba\":0.226\n        }\n    ),\n    (\n        \"time_1\",\n        {\n            \"hanshin\":0.874,\n            \"fujinami\":0.609\n        }\n    ),\n    (\n        \"time_2\",\n        {\n            \"fujinami\":0.9,\n            \"major\":0.4\n        }\n    )\n]\n\n# animate!\n# the animation gif path is in this variable!\npath = animate(timelapse_wordvector)\n```\n\n#### Editing configuration\n\n```python\nfrom AnimatedWordCloud import animate, Config\n\nconfig = Config(\n    what_you_want_to_edit = editing_value\n)\n\ntimelapse = # adding time lapse data\n\n#give the config to second parameter\nanimate(timelapse, config)\n```\n\n##### Parameters of `Config`\n\nAll has default value, so just edit what you need\n\n| parameter name                   | type            | meaning                                                                                                                                                            |\n| -------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| font_path                        | str             | Path to the font file.                                                                                                                                             |\n| output_path                      | str             | Parh of the output directory                                                                                                                                       |\n| max_words                        | int             | max number of the words in the screen                                                                                                                              |\n| max_font_size                    | int             | Maximum font size of the word                                                                                                                                      |\n| min_font_size                    | int             | Minimum font size of the word                                                                                                                                      |\n| image_width                      | int             | Width of the image                                                                                                                                                 |\n| image_height                     | int             | Height of the image                                                                                                                                                |\n| background_color                 | str             | Background color. <br>This is based on [Pillow.Image.new()](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.new)                            |\n| color_map                        | str             | color map used for coloring words<br>This is based on [matplotlib colormap](https://matplotlib.org/stable/users/explain/colors/colormaps.html)                     |\n| allocation_strategy              | str(literal)    | allocation algorithm method. This will change the allocation of the words in the output. <br> There is \"magnetic\" now.                                             |\n| image_division                   | int             | precision of allocation calculation. Higher the preciser, but calculation slower                                                                                   |\n| movement_reluctance              | float           | Reluctance of the movement of the word. If higher, the word tends to stay near to the previous position.                                                           |\n| verbosity                        | str(literal)    | logging.<br>silent: nothing<br>minor: bars to know the progress<br>debug: all progress. noisy                                                                      |\n| transition_symbol                | str             | written in the image                                                                                                                                               |\n| starting_time_stamp              | str             | time stamp of the first frame (before the first time stamp in the input timelapse data)                                                                            |\n| duration_per_interpolation_frame | int             | milliseconds per interpolation frame                                                                                                                               |\n| duration_per_static_frame        | int             | milliseconds per staic (frame correspond to timestamp of wordvector) frame                                                                                         |\n| n_frames_for_interpolation       | int             | how many frames will be generated for interpolation between each frames                                                                                            |\n| interpolation_method             | str(literal)    | The method of making movement<br>There is \"linear\" now                                                                                                             |\n| drawing_time_stamp               | bool            | Whether to draw time stamp on the image                                                                                                                            |\n| time_stamp_color                 | str             | Color of the time stamp. This is based on [`Pillow ImageColor`](https://pillow.readthedocs.io/en/stable/reference/ImageColor.html#color-names)                     |\n| time_stamp_font_size             | int             | Font size of the time stamp.<br>If None(default), it will be set to 75% of max_font_size                                                                           |\n| time_stamp_position              | tuple[int, int] | Position of the time stamp.<br>If None(default), it will be set to (image_width*0.75, image_height*0.75) which is right bottom.                                    |\n| intermediate_frames_id           | str             | Static images of each frame of itermediate product will be saved as \"{intermediate*frames_id}*{frame_number}.png\".<br>If None(default), this will be set randomly. |\n\n## Want to contribute?\n\nLook at [CONTRIBUTING.md](CONTRIBUTING.md) first.\n\n### Maintainers\n\n- [Konbraphat51](https://github.com/konbraphat51): Head Author  \n  [![Konbraphat51 icon](https://github.com/konbraphat51.png)](https://github.com/konbraphat51)\n\n- [SuperHotDogCat](https://github.com/SuperHotDogCat): Author  \n  [![SuperHotDogCat](https://github.com/SuperHotDogCat.png)](https://github.com/SuperHotDogCat)\n\n## Want to support?\n\n**\u2b50Give this project a star\u2b50**  \nThis is our first OSS project, \u2b50**star**\u2b50 would make us very happy\u2b50\u2b50\u2b50\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Animate a timelapse of word cloud",
    "version": "1.0.9",
    "project_urls": {
        "GitHub Repository": "https://github.com/konbraphat51/AnimatedWordCloud",
        "Homepage": "https://github.com/konbraphat51/AnimatedWordCloud/tree/main"
    },
    "split_keywords": [
        "nlp",
        " world cloud",
        " animation",
        " natural language processing",
        " video",
        " visualization",
        " data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3f687b679fec5d1073f60e0c4dc150e86d1d0d489e24301869ae6f0075f8699",
                "md5": "ceae6737d0970e96fca31fe781759655",
                "sha256": "f97b62a74f2216919b217da8af067aa5bf0d38e25ac9c6593682ac99e5761875"
            },
            "downloads": -1,
            "filename": "AnimatedWordCloudTimelapse-1.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ceae6737d0970e96fca31fe781759655",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 1026430,
            "upload_time": "2024-05-02T06:08:51",
            "upload_time_iso_8601": "2024-05-02T06:08:51.549218Z",
            "url": "https://files.pythonhosted.org/packages/b3/f6/87b679fec5d1073f60e0c4dc150e86d1d0d489e24301869ae6f0075f8699/AnimatedWordCloudTimelapse-1.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ecc6e3305a0d95256697cf355660716ef60c156aa7a932c1f53125dd7a91e4e",
                "md5": "ca2f692de3d577114c2e7ae6714665c2",
                "sha256": "3fb785573d7a78952894a4d9b4fdbe42aaa86c8e73288c8d83bf3145375c14aa"
            },
            "downloads": -1,
            "filename": "animatedwordcloudtimelapse-1.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "ca2f692de3d577114c2e7ae6714665c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1015668,
            "upload_time": "2024-05-02T06:08:54",
            "upload_time_iso_8601": "2024-05-02T06:08:54.042189Z",
            "url": "https://files.pythonhosted.org/packages/6e/cc/6e3305a0d95256697cf355660716ef60c156aa7a932c1f53125dd7a91e4e/animatedwordcloudtimelapse-1.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-02 06:08:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "konbraphat51",
    "github_project": "AnimatedWordCloud",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "animatedwordcloudtimelapse"
}
        
Elapsed time: 0.32513s