Skip to main content

A lightweight local NoSQL database

Project description

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.

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

filexdb-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filexdb-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file filexdb-0.1.0.tar.gz.

File metadata

  • Download URL: filexdb-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for filexdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd26c3c55a05e5a7ac4fc0d0b9372918035866c96a4ef88704c370f8b2bf2290
MD5 2d01b461a8cc4486c814e1a9968018d4
BLAKE2b-256 d1edcf714db3f0b0d307fc558a4c48b2581856d747739ecc0db63f636efe8072

See more details on using hashes here.

File details

Details for the file filexdb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: filexdb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for filexdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8774a5698e5866c0021fd672187e6c0b8f3c25f5c22bc5575598bdf300ab70a1
MD5 813e16fb59487b9a7ff30e15da43ed8a
BLAKE2b-256 084ebd3aa58f1b74a75ffa90ed5abd8b72d3c5d85852cfcb371737ef27dc0208

See more details on using hashes here.

Supported by

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