Tips, Tricks, and Tidbits

Known limitations

x = Node()
x._values = 1
x._values
Output: ['values']
x.get('_values')
Output: <pyntree.Node object at memory_location>

 

Moving beyond a single flat file

For more complex projects, a flat-file database may not be the way to go. Here is one example of how you could store data in a more distributed way:

Python implementation:

from pyntree import Node
config = Node('db/config.json')

# On request with argument "transaction_id"
data = Node(f'db/transactions/{transaction_id}')
return data()

How to fix pyntree installing as UNKNOWN-0.0.0

pip install --upgrade pip wheel setuptools