Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lericson/fish
The Python module that swims
https://github.com/lericson/fish
Last synced: 3 months ago
JSON representation
The Python module that swims
- Host: GitHub
- URL: https://github.com/lericson/fish
- Owner: lericson
- License: bsd-3-clause
- Created: 2010-05-07T13:53:12.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T10:59:37.000Z (about 2 years ago)
- Last Synced: 2024-07-15T15:42:02.125Z (5 months ago)
- Language: Python
- Homepage: http://sendapatch.se/
- Size: 20.5 KB
- Stars: 66
- Watchers: 7
- Forks: 24
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Ever wanted to have animating fishes for progress bars in your command-line
script?Ever thought about doing it but then realizing you have better things to do
with your time than to write meaningless ASCII animation programs?Now you can have the best of both worlds: introducing ``fish``, the module that
makes any program look awesome and display useful data while churning away on
some good 'ole data.Usage? Simple enough:
```python
>>> import fish
>>> while churning:
... churn_churn()
... fish.animate()
```
As a boy, I often dreamed of birds going back and forth as progress bars, so I
decided to implement just that:
```python
>>> import fish
>>> bird = fish.Bird()
>>> while churning:
... churn_churn()
... bird.animate()
```Want to show the current record number?
```python
>>> from fish import ProgressFish
>>> fish = ProgressFish()
>>> for i, x in enumerate(churning):
... churn_churn()
... fish.animate(amount=i)
```Want to show numeric progress when you know the total number?:
```python
>>> from fish import ProgressFish
>>> fish = ProgressFish(total=len(data))
>>> for i, datum in enumerate(data):
... churn_churn()
... fish.animate(amount=i)
```[See a demo on YouTube](http://www.youtube.com/watch?v=xYeG5CVTCmk).
The default fish is a simple bass at a pretty good velocity for an ASCII fish.
Possibilities are endless here, gentlemen:
>The only limit is yourself.
>-- zombo.com
[Fork on GitHub](http://github.com/lericson/fish)