This release is a pre-release and may not be stable for production use.
Python port for the go written doctrans
Morpho is a framework for microservice based web services. It offers the ability to transform a given document with a provided function.
In the first place this framework was created to be used for research purposes.
💡 Installation
pip install morpho
via git
- make sure to use at least python 3.8
- clone the repo
git clone https://github.com/B4rtware/morpho.git cd morphoand install dependencies viapoetry install(Poetry) or- use the provided
requirements.txt
⚙️ Server Example
... without options
service.py
from morpho.server import Service
def work(document: str) -> str:
return document
service = Service(name="Echo", version="0.0.1")
if __name__ == "__main__":
service.run()
... with options
service.py
from morpho.server import Service
from pydantic import BaseModel
class Options(BaseModel):
name: str
def work(document: str, options: Options) -> str:
return document + options.name
service = Service(name="AppendName", version="0.0.1", options_type=Options)
if __name__ == "__main__":
service.run()
🖥️ Client Example
client.py
from morpho.client import Client
from morpho.client import ClientConfig
morpho = Client(ClientConfig("http://localhost:8761/eureka/"))
response = morpho.transform_document(
"This is a Document!",
service_name="Echo"
)
print(response.document)
>>> This is a Document!
👩🏽💻 Development
Creating a new release
-
Run the following command
poetry version <version>
Morpho uses the following schema:^\d+\.\d+\.\d+((b|a)\d+)?$ -
Bump the version within the file:
morpho/__version__.py
Make sure it's the same version used when bumping with poetry -
Open
Changelog.mdand write the new changelog:- Use the following
#header:v<version> - (dd.mm.yyyy)
Used##headers: - 💌 Added
- 🔨 Fixed
- ♻️ Changed
- Use the following
-
Stage the modified files and push them with the following commit message:
chore: bump to version
<version> -
Run the following command
poetry buildto create a tarball and a wheel based on the new version -
Create a new github release and:
- Copy and paste the changelog content without the
#header into the description of the release textbox - Use the
#header style to fill in the Release title (copy it from theChangelog.md) - Copy the version with the
v-prefix into the Tag version
- Copy and paste the changelog content without the
-
Attach the produced tarball and wheel (
dist/) to the release -
Check This is a pre-release if it's either an alpha or beta release (a|b) - optional
-
Publish release
📝 License
MIT
Release files for morpho 1.0.0b3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| morpho-1.0.0b3.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| morpho-1.0.0b3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:41.8 kB
Release files / morpho-1.0.0b3.tar.gz
| Download URL | morpho-1.0.0b3.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1d64fa7da3340104c5b198266eef22d2766bd6f39d68c19144b00b07e917d41
|
|
BLAKE2b-256 checksum How to use checksums |
7e6761d702e2c2fadf002d7371660057a897244b32e0f673a648c443f0d4d558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.8.5 Linux/4.15.0-1077-aws
|
Release files / morpho-1.0.0b3-py3-none-any.whl
| Download URL | morpho-1.0.0b3-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1a2ff5a794e5bc131c3c16afe50ae7540f740dcf4b8a6f1ad4bed3d4b995909
|
|
BLAKE2b-256 checksum How to use checksums |
d364dec70ad1ce7619fd28ee102419e08e195d1b43858623e933f5a31af5da93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.8.5 Linux/4.15.0-1077-aws
|