{"id":41985980,"url":"https://github.com/timkleindick/general_manager","last_synced_at":"2026-05-21T15:07:24.036Z","repository":{"id":257301422,"uuid":"854141176","full_name":"TimKleindick/general_manager","owner":"TimKleindick","description":"Opinionated framework for Django - batteries included","archived":false,"fork":false,"pushed_at":"2026-05-11T15:10:40.000Z","size":3261,"stargazers_count":5,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-11T17:13:32.378Z","etag":null,"topics":["crud","django","framework","graphql","python"],"latest_commit_sha":null,"homepage":"https://timkleindick.github.io/general_manager/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimKleindick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-09-08T13:41:10.000Z","updated_at":"2026-04-27T18:47:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9f7b430-23cf-4857-8160-9cf96ffb27aa","html_url":"https://github.com/TimKleindick/general_manager","commit_stats":null,"previous_names":["tk-constellium/general_manager","timkleindick/general_manager"],"tags_count":98,"template":false,"template_full_name":null,"purl":"pkg:github/TimKleindick/general_manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKleindick%2Fgeneral_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKleindick%2Fgeneral_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKleindick%2Fgeneral_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKleindick%2Fgeneral_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimKleindick","download_url":"https://codeload.github.com/TimKleindick/general_manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKleindick%2Fgeneral_manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32912663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"ssl_error","status_checked_at":"2026-05-11T17:08:45.420Z","response_time":120,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crud","django","framework","graphql","python"],"created_at":"2026-01-26T00:13:05.606Z","updated_at":"2026-05-11T21:03:21.988Z","avatar_url":"https://github.com/TimKleindick.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeneralManager\n\n[![PyPI](https://img.shields.io/pypi/v/GeneralManager.svg)](https://pypi.org/project/GeneralManager/)\n[![Python](https://img.shields.io/pypi/pyversions/GeneralManager.svg)](https://pypi.org/project/GeneralManager/)\n[![Build](https://github.com/TimKleindick/general_manager/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/TimKleindick/general_manager/actions/workflows/test.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/TimKleindick/general_manager)](https://app.codecov.io/gh/TimKleindick/general_manager)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n## Overview\n\nGeneralManager helps teams ship complex, data-driven products on top of Django without rewriting the same plumbing for every project. It combines domain modelling, GraphQL APIs, calculations, and permission logic in one toolkit so that you can focus on business rules instead of infrastructure.\n\n## Documentation\n\nThe full documentation is published on GitHub Pages: [GeneralManager Documentation](https://timkleindick.github.io/general_manager/). It covers tutorials, concept guides, API reference, and examples.\n\n## Key Features\n\n- **Domain-first modelling**: Describe rich business entities in plain Python and let GeneralManager project them onto the Django ORM.\n- **GraphQL without boilerplate**: Generate a complete API, then extend it with custom queries and mutations when needed.\n- **Attribute-based access control**: Enforce permissions with explicit additive or override manager-based permission classes down to single fields and operations.\n- **Deterministic calculations**: Ship reusable interfaces e.g. for volume distributions, KPI calculations, and derived data.\n- **Factory-powered testing**: Create large, realistic datasets quickly for demos, QA, and load tests.\n- **Composable interfaces**: Connect to databases, spreadsheets, or computed sources with the same consistent abstractions.\n\n## Quick Start\n\n### Installation\n\nInstall the package from PyPI:\n\n```bash\npip install GeneralManager\n```\n\n### Minimal example\n\n```python\nfrom datetime import date\nfrom typing import Optional\n\nfrom django.db.models import CharField, DateField\n\nfrom general_manager import GeneralManager\nfrom general_manager.interface import DatabaseInterface\nfrom general_manager.measurement import Measurement, MeasurementField\nfrom general_manager.permission import AdditiveManagerPermission\n\n\nclass Project(GeneralManager):\n    name: str\n    start_date: Optional[date]\n    end_date: Optional[date]\n    total_capex: Optional[Measurement]\n\n    class Interface(DatabaseInterface):\n        name = CharField(max_length=50)\n        start_date = DateField(null=True, blank=True)\n        end_date = DateField(null=True, blank=True)\n        total_capex = MeasurementField(base_unit=\"EUR\", null=True, blank=True)\n\n    class Permission(AdditiveManagerPermission):\n        __read__ = [\"public\"]\n        __create__ = [\"isAdmin\"]\n        __update__ = [\"isAdmin\"]\n\n\nProject.Factory.createBatch(10)\n```\n\nThe example above defines a project model, exposes it through the auto-generated GraphQL schema, and produces ten sample records with a single call. The full documentation walks through extending this setup with custom rules, interfaces, and queries.\n\nIf you want global permission defaults for managers that use\n`AdditiveManagerPermission` or `OverrideManagerPermission`, configure them in Django settings:\n\n```python\nGENERAL_MANAGER = {\n    \"DEFAULT_PERMISSIONS\": {\n        \"READ\": [\"public\"],\n        \"CREATE\": [\"isAuthenticated\"],\n        \"UPDATE\": [\"isAuthenticated\"],\n        \"DELETE\": [\"isAuthenticated\"],\n    }\n}\n```\n\n## Core Building Blocks\n\n- **Entities \u0026 interfaces**: Compose domain entities with database-backed or computed interfaces to control persistence and data flows.\n- **Rules \u0026 validation**: Protect your data with declarative constraints and business rules that run automatically.\n- **Permissions**: Implement attribute-based access control with reusable policies that match your organisation’s roles.\n- **GraphQL layer**: Serve a typed schema that mirrors your models and stays in sync as you iterate.\n- **Caching \u0026 calculations**: Use the built-in caching decorator and calculation helpers to keep derived data fast and reliable.\n\n## Production-Ready Extras\n\n- Works with Postgres, SQLite, and any database supported by Django.\n- Plays nicely with CI thanks to deterministic factories, typing, and code coverage.\n- Ships with MkDocs documentation, auto-generated API reference, and a growing cookbook of recipes.\n- Designed for teams: opinionated defaults without blocking custom extensions or overrides.\n\n## Upgrade Note\n\nDatabase-backed and existing-model managers now refresh in place after `update()` and return the same manager instance. History-capable managers also expose `manager.history` as the audit trail queryset scoped to that object's ID, while `search_date=...` still resolves a point-in-time snapshot of manager state. After `delete()`, that manager instance is invalidated for subsequent field reads, even when the underlying row was soft-deleted via an `is_active` flag. See the [Existing Model Interfaces guide](docs/concepts/interfaces/existing_model_interface.md) and [Database Interfaces guide](docs/concepts/interfaces/db_based_interface.md) for the current lifecycle contract and factory/history implications.\n\n## Use Cases\n\n- Internal tooling that mirrors real-world workflows, pricing models, or asset hierarchies.\n- Customer-facing platforms that combine transactional data with live calculations.\n- Analytics products that need controlled data sharing between teams or clients.\n- Proof-of-concept projects that must scale into production without a rewrite.\n\n## Requirements\n\n- Python \u003e= 3.12\n- Django \u003e= 5.2\n- Additional dependencies (see `requirements/base.txt`):\n  - `graphene`\n  - `numpy`\n  - `Pint`\n  - `factory_boy`\n  - and more.\n\n## License\n\nThis project is distributed under the **MIT License**. For further details see the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkleindick%2Fgeneral_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkleindick%2Fgeneral_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkleindick%2Fgeneral_manager/lists"}