Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Speed, distance and time calculations around quantities of digital information.

Project description

nibble
======

.. image:: https://img.shields.io/pypi/status/nibble.svg
:target: https://pypi.python.org/pypi/nibble
.. image:: https://img.shields.io/pypi/v/nibble.svg
:target: https://pypi.python.org/pypi/nibble
.. image:: https://img.shields.io/pypi/pyversions/nibble.svg
:target: https://pypi.python.org/pypi/nibble
.. image:: https://travis-ci.org/gebn/nibble.svg?branch=master
:target: https://travis-ci.org/gebn/nibble
.. image:: https://coveralls.io/repos/github/gebn/nibble/badge.svg?branch=master
:target: https://coveralls.io/github/gebn/nibble?branch=master
.. image:: https://landscape.io/github/gebn/nibble/master/landscape.svg?style=flat
:target: https://landscape.io/github/gebn/nibble/master

Speed, distance and time calculations around quantities of digital information. Coming soon.

Installation
------------

::

$ pip install nibble

Demo
----

.. code-block:: python

from nibble.information import Information
from nibble.duration import Duration
from nibble.speed import Speed


information = Information(1, Information.GIBIBYTES)
print('{0}'.format(information)) # '1 GiB'
print('{0:GB}'.format(information)) # '1.07GB'
print('{0: GB}'.format(information)) # '1.07 GB'
print('{0:,.2f| Mb}'.format(information)) # '8,589.93 Mb'

speed = Speed(Information(20, Information.MEGABITS), Duration.SECOND)
print('{0}'.format(speed)) # '2.38 MiB/s'
print('{0:Mb}'.format(speed)) # '20Mb/s'
print('{0: Gb/w}'.format(speed)) # '12,096 Gb/w'
print(Speed.TEN_GIGABIT / 10
== Speed.HUNDRED_MEGABIT * 10
== Speed.GIGABIT) # True
print('{0: dB/y}'.format(Speed.TEN_GIGABIT)) # '39.42 PB/y'
print('{0:.2f| bB/mo}'.format(Speed.GIGABIT)) # 298.77 TiB/mo


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nibble, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size nibble-0.1.0-py2.py3-none-any.whl (18.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size nibble-0.1.0.tar.gz (13.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page