Skip to main content

Snippets for FastAPI to work with MongoDB by Motor driver.

Project description

GitHub Workflow Status (branch) GitHub codecov

fastapi-mongodb

Requirements

  • Python 3.9 +
  • poetry

Tests

poetry run pytest

Coverage

poetry run coverage run -m pytest
poetry coverage report

Roadmap

  • ➕ BaseModel (data container and to_db / from_db)
  • ➕ BaseSchema (request / response validation and serialization)
  • ➕ BaseRepository (CRUD operations for the DB)
  • ➕ BaseRepositoryConfig (customization for Repository logic)
  • ➕ TokensHandler (encode / decode and validate JWT tokens)
  • ➕ PasswordsHandler (password hashing and password checking)
  • ➕ settings.py (get base config from .env)
  • ➕ BaseLogger (debug logger and simple logger)
  • ➕ DB profiling and monitoring
  • ➕ Application setup (config.py, indexes, collection setup)
  • ➕ Tests and test environment (test DB configuration)
  • ➕ Model Factories (factory_boy)
  • ➕➖ Pagination (?limit, ?offset, ?latest_id)
  • ➕➖ Sorting (?orderBy)
  • ➕➖ Projectors (?showFields, ?hideFields)
  • ➕➖ Trace memory allocations (tracemalloc)
  • ➕➖ BaseProfiler (decorator and context manager and metaclass / cProfile)
  • ➕➖ manage.py commands (setup apps / create apps etc)
  • ➕➖ .Dockerfile and docker-compose.yaml
  • ➕➖ DB setup (db management, db level commands)
  • ➖ DB User management commands (append to manage.py)
  • ➖ DB ReplicaSet setup + docker-compose.yaml
  • ➖ DB migrations handler (migrations running and tracking)
  • ➖ DB dump/restore
  • ➖ Filters ("Depends" classes maybe DB applicable)
  • ➖ Change email flow
  • ➖ Change password flow
  • ➖ Reset password flow
  • ➖ Load testing with Locust
  • ➖ Login with Google, Facebook, Twitter
  • ➖ .csv / .xlsx Handlers
  • ➖ Background tasks (Redis + celery/celery-beat)

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

fastapi-mongodb-0.0.1a1.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

fastapi_mongodb-0.0.1a1-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi-mongodb-0.0.1a1.tar.gz.

File metadata

  • Download URL: fastapi-mongodb-0.0.1a1.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.4 Linux/5.4.0-70-generic

File hashes

Hashes for fastapi-mongodb-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 3871dfea13ffefebbf7d371ac48025e292287d693b15272fb3a8f8c8158994e1
MD5 5ca491383a64f9d3767d70655a7b2ceb
BLAKE2b-256 dc0b01de9fd8d2a74da1cfdae3d4e6a29dd1e65dbe2cdb36810a286c648867b8

See more details on using hashes here.

File details

Details for the file fastapi_mongodb-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: fastapi_mongodb-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.9.4 Linux/5.4.0-70-generic

File hashes

Hashes for fastapi_mongodb-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 50bdcf403c2acf2ca1d0bfa13ccaea69395dbced5250997ab6f7345ee26aac48
MD5 3fa4686e073390b62e3798c03071702f
BLAKE2b-256 5d0b08bb2093ecf6504d39e388aa2836e5397447ebb2ad1d52ec82d54c84f94f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page