All Projects → tmux-python → Libtmux

tmux-python / Libtmux

Licence: mit
⚙️ python api for tmux

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Libtmux

Aegis.cpp
Discord C++ library for interfacing with the API. Join our server:
Stars: ✭ 198 (-66.94%)
Mutual labels:  api, library
Stripe
A comprehensive PHP Library for the Stripe.
Stars: ✭ 256 (-57.26%)
Mutual labels:  api, library
Messenger4j
A Java library for building Chatbots on the Facebook Messenger Platform - easy and fast.
Stars: ✭ 199 (-66.78%)
Mutual labels:  api, library
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-68.61%)
Mutual labels:  api, library
React Native Vision Camera
📸 The Camera library that sees the vision.
Stars: ✭ 443 (-26.04%)
Mutual labels:  api, library
Libmoji
📚 Bitmoji's API made easy for everyone
Stars: ✭ 189 (-68.45%)
Mutual labels:  api, library
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (-59.6%)
Mutual labels:  api, library
Coinbasepro Csharp
The unofficial .NET/C# client library for the Coinbase Pro/GDAX API
Stars: ✭ 143 (-76.13%)
Mutual labels:  api, library
Yandex Music Api
Неофициальная Python библиотека для работы с API сервиса Яндекс.Музыка
Stars: ✭ 335 (-44.07%)
Mutual labels:  api, library
Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+3656.43%)
Mutual labels:  api, library
Riot Api Java
Riot Games API Java Library
Stars: ✭ 184 (-69.28%)
Mutual labels:  api, library
Instapy Cli
✨ Python library and CLI to upload photo and video on Instagram. W/o a phone!
Stars: ✭ 498 (-16.86%)
Mutual labels:  api, library
Item Nbt Api
Add custom NBT tags to Items/Tiles/Entities without NMS!
Stars: ✭ 163 (-72.79%)
Mutual labels:  api, library
Newsapi Python
A Python Client for News API
Stars: ✭ 196 (-67.28%)
Mutual labels:  api, library
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (-74.62%)
Mutual labels:  api, library
Instagram Api Python
Unofficial instagram API, give you access to ALL instagram features (like, follow, upload photo and video and etc)! Write on python.
Stars: ✭ 2,357 (+293.49%)
Mutual labels:  api, library
Stripe Sdk
A simple and flexible Stripe library for Flutter with complete support for SCA and PSD2.
Stars: ✭ 120 (-79.97%)
Mutual labels:  api, library
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (-79.8%)
Mutual labels:  api, library
Discordeno
Discord API library for Deno
Stars: ✭ 254 (-57.6%)
Mutual labels:  api, library
Chat Api
WhatsApp's Private API
Stars: ✭ 4,251 (+609.68%)
Mutual labels:  api, library

libtmux - scripting library for tmux

|pypi| |docs| |build-status| |coverage| |license|

libtmux is the tool behind tmuxp_, a tmux workspace manager in python.

it builds upon tmux's target_ and formats_ to create an object mapping to traverse, inspect and interact with live tmux sessions.

view the documentation_ homepage, API_ information and architectural details_.

Python 2.x will be deprecated in libtmux 0.9. The backports branch is v0.8.x_.

.. _v0.8.x: https://github.com/tmux-python/libtmux/tree/v0.8.x

install

.. code-block:: sh

$ [sudo] pip install libtmux

open a tmux session

session name foo, window name bar

.. code-block:: sh

$ tmux new-session -s foo -n bar

pilot your tmux session via python

.. code-block:: sh

$ python

or for nice autocomplete and syntax highlighting

$ pip install ptpython $ ptpython

connect to a live tmux session:

.. code-block:: python

>>> import libtmux
>>> server = libtmux.Server()
>>> server
<libtmux.server.Server object at 0x7fbd622c1dd0>

list sessions:

.. code-block:: python

>>> server.list_sessions()
[Session($3 foo), Session($1 libtmux)]

find session:

.. code-block:: python

>>> server.get_by_id('$3')
Session($3 foo)

find session by dict lookup:

.. code-block:: python

>>> server.find_where({ "session_name": "foo" })
Session($3 foo)

assign session to session:

.. code-block:: python

>>> session = server.find_where({ "session_name": "foo" })

play with session:

.. code-block:: python

>>> session.new_window(attach=False, window_name="ha in the bg")
Window(@8 2:ha in the bg, Session($3 foo))
>>> session.kill_window("ha in")

create new window in the background (don't switch to it):

.. code-block:: python

>>> w = session.new_window(attach=False, window_name="ha in the bg")
Window(@11 3:ha in the bg, Session($3 foo))

kill window object directly:

.. code-block:: python

>>> w.kill_window()

grab remaining tmux window:

.. code-block:: python

>>> window = session.attached_window
>>> window.split_window(attach=False)
Pane(%23 Window(@10 1:bar, Session($3 foo)))

rename window:

.. code-block:: python

>>> window.rename_window('libtmuxower')
Window(@10 1:libtmuxower, Session($3 foo))

create panes by splitting window:

.. code-block:: python

>>> pane = window.split_window()
>>> pane = window.split_window(attach=False)
>>> pane.select_pane()
>>> window = session.new_window(attach=False, window_name="test")
>>> pane = window.split_window(attach=False)

send key strokes to panes:

.. code-block:: python

>>> pane.send_keys('echo hey send now')

>>> pane.send_keys('echo hey', enter=False)
>>> pane.enter()

grab the output of pane:

.. code-block:: python

>>> pane.clear()  # clear the pane
>>> pane.send_keys('cowsay hello')
>>> print('\n'.join(pane.cmd('capture-pane', '-p').stdout))

::

sh-3.2$ cowsay 'hello'
 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

powerful traversal features::

>>> pane.window
Window(@10 1:libtmuxower, Session($3 foo))
>>> pane.window.session
Session($3 foo)

.. _developing and testing: http://libtmux.git-pull.com/developing.html .. _tmuxp: https://tmuxp.git-pull.com/ .. _documentation: https://libtmux.git-pull.com/ .. _API: https://libtmux.git-pull.com/api.html .. _architectural details: https://libtmux.git-pull.com/about.html .. _formats: http://man.openbsd.org/OpenBSD-5.9/man1/tmux.1#FORMATS .. _target: http://man.openbsd.org/OpenBSD-5.9/man1/tmux.1#COMMANDS

Donations

Your donations fund development of new features, testing and support. Your money will go directly to maintenance and development of the project. If you are an individual, feel free to give whatever feels right for the value you get out of the project.

See donation options at https://git-pull.com/support.html.

Project details

.. _MIT: http://opensource.org/licenses/MIT

.. |pypi| image:: https://img.shields.io/pypi/v/libtmux.svg :alt: Python Package :target: http://badge.fury.io/py/libtmux

.. |docs| image:: https://github.com/tmux-python/libtmux/workflows/Publish%20Docs/badge.svg :alt: Docs :target: https://github.com/tmux-python/libtmux/actions?query=workflow%3A"Publish+Docs"

.. |build-status| image:: https://github.com/tmux-python/libtmux/workflows/tests/badge.svg :alt: Build Status :target: https://github.com/tmux-python/tmux-python/actions?query=workflow%3A"tests"

.. |coverage| image:: https://codecov.io/gh/tmux-python/libtmux/branch/master/graph/badge.svg :alt: Code Coverage :target: https://codecov.io/gh/tmux-python/libtmux

.. |license| image:: https://img.shields.io/github/license/tmux-python/libtmux.svg :alt: License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].