{"id":15495942,"url":"https://github.com/omenapps/django-segments","last_synced_at":"2026-01-24T23:32:31.592Z","repository":{"id":241199548,"uuid":"804154554","full_name":"OmenApps/django-segments","owner":"OmenApps","description":"A django package for segments (aka: ranges or intervals)","archived":false,"fork":false,"pushed_at":"2024-08-13T00:00:00.000Z","size":478,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T07:39:35.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmenApps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T04:03:23.000Z","updated_at":"2024-10-21T21:25:03.000Z","dependencies_parsed_at":"2024-12-20T06:40:35.650Z","dependency_job_id":"85194100-af85-4812-8b44-c931e6d13fb7","html_url":"https://github.com/OmenApps/django-segments","commit_stats":null,"previous_names":["omenapps/django-segments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OmenApps/django-segments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-segments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-segments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-segments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-segments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmenApps","download_url":"https://codeload.github.com/OmenApps/django-segments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-segments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28738998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:20:41.768Z","updated_at":"2026-01-24T23:32:31.570Z","avatar_url":"https://github.com/OmenApps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-segments\n\n[![PyPI](https://img.shields.io/pypi/v/django-segments.svg)][pypi status]\n[![Status](https://img.shields.io/pypi/status/django-segments.svg)][pypi status]\n[![Python Version](https://img.shields.io/pypi/pyversions/django-segments)][pypi status]\n[![License](https://img.shields.io/pypi/l/django-segments)][license]\n\n[![Read the documentation at https://django-segments.readthedocs.io/](https://img.shields.io/readthedocs/django-segments/latest.svg?label=Read%20the%20Docs)][read the docs]\n[![Tests](https://github.com/OmenApps/django-segments/actions/workflows/tests.yml/badge.svg)][tests]\n[![Codecov](https://codecov.io/gh/OmenApps/django-segments/branch/main/graph/badge.svg)][codecov]\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)][pre-commit]\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]\n\n[pypi status]: https://pypi.org/project/django-segments/\n[read the docs]: https://django-segments.readthedocs.io/\n[tests]: https://github.com/OmenApps/django-segments/actions?workflow=Tests\n[codecov]: https://app.codecov.io/gh/OmenApps/django-segments\n[pre-commit]: https://github.com/pre-commit/pre-commit\n[black]: https://github.com/psf/black\n\n## Overview\n\n_Django Segments_ is a Django app that provides a way to create nested ranges of ranges. In this package we provide abstract models for `Spans`, which contain a set of `Segments`. Elsewhere, this concept is sometimes refered to as a \"range list\" or \"range set\".\n\n*Note: Postgres has a [multirange](https://www.postgresql.org/docs/current/rangetypes.html) type, but there is no way to treat the ranges within a multirange as objects in their own right. This package provides a way to do that.*\n\nThe `Span` model is essentially a wrapper around a range field, and each `Span` contains one or more non-overlapping `Segment` model instances (which are also wrappers around range fields). The `Span` model is used to represent an entire range, and the `Segment` model instances each represent a non-overlapping portion of that range.\n\nThere are other ways to accomplish these general goals, but this package provides a more structured way to work with ranges of ranges, and a number of helper methods that make it easier to create, manipulate, and view Spans and Segments.\n\n## Use Cases\n\nThis package is particularly useful for resourse scheduling and allocation, and can be used for a variety of other tasks.\n\n### Resource Scheduling and Allocation\n\n*This example is how the package will be used in a production application.*\n\nImagine you are building a system that allows an Irrigation District's water users to request water deliveries. You could use a `Span` to represent the period of time that a user has requested water, and `Segments` to represent the portions of that time that the user has actually received water, with a new segment created each time the volumetric flow rate changes.\n\n### Work Order Tracking\n\nImagine you are building a system that tracks work orders for a manufacturing plant or trouble tickets for a helpdesk. You could use a `Span` to represent the span of time for each work order or ticket, and `Segments` to represent the portions of time the work order or ticket was spent in a particular state (e.g.: \"In Progress\", \"On Hold\", \"Completed\").\n\n### Log File Analysis\n\nImagine you are building a system that analyzes log files. You could use a `Span` to represent each log file, and `Segments` to represent the portions of the log file that contain specific types of events.\n\n### Conference Scheduling\n\nImagine you are building the schedule for a conference that runs from 8 am to 5 pm each day. You have a set of rooms, each of which can be scheduled for a specific time period. You could use a `Span` to represent the entire day for each room, and `Segments` to represent the time periods that each room is scheduled. The tools provided by this package would allow you to easily create, update (insert, delete, split, merge), and query the schedule for each room.\n\n## Features\n\n- Abstract models for building Spans and associated Segments\n- Helper classes that can be used with multiple model variants (e.g.: two different models inheriting Span could use the same helper classes, use helper classes with overridden methods, or mix and match) and to aid in implementing forms and views.\n- Extensive Tests\n- Documentation\n- Custom Django signals that allow the user to perform actions before and after each Operation is performed on a Span or Segment\n\n## Requirements\n\n- TODO\n\n## Installation\n\nYou can install _django-segments_ via [pip] from [PyPI]:\n\n```console\n$ pip install django_segments\n```\n\n## Usage\n\nPlease see the [Usage Section] for details.\n\n## Contributing\n\nContributions are very welcome.\nTo learn more, see the [Contributor Guide].\n\n## License\n\nDistributed under the terms of the [MIT license][license],\n_django-segments_ is free and open source software.\n\n## Issues\n\nIf you encounter any problems,\nplease [file an issue] along with a detailed description.\n\n## Credits\n\nThis project was generated from [@OmenApps]'s [Cookiecutter Django Package] template.\n\n[@omenapps]: https://github.com/OmenApps\n[pypi]: https://pypi.org/\n[cookiecutter django package]: https://github.com/OmenApps/cookiecutter-django-package\n[file an issue]: https://github.com/OmenApps/django-segments/issues\n[pip]: https://pip.pypa.io/\n\n\u003c!-- github-only --\u003e\n\n[license]: https://github.com/OmenApps/django-segments/blob/main/LICENSE\n[contributor guide]: https://github.com/OmenApps/django-segments/blob/main/CONTRIBUTING.md\n[usage section]: https://django-segments.readthedocs.io/en/latest/usage.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-segments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomenapps%2Fdjango-segments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-segments/lists"}