https://github.com/torxed/dictabase
A dictionary, but also a "database".
https://github.com/torxed/dictabase
database dictionaries linux python
Last synced: about 2 months ago
JSON representation
A dictionary, but also a "database".
- Host: GitHub
- URL: https://github.com/torxed/dictabase
- Owner: Torxed
- License: gpl-3.0
- Created: 2018-10-25T17:36:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-29T09:18:50.000Z (over 4 years ago)
- Last Synced: 2025-01-25T16:55:06.922Z (4 months ago)
- Topics: database, dictionaries, linux, python
- Language: Python
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dictabase
A dictionary, but also a "database".## Usage
### Starting the server
[user@host]$ python dictabase.py
### Using the dict that isn't a dict *(and also not recommended to any sane person)*:
Here's a short example of how you would load the top level item called `players` from the *"databas"*.
Everything stored in the *database* is virtually a dictionary, and choosing a top level item from it is required.```python
from dictabase import dictabase as dict# Loads the "players" first level from the stash
players = dict("players")
players["New Player"]["url"] = "http://homepage/avatar.png"print(players)
```If it isn't obvious, overriding `dict` is a pretty stupid idea.
You should also consider something like [MongoDB](https://github.com/mongodb/mongo) which is pretty stable and reliable. It also returns dict-ish types of results.## Final note
```python
## Duck typing
# "If it walks like a duck,
# and it quacks like a duck,
# then it must be a duck"
```