Code Monkey home page Code Monkey logo

referencemedic's Introduction

Reference Medic

Are you tired of manually updating file references in your project? Look no further than Reference Medic! This tool scans your project's files and updates any file references to adhere to your specified file structure.

Getting Started

To use Reference Medic, simply run the script and provide the top-level folder of your project as the argument. The script will then recursively scan through all subfolders and update any file references as necessary.

ReferenceMedic("path/to/project_folder") File Structure Rules Reference Medic currently supports the following file structure rules:

For Jupyter Notebooks

  • If the file being referenced is a .json file, the relative path will be changed to ../config/{filename}
  • If the file being referenced is a .csv file, the relative path will be changed to ../config/{filename}
  • .html files are now stored in the ../html folder
  • .css files are in the ../css folder
  • Any image files (.jpg, .jpeg, .png, .gif) are now in the ../images folder
  • .log files are in the ../logs folder
  • .py files are now in ../src
  • .txt files are in ../txt

For Python Scripts

  • If the file being referenced is a .json file, the relative path will be changed to ./config/{filename}
  • If the file being referenced is a .csv file, the relative path will be changed to ./config/{filename}
  • .html files are now stored in the ./html folder
  • .css files are in the ./css folder
  • Any image files (.jpg, .jpeg, .png, .gif) are now in the ./images folder
  • .log files are in the ./logs folder
  • .py files are now in ./src
  • .txt files are in ./txt
  • Any other file types will raise an error.

Before Reference Medic

with open("ppn_deck.json", "r") as read_file:
    card_deck = json.load(read_file)

After Reference Medic

with open("../config/ppn_deck.json", "r") as read_file:
    card_deck = json.load(read_file)

Additional Features

You can also customize the script to your own file structure rules by editing the code.

Built With

  • Python
  • Jupyter Notebook
  • Visual Studio Code
  • os
  • pathlib
  • json
  • re

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

referencemedic's People

Contributors

grahamwaters avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.