Skip to main content

App over syncthing that takes care merging things

Project description

mergething

App over syncthing that takes care merging things

Install using pip install mergething

ipython/jupyter

Currently supports merging ipython/jupyter history files.

mergething will give each ipython/jupyter session it's own history file, so in contrast to vanilla ipython, you can run multiple ipython sessions at the same time without worrying about corruption. You can even use mergething on a single machine in order to get this benefit.

When a session is closed, its history file is marked "completed", and once it is incorporated into a new session, it will be deleted (only ever by the same device).

IPython/jupyter History Sync

1. Configure Syncthing

Set up Syncthing to sync a directory across your machines (e.g., ~/syncthing/ipython_history).

2a. Configure IPython using CLI tool

The following line will copy your exisiting history file to the directory and add lines to you ipython_config.py file to use mergething:

mergething init ~/syncthing/ipython_history

2b. Configure IPython manually

Alternatively, you can add these lines to the end of your IPython configuration file manually (~/.ipython/profile_default/ipython_config.py):

try:
    from mergething.ipython import sync_and_get_hist_file
    c.HistoryManager.hist_file = sync_and_get_hist_file("~/syncthing/ipython_history", verbose=False)
except Exception:
    print("mergething: Error syncing and getting history file, using default ipython behavior")

You can also pass the hostname you want files to use, this is useful when multiple devices have the same hostname:

    c.HistoryManager.hist_file = sync_and_get_hist_file("~/syncthing/ipython_history", verbose=False, hostname="mydevice")

For Android/Termux users where the hostname is always "localhost", you can specify a custom hostname:

try:
    from mergething.ipython import sync_and_get_hist_file
    c.HistoryManager.hist_file = sync_and_get_hist_file("~/syncthing/ipython_history", verbose=False, hostname="my_phone")
except Exception:
    print("mergething: Error syncing and getting history file, using default ipython behavior")

Merging existing files

You can use the CLI tool to merge existing files:

mergething merge history1.sqlite history2.sqlite ... historyn.sqlite merged_history.sqlite

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

mergething-0.1.3.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

mergething-0.1.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file mergething-0.1.3.tar.gz.

File metadata

  • Download URL: mergething-0.1.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.12

File hashes

Hashes for mergething-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f5ad2cd62dfb0f47860251a4e05bb121c7865831248dbb62862099f0fc107d03
MD5 b66e9f74828dd3aa1b5faecaec90054c
BLAKE2b-256 751053e662f65a2e5b8e772a299a6344f054301372218bd00380c0f3b446d56a

See more details on using hashes here.

File details

Details for the file mergething-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mergething-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.12

File hashes

Hashes for mergething-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aa68a289b6b735dd2a9e1a7b9799c565268200a35909fa3f13131c0768455364
MD5 12909c89e4f3dde401ce05c09b1149ad
BLAKE2b-256 8beb46d27bac23c14650167514b93088f764a2f4cca016c8f53ccda05af7c2cc

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