Skip to main content

SciNot

This package expresses numbers in scientific notation, in formatted strings. Its intended use is to make computational results easier to read, especially when using a REPL like IPython. If using IPython, output is color-coded, to visually diferentiate the base and power.

Installation:

pip install scinot

Python 2 is unsupported, due to unicode handling.

Use: Run scinot.start() to format REPL output and printing as scientific notation.

341283875012.238

>> 341283875012.238

import scinot

scinot.start()
341283875012.238

>> 3.413 x 10 11

Call scinot.end() to return to remove parsing:

scinot.end()

341283875012.238

>> 341283875012.238

You can specify the number of significant figures to display with start, and how long the number must be to invoke scientific notation. It defaults to 4 significant figures, and order-of-magnitude 4:

scinot.start(sigfigs=2, thresh=3)
15

>> 15

152

>> 1.5 x 10 2

Call scinot.format() to return a string in scientific notation:

scinot.format(341283875012.238)

>> ‘3.413 x 10 11’

You can also specify the number of significant figures to display; it defaults to 3.

scinot.format(-.00000409348, 2)

>> ‘-4.1 x 10 -6’

Call scinot.sciprint() instead of scinot.format() to print the result directly, rather than returning a string. format and sciprint both take two arguments: The number, and optionally, the amount of significant figures.

If you’re running Python in a Windows terminal and see squares instead of exponents, try a different font, like Source Code Pro. Scinot’s start() behavior will not work if sympy.init_printing() is activated.

I’ve built this module with my own use-case in mind, and have likely overlooked features that would extend and improve functionality. If you have an idea, please contact me, or submit a pull request.

Note: Color, and the proper times symbol are used in the package, but are not displayed in this readme due to RST limitations.

Metadata

Release files for scinot 0.0.11

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

Source distribution (sdist)

Source distribution for scinot 0.0.11
File Size Uploaded Provenance Actions
scinot-0.0.11.tar.gz 4.4 kB Without provenance Details for scinot-0.0.11.tar.gz

Built distribution (wheel)

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

Total release size: 9.3 kB

Release files / scinot-0.0.11.tar.gz

Download URL scinot-0.0.11.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bbf4879d34e33c5084253d6da7070e67fe3b75730e8f1c2c28f8762c5ebcfea1
BLAKE2b-256 checksum
How to use checksums
5ba128228760d16c2e0e72163bcee45334fd0a12b3f466bcf7dc0503b766fd6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.1

Release files / scinot-0.0.11-py3-none-any.whl

Download URL scinot-0.0.11-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efcf66b1c980b2a8c92ddbe92e7184bedcb8917343261b183920afff33d317a2
BLAKE2b-256 checksum
How to use checksums
d7478ee225b929abf6ea38eb69b94c8229f8ef9bb6287bfd5867b250f4f93573
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.1

Security for scinot 0.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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