DEV Community

Discussion on: Show me your best Open Source project

Collapse
 
pranavbaburaj profile image
Pranav Baburaj

GitHub logo pranavbaburaj / lol

A utility library for Python (It contains a JSON-based-database, argparse, some common datatypes, switch cases etc)

LOL

The documentation is still under construction

Lol is a database library


Features

  • A set of data types
    • Numbers
    • Strings
    • Maps
    • Arrays
    • Interfaces
  • A json-based-database
    • Add
    • Delete
    • Update
    • Filter
  • Prompt
    • Input prompt
    • Options(coming soon)
  • Project generator
  • CLI

How to use it

Database

See the database documentation here


Datatypes

See all the datatype methods here

Arrays

from lol.datatypes.arrays import Array
array = Array(int, length=None)
Enter fullscreen mode Exit fullscreen mode

Maps

from lol.datatypes.maps import Maps
maps = Maps((int, str))
Enter fullscreen mode Exit fullscreen mode

Interfaces

from lol.datatypes.interface import Interface
data = Interface({
    name : [str, int]
    age : "?" # any,
})

# create an interface object
obj = data.create("Pranav", 13)

# gives you the name
print(obj.get_item('name'))

# change the value
obj.
Enter fullscreen mode Exit fullscreen mode