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.3.tar.gz (8.5 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.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wirez_py-1.0.3.tar.gz
  • Upload date:
  • Size: 8.5 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.3.tar.gz
Algorithm Hash digest
SHA256 67f9e42ca0b9cd116b0028a0005c28dd93fc5388acd2c985bafadf56c6b171f8
MD5 8b780c02da6de0a2e94b6be18f2d37a9
BLAKE2b-256 85437876d1558ca6e15c2e8bf1c82d5aa8a2319bbe1aa5864622b59686dc2fea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wirez_py-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f33911239e9aa1ac55207b626da7fa86089453628848062e4f3d0cf5aa899efe
MD5 cfd4fa869799cad04cd52aeb3dfbfd96
BLAKE2b-256 49e9fa0cf60e1bf656d10a7f1cd9daa8425bb10d4ccb589dab9b7625b9570a66

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