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

Uploaded Python 3

File details

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

File metadata

  • Download URL: wirez_py-1.0.4.tar.gz
  • Upload date:
  • Size: 8.7 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.4.tar.gz
Algorithm Hash digest
SHA256 084995c87e0cb38360196ac3bb8d2641ff37ca4afb0e914a2f166067c4c02a0b
MD5 a5d5c29803e434106d04c0682d585c7f
BLAKE2b-256 392dde9260200cc89ef54fc9a4dc085b582b521de72bbb71e6054cfa8e4c86a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wirez_py-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50325d0bc1b1d7058f407c83f0549e8f98769dc756f998cb15d6b8d843b2d0dd
MD5 f66da6874edb9a2ee3fdb125d1e3adb8
BLAKE2b-256 ab068b6640bb0c6747d13116fc9bf87d95c57602d62a9d128525b761b49b0160

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