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
  • Minimal external dependencies
  • Designed for easy integration and flexibility

Installation

pip install pyfiles_db

Quick Start

from pyfiles_db import FilesDB

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 [{"1": {"id": 1, "name": "Anton", "age": 17}}]

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

users_age_17 = db.find("users", "age == 17")
# return [
#     {"1": {"id": 1, "name": "Anton", "age": 17}},
#     {"2": {"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.1a3.tar.gz (12.8 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.1a3-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_files_db-0.0.1a3.tar.gz
  • Upload date:
  • Size: 12.8 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.1a3.tar.gz
Algorithm Hash digest
SHA256 ad1d4862836390059bcb218cc21248779e34267f4d5d29f33800517b9758b71a
MD5 3c01758b4ce487fc04048cac67134af2
BLAKE2b-256 35c3d026f51e8a1b464e7c79775347ad027d3b803946a0ab47df56e08b229a9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_files_db-0.0.1a3.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.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_files_db-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 889917762a3c908295d4ffab0b1bcd64e9fd2f239ae614edbd2e6b553750cbbc
MD5 5390cb16512a9dc5d94716685624e137
BLAKE2b-256 bbe1b334966e238eff94411bac61e2a0e8db37e791511795c98acce3c2181113

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_files_db-0.0.1a3-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