Skip to main content

Documentation Status Build Status Lint with Black Code Coverage

PyPI Version Python Versions License: MIT

Unibool

A python package for unidimensional boolean operations

Simple example

>>> from rbool import *
>>> interval = Interval(-10, 5)  # Create a closed interval
>>> interval
[-10, 5]
>>> interval | (3, 8)  # Unite with open interval
[-10, 8)
>>> ~interval  # Complementar of the interval
(-inf, 10) U (5, inf)
>>> interval |= {-2, 6, 10}  # Unite with single values
>>> interval
[-10, 5] U {6, 10}
>>> interval - {2, 3}  # Remove single values from interval
[-10, 2) U (2, 3) U (3, 5] U {6, 10}
>>> [-8, 3] in interval  # Checks if [-8, 3] is inside the interval
True

The usual operations happens between two subsets:

  • A | B: union
  • A & B: intersection
  • ~A: complementar
  • A ^ B: XOR
  • A - B: subtract
  • A in B: is subset ?

Useful functions

>>> minimum("[-3, 10]")  # Gets the minimum value from subset
-3
>>> minimum("(-3, 10]")  # Returns None, there's no minimum
>>> infimum("(-3, 10]")  # Gets the infimum value from subset
-3
>>> maximum("(-3, 10]")  # Gets the maximum value
10
>>> supremum("(-3, 10]")
10
>>> lower(5)  # All values on real line less than 5
(-inf, 5]
>>> {-15, 0} in lower(5)  # -15 and 0 are inside (-inf, 5] ?
True
>>> [-3, 6] in bigger(5)  # interval [-3, 6] is inside [5, inf) ?
False
>>> scale("[-3, 10) U {15}", 2)  # Maps each value 'x' to '2*x'
[-6, 20) U {30}
>>> move("[-3, 10) U {15}", -8)  # Maps each value 'x' to 'x - 8'
[-8, 2) U {7}

Installation:

This library is available in PyPI. To install it

$ pip install rbool

For more details, refer to the documentation

Documentation

The documentation can be found at rbool.readthedocs.io

Contribute

Please use the Issues or refer to the email compmecgit@gmail.com

Metadata

Release files for rbool 0.0.4

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

Source distribution (sdist)

Source distribution for rbool 0.0.4
File Size Uploaded Provenance Actions
rbool-0.0.4.tar.gz 12.9 kB With provenance Details for rbool-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 28.2 kB

Release files / rbool-0.0.4.tar.gz

Download URL rbool-0.0.4.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bcd11ddc82371c9f5794576a035302fe88568b2bdec48dc5cc1007b586453a44
BLAKE2b-256 checksum
How to use checksums
a5a1304e7409a78ecf45783a9bf5582fef87bddfea8b3b92d05e09079ec1daca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2025.

Transparency log

Release files / rbool-0.0.4-py3-none-any.whl

Download URL rbool-0.0.4-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
506bad6f1e75450286ad2fa68ce201bef577a1d960b2c115be7567c6f05151aa
BLAKE2b-256 checksum
How to use checksums
972746b1a4c4ac836f1ef93960f0eeee9bd797229cafd8b13278a6a65ed6c954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2025.

Transparency log

Security for rbool 0.0.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rbool-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2025.

Transparency log

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