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


Release history Release notifications

Download files

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

Files for jdict, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size jdict-1.0.0-py3-none-any.whl (4.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size jdict-1.0.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page