Genesis
Genesis is a Python library designed to build asynchronous applications that interact with FreeSWITCH through the Event Socket Layer (ESL).
Features
- Asynchronous by Design: Built with
asynciofor high-performance, non-blocking I/O. - Inbound, Outbound, and Consumer Modes: Supports all major ESL modes for comprehensive FreeSWITCH integration.
- Decorator-Based Event Handling: A simple and intuitive way to handle FreeSWITCH events.
- OpenTelemetry Support: Built-in instrumentation for tracing connections and commands.
- Extensible and Customizable: Easily extend and customize the library to fit your needs.
Installation
Install Genesis using pip:
pip install genesis
For better asyncio performance on Unix (Linux and macOS), use the optional uvloop extra: pip install genesis[uvloop]. See the Installation Guide for details.
Quickstart
Inbound Socket Mode
import asyncio
from genesis import Inbound
async def uptime():
async with Inbound("127.0.0.1", 8021, "ClueCon") as client:
return await client.send("uptime")
async def main():
response = await uptime()
print(response)
asyncio.run(main())
Consumer Mode
import asyncio
from genesis import Consumer
app = Consumer("127.0.0.1", 8021, "ClueCon")
@app.handle("HEARTBEAT")
async def handler(event):
await asyncio.sleep(0.001)
print(event)
asyncio.run(app.start())
Outbound Socket Mode
import asyncio
from genesis import Outbound
async def handler(session):
await session.answer()
await session.playback('ivr/ivr-welcome')
await session.hangup()
app = Outbound(handler, "127.0.0.1", 5000)
asyncio.run(app.start())
Documentation
Full documentation is available on the documentation website.
To preview the docs locally, install Hugo and run:
hugo server --source docs --disableFastRender
Running Tests
Install development dependencies with Poetry and execute the test suite using tox:
poetry install
tox
How to Contribute
Contributions are welcome! Whether it's improving documentation, suggesting new features, or fixing bugs, your help is appreciated.
Please read our Contributing Guide and Code of Conduct to get started.
Contributors
|
Vitor Hugo |
RL |
Dongwoon Kim |
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Release files for genesis 2026.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| genesis-2026.7.1.tar.gz | 52.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| genesis-2026.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 120.8 kB
Release files / genesis-2026.7.1.tar.gz
| Download URL | genesis-2026.7.1.tar.gz |
|---|---|
| Size | 52.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90613b1436cdfbc5af785f6418db47e58270bca1e87c53d752e3a4deee14e5f4
|
|
BLAKE2b-256 checksum How to use checksums |
bcea39cb15927ddb3abb334bb459c6ae348cb4bd4c18e62d666c39196ca3a79d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.2 Linux/6.17.0-1018-azure
|
Release files / genesis-2026.7.1-py3-none-any.whl
| Download URL | genesis-2026.7.1-py3-none-any.whl |
|---|---|
| Size | 68.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
299ca135ba7ab454a2dcbb88ccd1573bceb6803ff9ae04c6cf4ee4faca8c06e7
|
|
BLAKE2b-256 checksum How to use checksums |
a77dc3718f9d2e782be4738025c30910e7d21a82a8620b8f5be5001484eca959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.10.2 Linux/6.17.0-1018-azure
|