Skip to main content

Python wrapper for Go applications with PowerShell launcher

Reason this release was yanked:

Broken

Project description

pygops

Python wrapper for running Go applications via PowerShell.

pip install pygops

Requirements

  • Python 3.8 or higher

  • PowerShell installed and accessible in PATH

  • Go installed for running Go applications

  • Dependencies (installed automatically):

    • loguru
    • toomanyports
    • aiohttp (for server health checks)

Usage

Launch a Go script manually

from pygops import GoLauncher

launcher = GoLauncher(
    go_file="path/to/script.go",
    script_path=script_path,
    verbose=True,
    port=5000  # optional: will kill existing or choose random if omitted
)
launcher.thread.start()

Run a Go server with health check

import asyncio
from pygops import GoServer, get_go_launcher_script

script = get_go_launcher_script()
server = GoServer(
    go_file="path/to/main.go",
    script_path=script,
    port=4000,
    verbose=True
)

async def main():
    await server.start()
    running = await server.is_running()
    print(f"Server running: {running}")
    # ... later ...
    await server.stop()

asyncio.run(main())

Execute Go script in its own thread

from pygops import GoThread, get_go_launcher_script

thread = GoThread(
    go_file="path/to/task.go",
    script_path=get_go_launcher_script(),
    go_args=["--flag", "value"],
    verbose=True
)
thread.start()
# Do other work...
if thread.is_running():
    thread.terminate()

License

Released under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygops-0.1.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygops-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pygops-0.1.2.tar.gz.

File metadata

  • Download URL: pygops-0.1.2.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pygops-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0a5eee526fb6f459a353358d7a3040a3c9c344c5d6dcc1d534736f9d0f8b890b
MD5 1d2f074fce084a5484a243c17260ecf3
BLAKE2b-256 867225d1cc0c9135252ea0d22b3dd17c0f7bfce50b4bc5ce70e70655627f0007

See more details on using hashes here.

File details

Details for the file pygops-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pygops-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pygops-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6217a9e5480932c912c54391a0f53e81c19fbcd27a70e56000c1a607db0b548
MD5 6227dcb4b538298cfde3a8e463bca912
BLAKE2b-256 5d27db02a773a9a936d949c9e234586be4306825bb8a1446a0114f83aad08d59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page