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.4.tar.gz (8.4 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.4-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mergething-0.1.4.tar.gz
  • Upload date:
  • Size: 8.4 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.4.tar.gz
Algorithm Hash digest
SHA256 55f41d8662d0b637d72fb811a30dee32baab9cd00bcb08163e9889150a376a82
MD5 cb15e5c0d13aaa917432ecf1ac74232c
BLAKE2b-256 eab4754ae2c54a8ba16df096d94b22049b1f5cccf006eca2e163b16c0a379910

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mergething-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 823fda715201ea3252c74e1d753424adf4b6fa1b6816a96bb54c193df98147dc
MD5 a8508f75e9384fe14c21872d158a61e2
BLAKE2b-256 aca54b4b20027a1d3566d38b4c79c694c2206cc20899c805e4b53f7af523b946

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