NKiteDB


NameNKiteDB JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/Leo4Bey/NKiteDB
SummaryA lightweight and flexible NoSQL database library using JSON for data storage
upload_time2025-02-15 15:22:41
maintainerNone
docs_urlNone
authorKemal Sayıt
requires_python>=3.6
licenseNone
keywords nosql nosql db database json lightweight flexible easy to use database nkite
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NKiteDB

**NKiteDB** is a lightweight and flexible NoSQL database library that uses a JSON file for data storage. It provides simple CRUD (Create, Read, Update, Delete) operations and makes it easy to manage your data collections.

## Features

- **File-Based Storage:** Data is stored in a specified JSON file.
- **Collection Support:** Organize different datasets into collections.
- **CRUD Operations:** Perform basic database operations using `insert`, `find`, `get_first`, `update`, `delete`, and `get_all` methods.
- **Ease of Use:** Its simple interface allows for easy integration into your projects.

## Installation

NKiteDB relies only on Python's built-in `json` and `os` modules. No additional installation is required. Simply include the `NKiteDB` class in your project or clone this repository.

```bash
git clone https://github.com/Leo4Bey/NKiteDB/
```


**NKiteDB**, JSON dosyası kullanarak veri saklayan, hafif ve esnek bir NoSQL veritabanı kütüphanesidir. Basit CRUD (Create, Read, Update, Delete) işlemleri sunar ve veri koleksiyonlarını kolayca yönetmenizi sağlar.

## Özellikler

- **Dosya Tabanlı Depolama:** Veriler, belirtilen bir JSON dosyasında saklanır.
- **Koleksiyon Desteği:** Farklı veri kümelerini koleksiyonlar halinde organize edebilirsiniz.
- **CRUD İşlemleri:** `insert`, `find`, `get_first`, `update`, `delete` ve `get_all` metodları ile temel veritabanı işlemleri gerçekleştirin.
- **Kolay Kullanım:** Basit arayüzü sayesinde projelerinize kolayca entegre edilebilir.

## Kurulum

NKiteDB, bağımlılık olarak yalnızca Python'un yerleşik `json` ve `os` modüllerini kullanır. Ekstra bir kurulum yapmanıza gerek yoktur. Sadece `NKiteDB` sınıfını projenize dahil edin veya bu repoyu klonlayın.

```bash
git clone https://github.com/Leo4Bey/NKiteDB/
```


## Usage / Kullanım

The following example demonstrates how to perform basic CRUD (Create, Read, Update, Delete) operations with NKiteDB. / Aşağıdaki örnek kod, NKiteDB ile temel CRUD (Create, Read, Update, Delete) işlemlerini nasıl gerçekleştireceğinizi gösterir.

```python
from nkitedb import NKiteDB 

# 1. Initialize the Database / Veritabanını Başlatma
# If the specified JSON file does not exist, NKiteDB will automatically create an empty file.
# Eğer belirtilen JSON dosyası yoksa, NKiteDB otomatik olarak boş bir dosya oluşturacaktır.
db = NKiteDB("nkdatabase.json")

# 2. Insert Data (Add New Documents) / Veri Ekleme (Yeni Belgeler Ekleme)
# Insert two user documents into the "users" collection.
# "users" koleksiyonuna iki adet kullanıcı belgesi ekleyelim.
db.insert("users", {"id": 1, "name": "Kemal", "age": 20})
db.insert("users", {"id": 2, "name": "Nehir", "age": 19})

# 3. Find Data / Veri Arama
# Find all documents in the "users" collection where "name" is "Kemal".
# "name" alanı "Kemal" olan tüm belgeleri "users" koleksiyonunda arar.
results = db.find("users", {"name": "Kemal"})
print("Find results:", results)
print("Arama sonuçları:", results)

# 4. Get First Matching Document / İlk Eşleşen Belgeyi Alma
# Get the first document where "age" is 20.
# "age" alanı 20 olan ilk belgeyi getirir.
first_user = db.get_first("users", {"age": 20})
print("First user:", first_user)
print("İlk kullanıcı:", first_user)

# 5. Update Data / Veri Güncelleme
# Update the document where "name" is "Kemal" and set "age" to 21.
# "name" alanı "Kemal" olan kullanıcı belgesini bulup "age" değerini 21 olarak günceller.
updated = db.update("users", {"name": "Kemal"}, {"age": 21})
print("Update successful?", updated)
print("Güncelleme başarılı mı?", updated)

# 6. Delete Data / Veri Silme
# Delete the document where "id" is 1.
# "id" alanı 1 olan kullanıcı belgesini siler.
deleted = db.delete("users", {"id": 1})
print("Delete successful?", deleted)
print("Silme başarılı mı?", deleted)

# 7. Get All Documents / Tüm Belgeleri Alma
# Get all documents from the "users" collection.
# "users" koleksiyonundaki tüm belgeleri getirir.
all_users = db.get_all("users")
print("All users:", all_users)
print("Tüm kullanıcılar:", all_users)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Leo4Bey/NKiteDB",
    "name": "NKiteDB",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "NoSQL, NoSQL DB, database, JSON, lightweight, flexible, easy to use database, nkite",
    "author": "Kemal Say\u0131t",
    "author_email": "kemalsayit01@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7b/42/d92cb91da1853b748b1913d4fa705a4975fad978f0469bfa6e8306154c1f/nkitedb-1.1.tar.gz",
    "platform": null,
    "description": "# NKiteDB\r\n\r\n**NKiteDB** is a lightweight and flexible NoSQL database library that uses a JSON file for data storage. It provides simple CRUD (Create, Read, Update, Delete) operations and makes it easy to manage your data collections.\r\n\r\n## Features\r\n\r\n- **File-Based Storage:** Data is stored in a specified JSON file.\r\n- **Collection Support:** Organize different datasets into collections.\r\n- **CRUD Operations:** Perform basic database operations using `insert`, `find`, `get_first`, `update`, `delete`, and `get_all` methods.\r\n- **Ease of Use:** Its simple interface allows for easy integration into your projects.\r\n\r\n## Installation\r\n\r\nNKiteDB relies only on Python's built-in `json` and `os` modules. No additional installation is required. Simply include the `NKiteDB` class in your project or clone this repository.\r\n\r\n```bash\r\ngit clone https://github.com/Leo4Bey/NKiteDB/\r\n```\r\n\r\n\r\n**NKiteDB**, JSON dosyas\u0131 kullanarak veri saklayan, hafif ve esnek bir NoSQL veritaban\u0131 k\u00fct\u00fcphanesidir. Basit CRUD (Create, Read, Update, Delete) i\u015flemleri sunar ve veri koleksiyonlar\u0131n\u0131 kolayca y\u00f6netmenizi sa\u011flar.\r\n\r\n## \u00d6zellikler\r\n\r\n- **Dosya Tabanl\u0131 Depolama:** Veriler, belirtilen bir JSON dosyas\u0131nda saklan\u0131r.\r\n- **Koleksiyon Deste\u011fi:** Farkl\u0131 veri k\u00fcmelerini koleksiyonlar halinde organize edebilirsiniz.\r\n- **CRUD \u0130\u015flemleri:** `insert`, `find`, `get_first`, `update`, `delete` ve `get_all` metodlar\u0131 ile temel veritaban\u0131 i\u015flemleri ger\u00e7ekle\u015ftirin.\r\n- **Kolay Kullan\u0131m:** Basit aray\u00fcz\u00fc sayesinde projelerinize kolayca entegre edilebilir.\r\n\r\n## Kurulum\r\n\r\nNKiteDB, ba\u011f\u0131ml\u0131l\u0131k olarak yaln\u0131zca Python'un yerle\u015fik `json` ve `os` mod\u00fcllerini kullan\u0131r. Ekstra bir kurulum yapman\u0131za gerek yoktur. Sadece `NKiteDB` s\u0131n\u0131f\u0131n\u0131 projenize dahil edin veya bu repoyu klonlay\u0131n.\r\n\r\n```bash\r\ngit clone https://github.com/Leo4Bey/NKiteDB/\r\n```\r\n\r\n\r\n## Usage / Kullan\u0131m\r\n\r\nThe following example demonstrates how to perform basic CRUD (Create, Read, Update, Delete) operations with NKiteDB. / A\u015fa\u011f\u0131daki \u00f6rnek kod, NKiteDB ile temel CRUD (Create, Read, Update, Delete) i\u015flemlerini nas\u0131l ger\u00e7ekle\u015ftirece\u011finizi g\u00f6sterir.\r\n\r\n```python\r\nfrom nkitedb import NKiteDB \r\n\r\n# 1. Initialize the Database / Veritaban\u0131n\u0131 Ba\u015flatma\r\n# If the specified JSON file does not exist, NKiteDB will automatically create an empty file.\r\n# E\u011fer belirtilen JSON dosyas\u0131 yoksa, NKiteDB otomatik olarak bo\u015f bir dosya olu\u015fturacakt\u0131r.\r\ndb = NKiteDB(\"nkdatabase.json\")\r\n\r\n# 2. Insert Data (Add New Documents) / Veri Ekleme (Yeni Belgeler Ekleme)\r\n# Insert two user documents into the \"users\" collection.\r\n# \"users\" koleksiyonuna iki adet kullan\u0131c\u0131 belgesi ekleyelim.\r\ndb.insert(\"users\", {\"id\": 1, \"name\": \"Kemal\", \"age\": 20})\r\ndb.insert(\"users\", {\"id\": 2, \"name\": \"Nehir\", \"age\": 19})\r\n\r\n# 3. Find Data / Veri Arama\r\n# Find all documents in the \"users\" collection where \"name\" is \"Kemal\".\r\n# \"name\" alan\u0131 \"Kemal\" olan t\u00fcm belgeleri \"users\" koleksiyonunda arar.\r\nresults = db.find(\"users\", {\"name\": \"Kemal\"})\r\nprint(\"Find results:\", results)\r\nprint(\"Arama sonu\u00e7lar\u0131:\", results)\r\n\r\n# 4. Get First Matching Document / \u0130lk E\u015fle\u015fen Belgeyi Alma\r\n# Get the first document where \"age\" is 20.\r\n# \"age\" alan\u0131 20 olan ilk belgeyi getirir.\r\nfirst_user = db.get_first(\"users\", {\"age\": 20})\r\nprint(\"First user:\", first_user)\r\nprint(\"\u0130lk kullan\u0131c\u0131:\", first_user)\r\n\r\n# 5. Update Data / Veri G\u00fcncelleme\r\n# Update the document where \"name\" is \"Kemal\" and set \"age\" to 21.\r\n# \"name\" alan\u0131 \"Kemal\" olan kullan\u0131c\u0131 belgesini bulup \"age\" de\u011ferini 21 olarak g\u00fcnceller.\r\nupdated = db.update(\"users\", {\"name\": \"Kemal\"}, {\"age\": 21})\r\nprint(\"Update successful?\", updated)\r\nprint(\"G\u00fcncelleme ba\u015far\u0131l\u0131 m\u0131?\", updated)\r\n\r\n# 6. Delete Data / Veri Silme\r\n# Delete the document where \"id\" is 1.\r\n# \"id\" alan\u0131 1 olan kullan\u0131c\u0131 belgesini siler.\r\ndeleted = db.delete(\"users\", {\"id\": 1})\r\nprint(\"Delete successful?\", deleted)\r\nprint(\"Silme ba\u015far\u0131l\u0131 m\u0131?\", deleted)\r\n\r\n# 7. Get All Documents / T\u00fcm Belgeleri Alma\r\n# Get all documents from the \"users\" collection.\r\n# \"users\" koleksiyonundaki t\u00fcm belgeleri getirir.\r\nall_users = db.get_all(\"users\")\r\nprint(\"All users:\", all_users)\r\nprint(\"T\u00fcm kullan\u0131c\u0131lar:\", all_users)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A lightweight and flexible NoSQL database library using JSON for data storage",
    "version": "1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Leo4Bey/NKiteDB/issues",
        "Homepage": "https://github.com/Leo4Bey/NKiteDB",
        "Source": "https://github.com/Leo4Bey/NKiteDB"
    },
    "split_keywords": [
        "nosql",
        " nosql db",
        " database",
        " json",
        " lightweight",
        " flexible",
        " easy to use database",
        " nkite"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3c97acc5bc755fc157e0ea6869b97c1198bd3b6d9dac0d9267f1a47a205c88cb",
                "md5": "d8b1e30814bc45c2569a122d77a8adfb",
                "sha256": "65ea8020ebd1e2175e7f1563f9e196a783e5a46d2d5467a142ebfcbce13c03f8"
            },
            "downloads": -1,
            "filename": "NKiteDB-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d8b1e30814bc45c2569a122d77a8adfb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4527,
            "upload_time": "2025-02-15T15:22:39",
            "upload_time_iso_8601": "2025-02-15T15:22:39.432592Z",
            "url": "https://files.pythonhosted.org/packages/3c/97/acc5bc755fc157e0ea6869b97c1198bd3b6d9dac0d9267f1a47a205c88cb/NKiteDB-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7b42d92cb91da1853b748b1913d4fa705a4975fad978f0469bfa6e8306154c1f",
                "md5": "aee35cffeee581b9beab7367a12edc05",
                "sha256": "b553bea3ee74279eaaca9170f10defd3e818ee9d90605f5ac4e4c8f2b17d8187"
            },
            "downloads": -1,
            "filename": "nkitedb-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "aee35cffeee581b9beab7367a12edc05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4500,
            "upload_time": "2025-02-15T15:22:41",
            "upload_time_iso_8601": "2025-02-15T15:22:41.424432Z",
            "url": "https://files.pythonhosted.org/packages/7b/42/d92cb91da1853b748b1913d4fa705a4975fad978f0469bfa6e8306154c1f/nkitedb-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-15 15:22:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Leo4Bey",
    "github_project": "NKiteDB",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nkitedb"
}
        
Elapsed time: 0.56779s