fakedb
fakedb oferece implementações assíncronas de bancos de dados fake inspirados
em PostgreSQL e MongoDB, persistindo dados em sistemas de arquivos locais ou em
backends compatíveis com Google Cloud Storage. Ele é útil para protótipos,
testes e ambientes onde provisionar um banco real seria custoso ou demorado.
Recursos principais
FakePostgresDB: API parecida com SQLAlchemy/SQLModel, com suporte opcional a validação por Pydantic e materialização de resultados em modelos tipados.FakeMongoDB: coleções estilo MongoDB com binding opcional a modelos Pydantic.- Backends plugáveis via
StorageBackend, incluindo uma implementação local e uma variante para GCS. - Locking distribuído simples para coordenar operações concorrentes.
Instalação
pip install fakedb
Dependências opcionais:
pip install "fakedb[extras]" # Pydantic, SQLModel, SQLAlchemy
pip install "fakedb[cloud]" # google-cloud-storage
Exemplos rápidos
import asyncio
from fakedb import FakePostgresDB, LocalStorageBackend
async def demo():
backend = LocalStorageBackend("/tmp/fake-db")
db = FakePostgresDB(backend, "analytics")
await db.create_table("users", {"id": "int", "name": "str"})
await db.insert("users", [{"id": 1, "name": "Alice"}])
rows = await db.query("users")
print(rows)
asyncio.run(demo())
Desenvolvimento
make test # executa a suíte com pytest
make coverage # relatórios de cobertura
Sinta-se à vontade para abrir issues e PRs com melhorias.
Metadata
Release files for fakedb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fakedb-0.1.0.tar.gz | 21.2 kB | Without provenance | Details for fakedb-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fakedb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fakedb-0.1.0-py3-none-any.whl |
Total release size: 47.4 kB
Release files / fakedb-0.1.0.tar.gz
| Download URL | fakedb-0.1.0.tar.gz |
|---|---|
| Size | 21.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c6fb855467006e769ecb9f2c5aad4bded51eb0099b4efb4b4aacbd48c3e7152
|
|
BLAKE2b-256 checksum How to use checksums |
770f510a6c89841c2d4c63e121306a2894452c47d2de57a1a181d78f1a548dde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / fakedb-0.1.0-py3-none-any.whl
| Download URL | fakedb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 26.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35ecd65431877afe5b9c128e3416613431e5ea97456ea24df29c48e965fd8c9e
|
|
BLAKE2b-256 checksum How to use checksums |
0ffd92f857000094098c11673515490ad49964b3a1720dc5b415eb2daf5a0785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for fakedb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.