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.1.tar.gz (7.6 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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mergething-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for mergething-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1704ce18d350c981afdd092afb4e7e8253636f0fff577f3c8e08e47faaaa14b6
MD5 eb106bbeb07240183fb13a07aeb68795
BLAKE2b-256 bfe0fc1eb4f31ac17ce634a001a78935f555ce0e0f52bd59be407d9a6c927ace

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mergething-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for mergething-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 568bcf489f846f9830c9d6bed6586e7611fadb73445268798c053b27adf14262
MD5 30f0a76cfa4a263d4d854fa6a9026b48
BLAKE2b-256 bebab85fe7ac1360a3a52eb4d7f8764e491c1757fdb696264ecd442ad5278ebb

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