{"id":21314455,"url":"https://github.com/polyconseil/metaset","last_synced_at":"2026-05-07T08:31:56.188Z","repository":{"id":49185724,"uuid":"69442411","full_name":"Polyconseil/metaset","owner":"Polyconseil","description":"metaset","archived":false,"fork":false,"pushed_at":"2024-01-11T08:22:49.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-02-22T19:20:25.819Z","etag":null,"topics":["django","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Polyconseil.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-09-28T08:27:48.000Z","updated_at":"2024-02-06T15:12:53.000Z","dependencies_parsed_at":"2024-01-02T18:25:32.050Z","dependency_job_id":null,"html_url":"https://github.com/Polyconseil/metaset","commit_stats":{"total_commits":67,"total_committers":7,"mean_commits":9.571428571428571,"dds":0.4925373134328358,"last_synced_commit":"4d745c8b32556dfcb894370aa03640725368b8cc"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fmetaset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fmetaset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fmetaset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Polyconseil%2Fmetaset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Polyconseil","download_url":"https://codeload.github.com/Polyconseil/metaset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790999,"owners_count":20348385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["django","postgresql"],"created_at":"2024-11-21T18:13:05.715Z","updated_at":"2026-05-07T08:31:56.148Z","avatar_url":"https://github.com/Polyconseil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"metaset\n=======\n\nThis package provides a collection that is basically a \"dict of sets\", named MetaSet.\n\n.. image:: https://travis-ci.org/Polyconseil/metaset.svg?branch=master\n    :alt: Build status\n\n.. image:: https://img.shields.io/pypi/pyversions/metaset.svg\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/wheel/metaset.svg\n    :alt: Wheel status\n\n.. image:: https://img.shields.io/pypi/l/metaset.svg\n    :alt: License\n\nLinks\n-----\n\n- Package on `PyPI`_: http://pypi.python.org/pypi/metaset/\n- Source on `GitHub \u003chttp://github.com/\u003e`_: http://github.com/Polyconseil/metaset/\n- Build on `Travis CI \u003chttp://travis-ci.org/\u003e`_: http://travis-ci.org/polyconseil/metaset/\n\nQuickstart\n----------\n\nInstall the package from PyPI_, using pip:\n\n.. _PyPI: http://pypi.python.org/pypi/metaset/\n\n.. code-block:: sh\n\n    pip install metaset\n\n\nOr from GitHub:\n\n.. code-block:: sh\n\n    git clone git://github.com/Polyconseil/metaset.git\n\nImport it in your code:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from metaset import MetaSet\n\nUsage is quite straight forward,\nbasic set operations are supported via the binary operators ``+`` ``-`` ``|`` ``^``.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from pprint import pprint\n    \u003e\u003e\u003e pprint(MetaSet(a={1, 2}, b={3}) | MetaSet(b={4}, c={5}))\n    {'a': {1, 2}, 'b': {3, 4}, 'c': {5}}\n\nDjango Postgres\n---------------\n\nA custom Django field is available.\nIt is quite straightforward:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from metaset.django_field import MetaSetField\n    \u003e\u003e\u003e from django.db import models        # doctest: +SKIP\n\n    \u003e\u003e\u003e class MyModel(models.Model):        # doctest: +SKIP\n            mset = MetaSetField()           # doctest: +SKIP\n\nThe following versions of Python and Django are supported:\n\n- Python 3.8, 3.9, 3.10, 3.11 and 3.12;\n- Django 3.2, 4.2 and 5.0.\n\n\nDetailed considerations\n-----------------------\n\nThey are two ways to consider the \"dict of sets\" notion,\ndiffering on how you handle the empty values for keys.\n\nThe easiest idea is to consider that a key with no content is non-existent.\nThis is how the dictset_ package is implemented.\n\nIn this alternative implementation,\nwe chose to keep the empty keys as meaningful elements,\nallowing for smart unions and intersections.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e pprint(MetaSet(a={1}) | MetaSet(a={2}, b=set()))\n    {'a': {1, 2}, 'b': set()}\n\n    \u003e\u003e\u003e MetaSet(a={1}) \u0026 MetaSet(a={2}, b={3})\n    {'a': set()}\n\nSo, beware of how empty-keys are handled,\nand consider using dictset_ if it is a better match for your use case.\nThe behavior for subtraction and symmetric difference,\nalthough sound on a mathematical point of view, may not be what you want.\n\n.. code-block:: python\n\n    \u003e\u003e\u003e MetaSet(a={1}) - MetaSet(a={1})\n    {'a': set()}\n\n    \u003e\u003e\u003e MetaSet(a={1}) ^ MetaSet(a={1})\n    {'a': set()}\n\n.. _dictset: https://code.google.com/archive/p/dictset/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyconseil%2Fmetaset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyconseil%2Fmetaset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyconseil%2Fmetaset/lists"}