Skip to main content

Lightweight file-system database for Python projects.

Project description

pyfiles_db

Lightweight file-system database for Python projects

PRE RELISE FIRST VERSION OF PYFILES_D

About

pyfiles_db is a lightweight and fast library that allows using the file system as a database for Python projects. It is minimalistic, requires no full-fledged DBMS, and is ideal for small to medium projects where simplicity and speed are priorities, and when system resources are a concern. It is built on top of aiofiles which allows you to use the file system as a database without any server required. Also can with synchronous mode.

Features

  • Store data directly in folders and files (no server required)
  • Simple API — quick to start
  • Supports basic CRUD operations: Create, Read, (Update, Delete - now don't realized)
  • Minimal external dependencies
  • Designed for easy integration and flexibility

Installation

pip install pyfiles_db

Quick Start

from pyfiles_db import FilesDB
from pathlib

file_db = FilesDB()

db = file_db.init_async()  # Or file_db.init_sync() for sync mode
# storage - path to database location, if is None use default path.

db.craeate_table(
    "users",
    columns={
        "id": "INT",
        "name": "TEXT",
        "age": "INT",
    },
    id_generator="id", # required unical value of table, if None use generator for auto increment.
)

db.new_data(table_name="usesr", data={
    "id": 1,
    "name": "Anton",
    "age": 17,
})

db.new_data(table_name="users", data={
    "id": 2,
    "name": "Alex",
    "age": 17,
})

user_id_1 = db.find("usesr", "id == 1")
# return [{"id": 1, "name": "Anton", "age": 17}]

user_id_2 = db.find("usesr", "id == 2") 
# return [{"id": 2, "name": "Alex", "age": 17}]

users_age_17 = db.find("users", "age == 17")
# return [
#     {"id": 1, "name": "Anton", "age": 17},
#     {"id": 2, "name": "Alex", "age": 17},
# ]

Use Cases

  • Quick startups, prototypes, MVPs
  • Lightweight web applications, scripts, utilities
  • Projects not requiring a heavy DBMS
  • Personal projects and data analysis tools
  • low RAM and processor characteristics

Best Practices & Limitations

  • Not designed for high-load systems with thousands of requests per second
  • Maintain folder structure carefully to avoid naming collisions
  • As this uses the file system, consider transaction/concurrency limitations
  • Regularly back up the path folder

Contribution

Feedback, issues, and pull requests are welcome! Follow the contribution guidelines if available. Ensure your code is tested (tests in /tests/) and document changes.

License

This project is licensed under the Apache-2.0 License. See LICENSE for details.

Other

CODE_OF_CONDUCT

CONTRIBUTING

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

python_files_db-0.0.1a2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

python_files_db-0.0.1a2-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file python_files_db-0.0.1a2.tar.gz.

File metadata

  • Download URL: python_files_db-0.0.1a2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_files_db-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 cbceef2ceb9c9ddb29816341ad9f1072d13e617d09250fc2322d7646a1eca415
MD5 744724edb27c2bf649a2130ff15d4156
BLAKE2b-256 5e4e4f42ae244e563bcef8d2fd53fcbd3826572e86c0f7b12528a9fc015a5ad8

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_files_db-0.0.1a2.tar.gz:

Publisher: publish.yml on LangNeuron/pyfiles_db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_files_db-0.0.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_files_db-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 e70d87accb050bbb387bacb888acc6914935ee4da8d9218b20f3cc336b612fac
MD5 594d9726cf3d821bad3b4db12c5fb0dd
BLAKE2b-256 0b727d5cd9e68c26cbcfc2e383abfe4ed2a8f008c083d187227267a2bbfdc0dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_files_db-0.0.1a2-py3-none-any.whl:

Publisher: publish.yml on LangNeuron/pyfiles_db

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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