Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Jagielka committed May 17, 2020
1 parent 4c6298c commit c420d7d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
Accessor: read nested dictionaries
==================================
# Accessor: read nested dictionaries

Build accessor functions using the natural python dot notation.

Installation
------------

# Installation

``python-accessor`` is available as a zero-dependency Python package. Install with:

$ pip install python-accessor


Usage
-----
## Usage

```python

from accessor import accessor as _

name = _.users.name
name(obj) # equvalent of obj['users']['name']


```

Examples
--------
## Examples

```python

Expand Down Expand Up @@ -71,8 +64,7 @@ list(filter(_.uid > 300, obj['users']))
# -> [{'uid': 3456}]
```

More Examples! :)
-----------------
## More Examples! :)

```python

Expand Down
6 changes: 3 additions & 3 deletions accessor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""This is a docstring.
"""Access nested dictionaries.
Two lines
Create functions to manipulate dictionaries smililar to itemgetter.
"""

from functools import wraps
Expand Down Expand Up @@ -102,7 +102,7 @@ def select(*getters, **name_getters):


def normalize(data, c_getter, select, c_select):
"""Normalize" semi-structured JSON data into a flat table.
"""Normalize semi-structured JSON data into a flat table.
Parameters
----------
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[metadata]
long_description = file: README.md
long_description_content_type = text/markdown
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
from setuptools import setup, find_packages

setup(
name='Accessor',
name='python-accessor',
version='0.0.1',
description='Access nested dicts',
long_description=open('README.md').read(),
author='Jakub Jagielka',
author_email='jjagielka@gmail.com',
url='https://github.com/jjagielka/python-accessor',
license=open('LICENSE').read(),
packages=find_packages(exclude=('tests', 'docs')),
classifiers=[
'Development Status :: 3 - Alpha',
Expand Down

0 comments on commit c420d7d

Please sign in to comment.