Skip to main content

Yet Another Sparkline (yasl)

Actions Status GitHub PyPI - Python Version PyPI

Why? Well, it is actually really easy to do this and I wanted some different controls that the other programs didn't have. Also, I like the MIT license.

Usage

You can run it from the command line:

  kevin@dalek psl $ sparkbar.py  1 2 3E+0 4
   ▂▅█
  kevin@dalek psl $ sparkbar.py -z 1 2 3E+0 4
   ▎▋█
  kevin@dalek psl $ sparkbar.py 1 2 3 4 3 2 1 0 3 5
  ▁▃▄▆▄▃▁ ▄█

Or call it from a python program:

  #!/usr/bin/env python

  from math import sin, pi
  from yasl import Spark

  if __name__ == "__main__":
      sp = Spark()
      data = [0,3,6,8.5,7,5,2,8,-8,1]

      print(u'max: {:.2f} min: {:.2f} [{}]'.format(max(data),min(data),sp.vbar(data)))

      data = []
      for i in range(36):
          data.append((sin(4*pi*i/36)))

      print(u'max: {:.2f} min: {:.2f} [{}]'.format(max(data),min(data),sp.hbar(data)))

      sp.dump()
  kevin@dalek psl $ python3 example.py
  max: 8.50 min: -8.00 [▃▅▆█▇▆▄▇ ]
  max: 0.98 min: -0.98 [▌▋▊▉██▉▊▋▌▎▏    ▏▎▍▋▊▉▉█▉▊▋▌▎▏    ▏▎]

MIT License

Copyright (c) 2017 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release files for yasl 1.0.3

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

Source distribution (sdist)

Source distribution for yasl 1.0.3
File Size Uploaded
yasl-1.0.3.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 9.5 kB

Release files / yasl-1.0.3.tar.gz

Download URL yasl-1.0.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dd475a40f77823598ee6ac87c224edd5f6a371e97e92eda54ff1ff1288fffab3
BLAKE2b-256 checksum
How to use checksums
5e3a015af84ba6a58131cc35c7f85a587e3971ff6f484851ae81d7ca33580b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.2 CPython/3.8.5 Linux/5.4.0-62-generic

Release files / yasl-1.0.3-py3-none-any.whl

Download URL yasl-1.0.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b06a7d180944bbd235d1d89242df37e55023ac62cc785d53c312dbc9a23c4395
BLAKE2b-256 checksum
How to use checksums
831ab6f92af7deddbb59bcd841a268b19a3ad4fa240cf42f2f1205f2afecbafe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.2 CPython/3.8.5 Linux/5.4.0-62-generic

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

3 release files

1.0.0

3 release files

0.0.1

3 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