Skip to main content

Build Status

Overview

Rangeset is a package that allows for easy manipulation of sets of ranges. These ranges can contain any ordered elements, be they numbers, tuples, or even datetime objects.

Installation

Use either:

python setup.py install

or:

pip install rangeset

Documentation

See https://github.com/axiak/py-rangeset

Basic Usage

import rangeset

# Create a rangeset
>>> r = RangeSet(1, 3) | (5, 6)

# negate
>>> (~r) & (0, 10)
<RangeSet 0 -- 1, 3 -- 5, 6 -- 10>

# "measure" - How much distance is in the ranges, minus the gaps
>>> ((~r) & (0, 10)).measure()
7

# range - Total distance between start and end
>>> ((~r) & (0, 10)).range()
10

For more usage examples, see the doctests at https://github.com/axiak/py-rangeset/tree/master/python2/rangeset/test

License

It’s licensed under the MIT License. Please see the license file for more: https://github.com/axiak/py-rangeset/blob/master/LICENSE

Download files

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

Source Distribution

rangeset-0.0.15.tar.gz (100.3 kB view details)

Uploaded Source

File details

Details for the file rangeset-0.0.15.tar.gz.

File metadata

  • Download URL: rangeset-0.0.15.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for rangeset-0.0.15.tar.gz
Algorithm Hash digest
SHA256 0fd4cba706466d77dbb959f94718586571f4bfab34dd146ec4fe1b7ce115e76d
MD5 66938e601c08ca49edc1d20b95a50c8d
BLAKE2b-256 248814bb35077d145b4142bc77f94965dffeae12a3f1c755bb173ad90be45241

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.15 This release

1 file

0.0.14

1 file

0.0.13

1 file

0.0.12

1 file

0.0.11

1 file

0.0.10

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

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