Skip to main content

A Python library easing use of Jordan in your Python code.

Project description

Jordan ?

Jordan project let an executing program being interacted with, from anywhere. Once registered to a Jordan server, a program instance becomes a Jordan client which may emit statuses (such as logs and progress details), and may react to some user action. For example, a Human user may want to trigger an email sending for reporting purpose. Actions are generic, as much as the App GUI. Therefore, you already have an App for your program !

Get started

  1. Get a working Jordan server instance

  2. Import jordan

     from jordan_py import jordan
    
  3. In your Python program, register to this server

     jordan_instance = jordan.register('<jordan_server_url>')
    
    1. Send a status

       jordan_instance.send_status('The program is well started.')
      
    2. React on received message

       while True:
           if jordan_message = jordan_instance.read_message():
                   if jordan_message.action_name == 'BREAK_LOOP':
                       break
      

More use cases

Explore samples for details on features like :

  • action
  • task
  • status type

Action

Has a name, and optionally (typed) (defaulted) parameters. e.g.

        actions = jordan.with_action('send_email')
                .with_parameter('recipient')
                .with_parameter('delay', jordan.PARAMETER_TYPE_INT, 0)
                .build()

        jordan_instance = jordan.register('<jordan_server_url>', 'sample-client-sending-email', actions)

Task

Hierarchy of task/sub-task. The jordan client instance returned by register() function is a root task.

    meal_task = dinner_jordan_instance.create_task('meal')
    dessert_task = dinner_jordan_instance.create_task('dessert')
    meal_task.send_status('Not enough food in storage')
    dessert_task.send_status('Dessert is ready')

Status Type

May be easier to understand and analyze statuses (in a client app which allows filtering).

    meal_task.send_failure_status('Not enough food in storage')
    dessert_task.send_status('Dessert is being prepared')
    dessert_task.send_progress(50)
    dessert_task.send_success_status('Dessert is ready')
    dessert_task.send_typed_status('eaten', 'Dessert has been eaten by Michael')

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

jordan_py-2.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

jordan_py-2.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file jordan_py-2.0.0.tar.gz.

File metadata

  • Download URL: jordan_py-2.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jordan_py-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3cc5c0173ab6848351a83cae693b2946bf3376edd2c4db34afeef9fa8bdfb26c
MD5 112521a07d8a3f389a097247c8e51b1d
BLAKE2b-256 c2f66df4ffd784614007d84c7e9844fa14a8feafd54d355254634f3e203e8140

See more details on using hashes here.

Provenance

The following attestation bundles were made for jordan_py-2.0.0.tar.gz:

Publisher: release-library-python.yml on Mara-tech/jordan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jordan_py-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: jordan_py-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jordan_py-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78967996c587ce1bc13c067a163b8333ceb500dd5490bdc974b1b1098dd0a799
MD5 57986a11adae7d498d588e5a6614c15d
BLAKE2b-256 d14e1cae4bcf2c00bb046f6dc1def3fee240d01db9e59200d1bf10d064d2839a

See more details on using hashes here.

Provenance

The following attestation bundles were made for jordan_py-2.0.0-py3-none-any.whl:

Publisher: release-library-python.yml on Mara-tech/jordan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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