Skip to main content

Python package for interacting with databases using model repositories.

Project description

ModelRepo

PyPI version Build Status Documentation Status Coverage Python Versions License

A Python package for managing database models using model repositories.

Features

  • Easy to use
  • Wide database support (In-memory, MySQL, MongoDB)
  • Dependency injection using dependency-injector

Installation

You can install ModelRepo using pip:

pip install modelrepo

For development installation:

git clone https://gitlab.chalifour.dev/noahchalifour/modelrepo.git
cd modelrepo
pip install -e ".[dev]"

Quick Start

Here's a simple example to get you started:

from modelrepo.repository import InMemoryModelRepository
from dataclasses import dataclass


@dataclass
class User:
    id: str
    name: str
    email: str


def main():
    repository: InMemoryModelRepository[User] = InMemoryModelRepository(User)
    user = repository.create({"name": "John Doe", "email": "test@email.com"})
    print("Created user:", user)


if __name__ == "__main__":
    main()

For more examples, see the examples directory.

Development

Setup Development Environment

# Clone the repository
git clone https://gitlab.chalifour.dev/noahchalifour/modelrepo.git
cd modelrepo

# Install development dependencies
pip install -e ".[dev]"

Running Tests

pytest

With coverage:

pytest --cov=src

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure your code follows the project's style guidelines and includes appropriate tests.

License

This project is licensed under the MIT License.

Contact

For questions and support, please open an issue on the GitLab repository.

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

modelrepo-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

modelrepo-1.0.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file modelrepo-1.0.0.tar.gz.

File metadata

  • Download URL: modelrepo-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.8.0-59-generic

File hashes

Hashes for modelrepo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e65fe051971341e923479aa51296bfcf2729b4264f2d8c1a3caca61c90b96b00
MD5 e443aae1764ecd970752978f51555c4a
BLAKE2b-256 0f9ef1bbdf27c7c7f2c549b7ed4e0d3b2553e91b8015946482b516b08129d21c

See more details on using hashes here.

File details

Details for the file modelrepo-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: modelrepo-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.8.0-59-generic

File hashes

Hashes for modelrepo-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6116704b7cdf38d1e4c4c318d6bb4752c9d85cd06c6d86959fc1b8d4cee1495c
MD5 3903e94bc5d6a86509dbeaaa444b272b
BLAKE2b-256 b6a81f80deeafa6b2d4c8712b5c876fb8c038176b1faa582d31f608d342c4eb8

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