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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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