Skip to main content

synod by Gnifajio

Python dictionary with synonyms

Description

Python does not support the list type as a dictionary key, and there are more synonyms. I solved this problem by creating my own synod data type that allows me to do this. Below is an example of how it works.

Installation

git clone https://github.com/gnifajio/synod.git
cd synod
python3 setup.py install

Or

pip install synod

Usage

from synod import synod
synoded = synod([
        [['development', 'dev'], [
            'all_inclusive',    'backend', 'frontend',
            'prototyping',      'android', 'desktop',     
            '1c_dev', 'games',  'other',   'scripts',
            'voice_interfaces', 'ios',     'bots',
        ]],
        [['testing', 'tst'], [
            'sites', 'mobile', 'software',
        ]],
        [['admin', 'adm'], [
            'servers', 'network', 'databases',
            'security', 'other' ,
        ]]
        ]
    )

synoded['dev'] == synoded['development'] # True
'dev' in synoded # True
synoded.get('wtf') # synod.EmptyValue
synoded.get('testing') # [ 'sites', 'mobile', 'software' ]
synoded.has_key('tst') # True
synoded.is_synonym('adm') # True
synoded.get_main_key('adm') # 'admin'
del synoded['dev']
synoded.has_key(dev) # False
synoded.clear()
synoded # {}

TODO

Add Methods:

  • __ior__
  • __iter__
  • __len__
  • __or__
  • __reversed__
  • __ror__
  • __setitem__
  • copy
  • fromkeys
  • keys
  • pop
  • popitem
  • setdefault
  • update
  • values

New in version 1.1:

  • items method.

Metadata

Release files for synod 1.1

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

Source distribution (sdist)

Source distribution for synod 1.1
File Size Uploaded Provenance
synod-1.1.tar.gz 3.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 7.7 kB

Release files / synod-1.1.tar.gz

Download URL synod-1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9c344d50cd004aba1bc8dce5b7fae3e2315c536aebddebe3bf294dcd9a54195e
BLAKE2b-256 checksum
How to use checksums
11e2381002c82112e4d0d4ddcfe4f1ccb80aa24e27b67b5a188e5dbc45a138b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / synod-1.1-py3-none-any.whl

Download URL synod-1.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79b9bdb12107d510560751cb1a8dc2cae80e8d0ee02adf92a2a704694bcf43ae
BLAKE2b-256 checksum
How to use checksums
85b6c878b65a498432f70c2b6fa9d0086f0e56114386eae7b40fe567d7880b4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for synod 1.1

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.

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files No provenance

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