Skip to main content

Dictionary extended with convenience methods that depend heavily on dictionaries being ordered by insertion order.

Project description

jdict

Dictionary extended with convenience methods that depend heavily on dictionaries being ordered by insertion order.

Requirements

jdict requires Python 3.6+. It will raise an Exception if imported with a lower version.

jdict has no dependencies, except for the following methods which require pandas: series, datarow, and datacol.

Installation

For now you have to get the source and install with pip install -e .

Usage

>>> from jdict import jdict
>>> j = jdict(x=3, y=4, z=5)
>>> j.x
3
>>> j.first
('x', 3)
>>> j.first_key
'x'
>>> j.value_list
[3, 4, 5]
>>> j.list
[('x', 3), ('y', 4), ('z', 5)]
>>> j.last
('z', 5)
>>> j.pop_last()
('z', 5)
>>> j
{'x': 3, 'y': 4}

and so on. For more about the usage, see the tests.

Running tests

Run the following commands

  1. pip install pytest (if you don't have pytest)
  2. pip install pandas (if you don't have pandas)
  3. pip install -e . (if you haven't done so already)
  4. pytest

Project details


Download files

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

Source Distribution

jdict-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

jdict-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file jdict-1.0.0.tar.gz.

File metadata

  • Download URL: jdict-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for jdict-1.0.0.tar.gz
Algorithm Hash digest
SHA256 730c782d8009c7dbea026d96d9c8517329c047c8215d0982e0e2511e5843efe9
MD5 81bc8c0df7663b831963251ec4c75c7a
BLAKE2b-256 01f065f3e3567fb6f4b4e8dfe7cc1133925f14a383c3a7059eb22b25e65a3313

See more details on using hashes here.

File details

Details for the file jdict-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jdict-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.4

File hashes

Hashes for jdict-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8951e6a3c49ffe23158974791061f1016b6d108d693fc96020669ab06c65c71
MD5 d2b66903c6c57d479bbd59bcde1cca8a
BLAKE2b-256 d0f8bda21a2365ce2b2070bdee1eb8656271fde7facb26ecbe232d855fb20e5e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page