Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Morpho Logo

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

  1. make sure to use at least python 3.8
  2. clone the repo git clone https://github.com/B4rtware/morpho.git
  3. cd morpho and install dependencies via
    • poetry 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

  1. Run the following command poetry version <version>
    Morpho uses the following schema: ^\d+\.\d+\.\d+((b|a)\d+)?$

  2. Bump the version within the file: morpho/__version__.py
    Make sure it's the same version used when bumping with poetry

  3. Open Changelog.md and write the new changelog:

    • Use the following # header: v<version> - (dd.mm.yyyy)
      Used ## headers:
    • 💌 Added
    • 🔨 Fixed
    • ♻️ Changed
  4. Stage the modified files and push them with the following commit message:

    chore: bump to version <version>

  5. Run the following command poetry build to create a tarball and a wheel based on the new version

  6. Create a new github release and:

    1. Copy and paste the changelog content without the # header into the description of the release textbox
    2. Use the # header style to fill in the Release title (copy it from the Changelog.md)
    3. Copy the version with the v-prefix into the Tag version
  7. Attach the produced tarball and wheel (dist/) to the release

  8. Check This is a pre-release if it's either an alpha or beta release (a|b) - optional

  9. Publish release

📝 License

MIT

Metadata

Release files for morpho 1.0.0b8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for morpho 1.0.0b8
File Size Uploaded Provenance
morpho-1.0.0b8.tar.gz 19.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for morpho 1.0.0b8
File Interpreter ABI Platform
morpho-1.0.0b8-py3-none-any.whl Python 3 none any Details

Total release size: 41.9 kB

Release files / morpho-1.0.0b8.tar.gz

Download URL morpho-1.0.0b8.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
018375c398bfe870956a611af02008642872628bb140c02c5472327558a8feb2
BLAKE2b-256 checksum
How to use checksums
7662665e35fd01d29a54124f57e8a3232fd91a14801f79f55767b1f96a46babb
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.0b8-py3-none-any.whl

Download URL morpho-1.0.0b8-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1310734a7f5733d799731f12ff14c505a0088d536eb4458e7ca4e95e07b6019f
BLAKE2b-256 checksum
How to use checksums
321a8d5716dc8f4ae9ca0fc121dcd791692c5da43fa9ed62c4711a7609b79fdd
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

Security for morpho 1.0.0b8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page