Skip to content

zZarby/orly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation


☁️ ORLY ☁️


Yes, if you are looking for an open-source module to automatically import your dependencies and handle installation errors with ease, you are in the right place!



✔ Basic Example ✔

import orly
orly.set([
    'requests',
    'os'
])

print(requests.get('https://nohello.net').status_code)

⚙️ Features ⚙️

  • ✅ Auto-installs missing modules using pip
  • ✅ Supports aliasing (module~~alias)
  • ✅ Handles modules with different pip names (py_mod==pip_package)
  • ✅ Silent mode to suppress internal logs/prints (*)
  • ✅ Compatible with Linux systems requiring --break-system-packages
  • ✅ Clean console output (auto clear after each import)

🧠 Advanced Usage 🧠

import orly
orly.set([
    'requests~~req',            # 'requests' accessible as 'req'
    'bs4==beautifulsoup4',      # 'bs4' is imported; pip package name is "beautifulsoup4"
    'discord',                  # Normal import
    'discord.ext.commands*'     # Silent import of submodule
])

🛑 Appending * to the module string makes it silent:
‣ Disables print() from the module (if possible)
‣ Disables logging propagation

You can also globally silence everything:

orly.set(['requests', 'pandas', 'numpy'], silent=True)

💖 Auto-Setup 💖

try: 
    import orly
except ImportError:
    try:
        __import__('subprocess').check_call([__import__('sys').executable, "-m", "pip", "install", "orly"])
    except:
        __import__('subprocess').check_call([__import__('sys').executable, "-m", "pip", "install", "orly", "--break-system-packages"])
    finally: 
        import orly

📌 Disclaimer 📌


- This project is for educational purposes only. - Do not use this in any harmful, malicious or unethical way. - I decline any responsibility for misuse.

by Zarby

About

A different way to install missing python modules without using requirements.txt files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages