Skip to main content

Remember and retrieve file paths by name — from any program, anywhere.

Project description

wirez-py

         _____                    _____                    _____                    _____                    _____
        /\    \                  /\    \                  /\    \                  /\    \                  /\    \
       /::\____\                /::\    \                /::\    \                /::\    \                /::\    \
      /:::/    /                \:::\    \              /::::\    \              /::::\    \              /::::\    \
     /:::/   _/___               \:::\    \            /::::::\    \            /::::::\    \            /::::::\    \
    /:::/   /\    \               \:::\    \          /:::/\:::\    \          /:::/\:::\    \          /:::/\:::\    \
   /:::/   /::\____\               \:::\    \        /:::/__\:::\    \        /:::/__\:::\    \        /:::/__\:::\    \
  /:::/   /:::/    /               /::::\    \      /::::\   \:::\    \      /::::\   \:::\    \       \:::\   \:::\    \
 /:::/   /:::/   _/___    ____    /::::::\    \    /::::::\   \:::\    \    /::::::\   \:::\    \    ___\:::\   \:::\    \
/:::/___/:::/   /\    \  /\   \  /:::/\:::\    \  /:::/\:::\   \:::\____\  /:::/\:::\   \:::\    \  /\   \:::\   \:::\    \
|:::|   /:::/   /::\____\/::\   \/:::/  \:::\____\/:::/  \:::\   \:::|    |/:::/__\:::\   \:::\____\/::\   \:::\   \:::\____\
|:::|__/:::/   /:::/    /\:::\  /:::/    \::/    /\::/   |::::\  /:::|____|\:::\   \:::\   \::/    /\:::\   \:::\   \::/    /
 \:::\/:::/   /:::/    /  \:::\/:::/    / \/____/  \/____|:::::\/:::/    /  \:::\   \:::\   \/____/  \:::\   \:::\   \/____/
  \::::::/   /:::/    /    \::::::/    /                 |:::::::::/    /    \:::\   \:::\    \       \:::\   \:::\    \
   \::::/___/:::/    /      \::::/____/                  |::|\::::/    /      \:::\   \:::\____\       \:::\   \:::\____\
    \:::\__/:::/    /        \:::\    \                  |::| \::/____/        \:::\   \::/    /        \:::\  /:::/    /
     \::::::::/    /          \:::\    \                 |::|  ~|               \:::\   \/____/          \:::\/:::/    /
      \::::::/    /            \:::\    \                |::|   |                \:::\    \               \::::::/    /
       \::::/    /              \:::\____\               \::|   |                 \:::\____\               \::::/    /
        \::/____/                \::/    /                \:|   |                  \::/    /                \::/    /
         ~~                       \/____/                  \|___|                   \/____/                  \/____/

Remember and retrieve file paths by name — from any program, anywhere.

pip install wirez-py

Usage

import wires

# Save / remember a file
wires.save("my_config", "/path/to/config.json")
wires.remember("my_config", "/path/to/config.json")  # same thing

# Retrieve it later — from any program
wires.get("my_config")       # → str path
wires.recall("my_config")    # same thing
wires.path("my_config")      # → pathlib.Path

# See all saved files
wires.list_all()

# Dump all registered files into a folder
wires.dump()                  # → copies everything to ./wirez_dump/
wires.dump("my_backup")       # → copies to ./my_backup/

# Verify all wires (check for missing/moved files)
wires.verify()

# Fix a wire after a file moves
wires.update_path("my_config", "/new/location/config.json")

# Remove a wire
wires.remove("my_config")

# Self-update
wires.update()

Debug & Logging

wires.enable_debug(True)           # verbose output to stderr
wires.enable_warnings(False)       # silence warnings
wires.set_log_file("wires.log")    # custom log file (default: ~/.wires/wires.log)
wires.set_log_file(None)           # disable file logging

How it works

Wires stores all registrations in ~/.wires/registry.json. Every program on the machine shares this registry, so a path saved in one script is instantly accessible in another.

Note: Wires stores paths, not files. If you move or delete a file, use wires.verify() to find broken wires and wires.update_path() to fix them. Use wires.dump() to make a physical backup copy of all your files.

License

MIT

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

wirez_py-1.0.5.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

wirez_py-1.0.5-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file wirez_py-1.0.5.tar.gz.

File metadata

  • Download URL: wirez_py-1.0.5.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0rc2

File hashes

Hashes for wirez_py-1.0.5.tar.gz
Algorithm Hash digest
SHA256 c4e4226d5bfa0619fc9e3e1c9e630cca9e1fd31342e7ebfecf92209004f69577
MD5 d706c5ba31505f1e30638de3c2da1c35
BLAKE2b-256 23a74451ebf5eff09f20fad8d01019fda48217b89b78a6037e6a984f651f6a75

See more details on using hashes here.

File details

Details for the file wirez_py-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: wirez_py-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0rc2

File hashes

Hashes for wirez_py-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4180a9ea11e434c33420323afd8bb85cb9429972d031794472be1dd9dce2c24d
MD5 50846dbb3e241923a7d39e47f2bcb298
BLAKE2b-256 95769420692fcb3365941386b1fa26a9ee374a9a4407aee09707be4d46e1660c

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