|
| 1 | +# Protean |
| 2 | + |
| 3 | +**Protean** is an opinionated and pragmatic framework for building event-driven applications using the CQRS pattern. |
| 4 | + |
| 5 | +[](https://pypi.org/project/protean/) |
| 6 | +[](https://github.com/proteanhq/protean/actions/workflows/ci.yml) |
| 7 | +[](https://codecov.io/gh/proteanhq/protean) |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +Protean is available on PyPI: |
| 12 | + |
| 13 | +```console |
| 14 | +$ python -m pip install protean |
| 15 | +``` |
| 16 | + |
| 17 | +Protean officially supports Python 3.11+. |
| 18 | + |
| 19 | +## Quick Start |
| 20 | + |
| 21 | +```python |
| 22 | +from protean import Domain |
| 23 | +from protean.fields import String, Text |
| 24 | + |
| 25 | +domain = Domain(__file__, "Publishing") |
| 26 | + |
| 27 | +@domain.aggregate |
| 28 | +class Post: |
| 29 | + title = String(required=True, max_length=1000) |
| 30 | + slug = String(required=True, max_length=1024) |
| 31 | + content = Text(required=True) |
| 32 | + |
| 33 | +domain.init() |
| 34 | +with domain.domain_context(): |
| 35 | + post = Post( |
| 36 | + title="Hello World", |
| 37 | + slug="hello-world", |
| 38 | + content="Lorem Ipsum ..." |
| 39 | + ) |
| 40 | + |
| 41 | + domain.repository_for(Post).add(post) |
| 42 | +``` |
| 43 | + |
| 44 | +## Documentation |
| 45 | + |
| 46 | +Online docs are available at https://docs.proteanhq.com. |
| 47 | + |
| 48 | +## Contributing |
| 49 | + |
| 50 | +1. Check for open issues or open a fresh issue to start a discussion |
| 51 | + around a feature idea or a bug. |
| 52 | +2. Fork [the repository](https://github.com/proteanhq/protean) on |
| 53 | + GitHub, branch off `main` and start making your changes. |
| 54 | +3. Write a test which shows that the bug was fixed or that the feature |
| 55 | + works as expected. |
| 56 | +4. Send a pull request and bug the maintainer until it gets merged and |
| 57 | + published. |
| 58 | + |
| 59 | +For more information, please check out the |
| 60 | +[contributing guidelines](https://docs.proteanhq.com/community/contributing/). |
| 61 | + |
| 62 | +## License |
| 63 | + |
| 64 | +BSD 3-Clause License |
| 65 | + |
| 66 | +Copyright (c) 2018-2024, Subhash Bhushan C. |
| 67 | +All rights reserved. |
| 68 | + |
| 69 | +Redistribution and use in source and binary forms, with or without modification, |
| 70 | +are permitted provided that the following conditions are met: |
| 71 | + |
| 72 | +* Redistributions of source code must retain the above copyright notice, this |
| 73 | +list of conditions and the following disclaimer. |
| 74 | + |
| 75 | +* Redistributions in binary form must reproduce the above copyright notice, |
| 76 | +this list of conditions and the following disclaimer in the documentation |
| 77 | +and/or other materials provided with the distribution. |
| 78 | + |
| 79 | +* Neither the name of the copyright holder nor the names of its contributors |
| 80 | +may be used to endorse or promote products derived from this software |
| 81 | +without specific prior written permission. |
| 82 | + |
| 83 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 84 | +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 85 | +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 86 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 87 | +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 88 | +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 89 | +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 90 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 91 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 92 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 commit comments