Skip to main content

A simple database system

Project description


Sunlite Simple Database System

[*Jump to sunlite database server]

simple, fast, local, userfriendly

Speed Menu

for sunlite database

[*Jump to sunlite database connection]
[*Jump to sunlite database tutorials]
[*Jump to sunlite database examples]

for sunlite server database

[*Jump to sunlite database server Q/A]
[*Jump to sunlite database server getting started]
[*Jump to sunlite database server how to links]

what is sunlite ?

Ans: Sunlite is a module for simple data management.

  • How to use
    • Connect to memory.
    • connect to a database.
    • Create a new header . >> * add data , or pull data
      • enjoy ^~^


Sunlite lets you connect as you want.

from sunlite.db import connect

db = connect() #for memory
db = connect("my_db") #for connecting with "my_db" , it will be auto generated if doesnt exists.
db = connect("my_db",logs=False)  # for connecting to "my_db" but say no to logs

Generating new header

headers are like boxes which contains your datas , don't forget to make one before pushing or pulling data

db = connect("my_db")"websites")  #here , we made a header named websites.

Pushing data to headers

by pushing , we add data in headers to contain . you can push any data .

db = connect("my_db")"websites")

name = "google"
data = ""

db.push(name,data) #here , we are pushing with the name google in websites header

Pullling data from headers

you can pull all data of header or an invidual data

db = connect("my_db",logs=False)"websites")

name = "google"
data = ""


a = db.pull("websites")  #it will pull all data in website header as a dictionary.

a = db.pull("google")  #it will only pull the data of google no matter where it is in which header .

don't use same names for two datas as it will remove 2nd one .

Get a header as you want. This time duplicate names are accepted.

unlike pull function , this function doesn't update duplicate datas as sends as they are .

this is useful in maintaining a large set of same data.




#now for akmal"Akmal")


db.get("Akmal")  #for getting akmal marks
db.get("allan") #for getting allan's marks

Beauty print .

You can beauty print all data's in all headers .

db = connect("my_db",logs=False)"websites")

name = "google"
data = ""

db.push(name,data)  #this prints all data nicely

Get all headers

db = connect("my_db",logs=False)


Example with a user info system with sunlite

db = connect("my_db",logs=False)"users")

name = "Axel"
data = ["age":13 , "nation": "USA"]


name = "Jack"
data = ["age":15, "nation": "England"]

Sunlite Server

Sunlite server is a database server which can be generated in memory or in a physical database .

Why and How ?

Q. Why Sunlite need database server ? A. Sunlite is a python system which can't be used from other languages but with sunlite server, users can use this simple database system from any programming language after invoking the server with python. Q. How to use sunlite server from different programming languages? A. Using http get requests to server. Wrappers from different languages coming soon.

I think i am ready for my first server :)

To start a server of your existing sunlite database ( tutorials above about using sunlite database system ) , simply login to your python console installed and execute from sunlite.server import Serve

from sunlite.server import Serve
Serve(name="[DBNAME]" , logfolder="[LOGPATH]").invoke()
# [DBNAME] is the database name you created using sunlite or any name if you want to create a new. remember sunlite can connect to database #  you create with server and vice versa.
# [LOGPATH] is the path to log your server tasks. ex. 'E:/logs'

So to connect a sunlite database with the name 'test' and save it's logs in a folder named logs in the project directory , just do

from sunlite.server import Serve
Serve(name="test" , logfolder="logs").invoke()

and your server will start running in http://localhost:5000

to disable or unable logs , you can use logs=True or logs=False inside Serve.

Ex. for turning logs off

from sunlite.server import Serve
Serve(name="test" , logs=False , logfolder="logs").invoke()

logs are on by default.

To open the server on your prefered ip address,
from sunlite.server import Serve
Serve(name="test" , logs=False , logfolder="logs").invoke(ip='your ip' , port = your_port)
#example Serve(name="test" , logs=False , logfolder="logs").invoke(ip='' , port = 5000)

Links to send database requests.

to get all data in your database


to get header list


to create a new header


to pull a data


to get total data of a header


to add a data or modify in a header


do remember html link syntaxes.

ex. will pull the data named hello will pull data from the header myheader etc


format spaces with %20f

ex. if your data name was my data make the link like not data

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sunlite-1.1.1.tar.gz (92.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page