Coder Social home page Coder Social logo

pranavbaburaj / lol Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 0.0 157 KB

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

Home Page: https://pypi.org/project/loldb/

License: MIT License

Python 100.00%
database json json-database data json-based-database utility python lib python-library lol datatypes

lol's Introduction

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)

Maps

from lol.datatypes.maps import Maps

maps = Maps((int, str))

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.set_item('name', 'new-name')

Numbers

from lol.datatypes.number import Number

num = Number("777")

Strings

from lol.datatypes.string import String

string = String(7777)

CLI

Project Generator

lol-create-project

Prompts and options

from lol.prompt import Prompt

data = Prompt("Name", type=str).prompt()
from lol.argparse import Parser
import sys

def get(data):
    print(data)

def delete(data):
    print(data)

p = Parser([
    {
        "value" : "install $package",
        "types" : {
            "package" : str
        },
        "func" : get
    },
    {
        "value" : "delete $package",
        "types" : {
            "package" : str
        },
        "func" : delete
    }
])

p.parse()

=======

ArgParser

Under development

lol's People

Contributors

lainq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lol's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.