Import Python packages from remote.
Project description
Fetch-import
It is convenient to quickly import Python packages from the network.
Docs
Example remote module file is "https://fastly.jsdelivr.net/gh/zmaplex/fetch_import@main/example/sets.py"
@im_fetch
Using this Decorator, you can load resources remotely as conveniently as import.
- Replace
import
import sets
sets.def_function()
Equivalent:
from fetch_import import im_fetch
url = "https://fastly.jsdelivr.net/gh/zmaplex/fetch_import@main/example/sets.py"
@im_fetch(url)
def main():
sets.def_function()
- Replace
from package import *
from sets import *
obj = ObjectClass()
def_function()
Equivalent:
from fetch_import import im_fetch
@im_fetch(url,["*"])
def main():
obj = ObjectClass()
def_function()
- Replace
from package import attr1,attr2
from sets import ObjectClass,def_function
obj = ObjectClass()
def_function()
Equivalent:
from fetch_import import im_fetch
@im_fetch(url,["ObjectClass","def_function"])
def main():
obj = ObjectClass()
def_function()
How to use?
step 1
pip install fetch-import
pip -r requirements.txt
step 2
from fetch_import import im_fetch
ydl_opts = {
'f': 'bestvideo+bestaudio[ext=m4a]',
'ratelimit': 1024 * 1024 * 1024,
'merge-output-format': 'mp4'}
job_args = {
"job_id": "63ba4e4e67cf417ab6a27365cecabec5",
"plugin_args": {
"url": "https://www.youtube.com/watch?v=UvuJx7rVUxg",
"ydl_opts": ydl_opts
}
}
url = "https://fastly.jsdelivr.net/gh/zmaplex/fetch_import@main/example/youtube_downloader.py"
@im_fetch(url)
def main():
yd = youtube_downloader.YoutubeDownloader()
yd.run(**job_args)
if __name__ == '__main__':
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fetch_import-0.0.7.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for fetch_import-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c13b7aa05b4b538dcd84028fadfc600a8cfa2e8ec6ccc1d1154f48131750554 |
|
MD5 | 1a57e05ebf690557266e3a251f0ac323 |
|
BLAKE2b-256 | 4ff3cb782eee3996b11c0c47debde7701d7258ce314f2a68049ac60fcbb1e9c6 |