Skip to main content

Almost

A helper for approximate comparison.

from almost import almost

def test_repeating_decimal():
    assert almost(1 / 3.) == 0.333
    assert almost(1 / 6.) == 0.167
    assert almost(3227 / 555., precision=6) == 5.814414

def test_irrational_number():
    import math
    assert almost(math.pi) == 3.142
    assert almost(math.sqrt(2)) == 1.414

def test_random_text():
    import random
    def gen_text_with_prefix(prefix):
        return prefix + str(random.random())[:-5]
    assert almost(gen_text_with_prefix('@')) == '@...'

Metadata

Release files for almost 0.1.5

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

Source distribution (sdist)

Source distribution for almost 0.1.5
File Size Uploaded Provenance
almost-0.1.5.tar.gz 3.2 kB Without provenance Details

Release files / almost-0.1.5.tar.gz

Download URL almost-0.1.5.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e192af9fb078b0276d001bfb52958511aef703a716e5b63678535a59ad560f5b
BLAKE2b-256 checksum
How to use checksums
3f8dc7ea8c685703a2f9c1ea4e7bae2826546322f1dfb0a798963e1672702dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for almost 0.1.5

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