Coder Social home page Coder Social logo

filexdb.py's Introduction

FileXdb-Python

FileXdb is a lightweight local NoSQL database, optimized for best coding experience.

It's written in Core Python and has no external dependencies. The target is to reduce the complexity of installing external SQL Database & data handling.

FileXdb is:

  • A local, File-based, lightweight, horizontally scaled NoSQL Database.
  • Designed to be simple and interesting to use by providing simple and clean APIs.
  • A Collection & Document oriented approach.
  • Works on all modern versions of Python and PyPy.

Supported Python Versions

Since newer versions of Python are often faster, have more features and are better supported, the latest version of Python 3 is recommended for FileXdb. You may use it on older versions as well.

Installation

Install FileXdb using pip :

Windows:

python -m pip install filexdb

Linux / MAC:

python3 -m pip install filexdb

Getting Start

from filexdb import FileXdb

db = FileXdb("db-name", "path/to/data/dir")
new_coll = db.collection("collection-name")

new_coll.insert({"name": "Sam", "skills": ["Python", "C++"]})

Insert Multiple Documents

data = [
    {
        "name": "Jack",
        "dept": "CSE"
    },
    {
        "name": "Rocky", 
        "address": {
            "PO": "Bongaon", 
            "PS": "Kolkata"
        }, 
        "skills": [
            "Game Dev"
        ]
    },
    {
        "name": "Rahul"
    }
]

new_coll.insert_all(data)           # `data` should be a List of  JSON Object

Find Documents

query = {"name": "Sam"}

# Returns all Documents.
new_coll.find()  

# Returns all Documents matches the ``_query``.
new_coll.find(query=query)  

# Returns doc[1] to doc[2] matches the ``_query``.
new_coll.find(query=query, limit=(1, 3))  

# Returns doc[1] to doc[9] of all Documents.
new_coll.find(limit=(3, 50))

Update Documents

query = {
    "name": "Rocky"
}

updated_data = {
    "name": "Rocky Bhai",
    "skills": [
        "Game Dev", 
        "C++", 
        "Python"
    ]
}

new_coll.update(updated_data, query)

Delete Documents

query = {
    "name": "Rocky Bhai", 
    "dept": "ECE"
}

new_coll.delete(query)

More Features

FileXdb is in Beta stage. Currently we have above features only. We will come back to you with other advanced features soon.

You may also contribute in this journey.

Contributing

Thank you for investing your time in contributing to our project! Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community. Any contribution you make will be reflected on github.com/FileXdb/FileXdb-Python✨.

Contributions to FileXdb are welcome! Here's how to get started:

  • Open an issue or find for related issues to start a discussion around a feature idea or a bug.
  • Fork the repository on GitHub.
  • Create a new branch of the master branch and start making your changes.
  • Make a meaning-full commit.
  • Write a test, which shows that the bug is fixed or the feature works as expected.
  • Send a pull request and wait until it gets merged and published.

filexdb.py's People

Contributors

codingsamrat avatar acepicstudio avatar

Stargazers

 avatar ILYAS KERBAL avatar  avatar Cheung Zirpon avatar François Michaud avatar Tao avatar  avatar Mr. X avatar  avatar  avatar

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.