{"id":24016454,"url":"https://github.com/zechcodes/schism","last_synced_at":"2026-02-24T06:31:43.841Z","repository":{"id":113941662,"uuid":"455613806","full_name":"ZechCodes/Schism","owner":"ZechCodes","description":"Schism is an autowiring library that makes modularity simple in monolithes and simplifies code sharing in microservices.","archived":false,"fork":false,"pushed_at":"2025-04-01T21:29:17.000Z","size":204,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T03:16:02.878Z","etag":null,"topics":["microservice-framework","microservices","microservices-application","microservices-architecture","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZechCodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-04T16:14:54.000Z","updated_at":"2025-04-01T21:29:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"12bd6827-b862-4655-a8b3-de4c5703e3ff","html_url":"https://github.com/ZechCodes/Schism","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ZechCodes/Schism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZechCodes%2FSchism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZechCodes%2FSchism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZechCodes%2FSchism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZechCodes%2FSchism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZechCodes","download_url":"https://codeload.github.com/ZechCodes/Schism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZechCodes%2FSchism/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261055535,"owners_count":23103231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["microservice-framework","microservices","microservices-application","microservices-architecture","python","python3"],"created_at":"2025-01-08T08:51:27.673Z","updated_at":"2026-02-24T06:31:38.812Z","avatar_url":"https://github.com/ZechCodes.png","language":"Python","readme":"# Schism\n\nSchism is a service framework designed to simplify the process of splitting a single application into multiple services. It provides autowiring capabilities that make modularity straightforward in monolithic applications and facilitates code sharing in microservices architectures.\n\n## Installation\n\n```bash\npip install schism\n```\n\n## Usage\n\nSchism is designed to have the smallest possible API surface area. You just need to create a service type that inherits from `schism.Service`. You can use [Bevy's](https://github.com/ZechCodes/Bevy) dependency injection to inject services into any function.\n\nCreating a `schism.config.yaml` file in the root of your project will allow you to define the services that should be available in your application and how they should be exposed. Bevy then handles injecting the correct client facades into your functions so you can interact with the services as if they are still part of the same application. \n\nTo launch a service either set the `SCHISM_ACTIVE_SERVICE` environment variable to the name of the service to run using the `schism run` command. Alternatively pass the name to the `schism run service` command. Schism then starts the  appropriate bridge servers using the configuration in the `schism.config.yaml`.\n\nTo run a client application that understands the running services use the `schism run` command. Pass it the desired  module and callback (ex. `module.path:callback`) that you want to run (alternatively set up a launch config). Schism handles injecting the appropriate service client facades into the runtime before running the callback.\n\n### Example\n\nHere's a basic example of a service that provides a simple greeting.\n\n```python\n# greetings.py\nfrom bevy import inject, dependency\nfrom schism import Service, start_app\n\nclass GreetingService(Service):\n    async def greet(self, name: str) -\u003e str:\n        print(\"Handling request...\")\n        return f\"Hello, {name}!\"\n\n\n@inject\nasync def greet(greeting_service: GreetingService = dependency()):\n    print(await greeting_service.greet(\"World\"))\n\n\nasync def main():\n    await greet()\n\n\nif __name__ == \"__main__\":\n    start_app(main())  # Activate a Schism controller and launch the app\n```\nHere is the corresponding `schism.config.yaml` file:\n\n```yaml\nlaunch:\n  app: greetings:main\nservices:\n  - name: greeting\n    service: greetings:GreetingService\n    bridge:\n      type: schism.ext.bridges.simple_tcp:SimpleTCP\n      serve_on: localhost:1234\n```\n\nTo run you must first start the greetings service with this command:\n\n```bash\nschism run service greeting\n```\n\nThen you can run the script and that accesses the service by passing `schism.run` the entry point coroutine:\n\n```bash\nschism run\n```\n\nAlternatively you can run it as a normal Python script with no client facades where everything runs in a single process.\n\n```bash\npython greetings.py\n```\nor\n```bash\npython -m greetings\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzechcodes%2Fschism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzechcodes%2Fschism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzechcodes%2Fschism/lists"}