Skip to main content

A lightweight and flexible NoSQL database library using JSON for data storage

Project description

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.

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.

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.

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)

Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

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

Source Distribution

nkitedb-1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

NKiteDB-1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file nkitedb-1.1.tar.gz.

File metadata

  • Download URL: nkitedb-1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for nkitedb-1.1.tar.gz
Algorithm Hash digest
SHA256 b553bea3ee74279eaaca9170f10defd3e818ee9d90605f5ac4e4c8f2b17d8187
MD5 aee35cffeee581b9beab7367a12edc05
BLAKE2b-256 7b42d92cb91da1853b748b1913d4fa705a4975fad978f0469bfa6e8306154c1f

See more details on using hashes here.

File details

Details for the file NKiteDB-1.1-py3-none-any.whl.

File metadata

  • Download URL: NKiteDB-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for NKiteDB-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65ea8020ebd1e2175e7f1563f9e196a783e5a46d2d5467a142ebfcbce13c03f8
MD5 d8b1e30814bc45c2569a122d77a8adfb
BLAKE2b-256 3c97acc5bc755fc157e0ea6869b97c1198bd3b6d9dac0d9267f1a47a205c88cb

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