Module for remote in-memory Python package/module loading through HTTP/S

Overview

httpimport

Python's missing feature!

The feature has been suggested in Python Mailing List

Remote, in-memory Python package/module importing through HTTP/S

PyPI - Python Version PyPI version Build Status Coverage Badge

CPython 2.7 CPython 3.4 CPython 3.7 Pypy 2.7 Pypy 3.6 Jython 2.7.1

A feature that Python2/3 misses and has become popular in other languages is the remote loading of packages/modules.

httpimport lets Python2/3 packages and modules to be imported directly in Python interpreter's process memory, through remote URIs, and more...

Examples

Load a simple package/module through HTTP/S

>>> with httpimport.remote_repo(['package1','package2','package3'], 'http://my-codes.example.com/python_packages'):
... 	import package1
...

Load directly from a GitHub/BitBucket/GitLab repo

  • Load a python file from a github-gist (using this gist):
import httpimport

url = "https://gist.githubusercontent.com/operatorequals/ee5049677e7bbc97af2941d1d3f04ace/raw/e55fa867d3fb350f70b2897bb415f410027dd7e4"
with httpimport.remote_repo(["hello"], url):
    import hello
hello.hello()
>>> with httpimport.github_repo('operatorequals', 'covertutils', branch = 'master'):
...     import covertutils
... # Also works with 'bitbucket_repo' and 'gitlab_repo'

Load a package/module from HTTP/S directory directly to a variable

>>> module_object = httpimport.load('package1', 'http://my-codes.example.com/python_packages')
>>> module_object
<module 'package1' from 'http://my-codes.example.com/python_packages/package1/__init__.py'>

Load a package/module that depends on other packages/modules in different HTTP/S directories

>>> # A depends on B and B depends on C (A, B, C : Python modules/packages in different domains):
>>> # A exists in "repo_a.my-codes.example.com" |
>>> # B exists in "repo_b.my-codes.example.com" | <-- Different domains
>>> # C exists in "repo_c.my-codes.example.com" |
>>> with httpimport.remote_repo(['C'], 'http://repo_c.my-codes.example.com/python_packages'):
...  with httpimport.remote_repo(['B'], 'http://repo_b.my-codes.example.com/python_packages'):
...   with httpimport.remote_repo(['A'], 'http://repo_a.my-codes.example.com/python_packages'):
...   import A
... # Asks for A, Searches for B, Asks for B, Searches for C, Asks for C --> Resolves --> Imports A
>>>

Load Python packages from archives served through HTTP/S

>>> # with httpimport.remote_repo(['test_package'], 'http://example.com/packages.tar'):
>>> # with httpimport.remote_repo(['test_package'], 'http://example.com/packages.tar.bz2'):
>>> # with httpimport.remote_repo(['test_package'], 'http://example.com/packages.tar.gz'):
>>> # with httpimport.remote_repo(['test_package'], 'http://example.com/packages.tar.xz'): <-- Python3 Only
>>> with httpimport.remote_repo(['test_package'], 'http://example.com/packages.zip'):
... 	import test_package
...
>>>

Serving a package through HTTP/S

$ ls -lR
test_web_directory/:                                                         
total 16                                                                     
drwxrwxr-x. 4 user user 4096 Sep  9 20:54 test_package                       
[...]                  
                                                                             
test_web_directory/test_package:                                             
total 20                                                                     
drwxrwxr-x. 2 user user 4096 Sep  9 20:54 a                                  
drwxrwxr-x. 2 user user 4096 Sep  9 20:54 b                                  
-rw-rw-r--. 1 user user   33 Sep  9 20:54 __init__.py                        
-rw-rw-r--. 1 user user  160 Sep  9 20:54 module1.py                         
-rw-rw-r--. 1 user user  160 Sep  9 20:54 module2.py                         
                                                                             
test_web_directory/test_package/a:                                           
total 4                                                                      
-rw-rw-r--. 1 user user  0 Sep  9 20:54 __init__.py                          
-rw-rw-r--. 1 user user 41 Sep  9 20:54 mod.py                               
                                                                             
test_web_directory/test_package/b:                                           
total 4
-rw-rw-r--. 1 user user  0 Sep  9 20:54 __init__.py
-rw-rw-r--. 1 user user 41 Sep  9 20:54 mod.py

$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

Usage

Importing Remotely

add_remote_repo() and remove_remote_repo()

These 2 functions will add and remove to the default sys.meta_path custom HttpImporter objects, given the URL they will look for packages/modules and a list of packages/modules its one can serve.

>>> import test_package### Contexts

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named test_package
>>>
>>> from httpimport import add_remote_repo, remove_remote_repo
>>> # In the given URL the 'test_package/' is available
>>> add_remote_repo(['test_package'], 'http://localhost:8000/') #  
>>> import test_package
>>>
>>> remove_remote_repo('http://localhost:8000/')
>>> import test_package.module1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named module1

The load() function (as of 0.5.10)

The load() function was added to make module loading possible without Namespace pollution. It is used to programmatically load a module in a variable, and call its objects directly from that variable.

>>> import httpimport
>>> pack1 = httpimport.load('test_package','http://localhost:8000/')
>>> pack1
<module 'test_package' from 'http://localhost:8000//test_package/__init__.py'>
>>>

Contexts

The remote_repo() context

Adding and removing remote repos can be a pain, especially if there are packages that are available in more than one repos. So the with keyword does the trick again:

>>> from httpimport import remote_repo
>>>
>>> with remote_repo(['test_package'], 'http://localhost:8000/') :
...     from test_package import module1
...
>>>
>>> from test_package import module2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name module2

>>> module1.dummy_str
'Constant Loaded'
>>> module1.dummy_func
<function dummy_func at 0x7f7a8a170410>

The Github Use Case!

The dedicated github_repo() context:
>>> from httpimport import github_repo
>>> with github_repo( 'operatorequals', 'covertutils', ) :
...     import covertutils
...
>>> covertutils.__author__
'John Torakis - operatorequals'
>>>
What about branches?
>>> from httpimport import github_repo
>>> with github_repo( 'operatorequals', 'covertutils', branch='py3_compatibility' ) :
...     import covertutils
...
>>> covertutils.__author__
'John Torakis - operatorequals'
>>>
And ad-hoc commits too?

What if you need to stick to a fixed -known to work- commit?

>>> from httpimport import github_repo
>>> with github_repo( 'operatorequals', 'covertutils', commit='cf3f78c77c437edf2c291bd5b4ed27e0a93e6a77' ) :
...     import covertutils
...
>>> covertutils.__author__
'John Torakis - operatorequals'
>>>

The newer sibling bitbucket_repo() (as of 0.5.9)

>>> with bitbucket_repo('atlassian', 'python-bitbucket', module='pybitbucket'):
...     import pybitbucket
...
>>>

Another sibling gitlab_repo() (as of 0.5.17)

>>> with gitlab_repo('harinathreddyk', 'python-gitlab', module='gitlab'):
...     from gitlab import const
...
>>>
The domain parameter for gitlab_repo()

You can point to your own installation of GitLab by using the domain parameter:

>>> with gitlab_repo('self', 'myproject', module='test_package', domain='127.0.0.1:8080'):
...     import test_package
...
>>>

This covers the posibility of using httpimport to target local development environments, which is a strong use case for httpimport.

Import remote (encrypted) ZIP files (as of 0.5.18)

After version 0.5.18 the add_remote_repo and the load functions, as well as the remote_repo context got the zip and zip_pwd parameters. By pointing to a HTTP/S URL containing a ZIP file, it is possible to remotely load modules/packages included in it, without downloading the ZIP file to disk!

>>> with httpimport.remote_repo(
...     ['test_package'], base_url='http://localhost:8000/test_package.zip',
...     ):
...    import test_package
...
>>>

Using a ZIP password (zip_pwd parameter)

>>> with httpimport.remote_repo(
...     ['test_package'], base_url='http://localhost:8000/test_package.enc.zip',
...     zip_pwd=b'P@ssw0rd!'
...     ):
...    import test_package
...
>>>

Life suddenly got simpler for Python module testing!!!

Imagine the breeze of testing Pull Requests and packages that you aren't sure they are worth your download.

Recursive Dependencies

If package A requires module B and A exists in http://example.com/a_repo/, while B exists in http://example.com/b_repo/, then A can be imported using the following technique:

>>> from httpimport import remote_repo
>>> with remote_repo(['B'],"http://example.com/b_repo/") :
...     with remote_repo(['A'],"http://example.com/a_repo/") :
...             import A
... 
[!] 'B' not found in HTTP repository. Moving to next Finder.
>>> 
>>> A
<module 'A' from 'http://example.com/a_repo/A/__init__.py'>
>>> B
<module 'B' from 'http://example.com/a_repo/B.py'>
>>> 

Any combination of packages and modules can be imported this way!

The [!] Warning was emitted by the HttpImporter object created for A, as it couldn't locate B, and passed control to the next Finder object, that happened to be the HttpImporter object created for B!

Debugging...

>>> from httpimport import *
>>>
>>> import logging
>>> logging.getLogger('httpimport').setLevel(logging.DEBUG)
>>>
>>> with github_repo('operatorequals','covertutils') :
...     import covertutils
...
FINDER=================
[!] Searching covertutils
[!] Path is None
[@] Checking if connection is HTTPS secure >
[@] Checking if in declared remote module names >
[@] Checking if built-in >
[@] Checking if it is name repetition >
[*]Module/Package 'covertutils' can be loaded!
LOADER=================
[+] Loading covertutils
[+] Trying to import as package from: 'https://raw.githubusercontent.com/operatorequals/covertutils/master//covertutils/__init__.py'
[+] Importing 'covertutils'
[+] Ready to execute 'covertutils' code
[+] 'covertutils' imported succesfully!
>>>

Beware: Huge Security Implications!

Using the httpimport with HTTP URLs is highly discouraged outside the localhost interface!

As HTTP traffic isn't encrypted and/or integrity checked (unlike HTTPS), it is trivial for a remote attacker to intercept the HTTP responses (via an ARP MiTM probably), and add arbitrary Python code to the downloaded packages/modules. This will directly result in Remote Code Execution to your current user's context! In other words, you get totally F*ed...

Preventing the disaster (setting httpimport.INSECURE flag):

>>> import httpimport
>>>
>>> # Importing from plain HTTP ...
>>> httpimport.load('test_module', 'http://localhost:8000//')
[!] Using non HTTPS URLs ('http://localhost:8000//') can be a security hazard!
[-] 'httpimport.INSECURE' is not set! Aborting...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "httpimport.py", line 302, in load
    raise ImportError("Module '%s' cannot be imported from URL: '%s'" % (module_name, url) )
ImportError: Module 'test_module' cannot be imported from URL: 'http://localhost:8000/'
>>> # ... Throws Error!
>>>
>>> # Importing from plain HTTP has to be DELIBERATELY enabled!
>>> httpimport.INSECURE = True
>>> httpimport.load('test_module', 'http://localhost:8000//')
[!] Using non HTTPS URLs ('http://localhost:8000//') can be a security hazard!
<module 'test_module' from 'http://localhost:8000//test_module.py'>
>>> # Succeeded!

You have been warned! Use HTTPS URLs with httpimport!

Minification

This project has started to suggest stager code for HTTP/S RATs made with covertutils. The Documentation for minifying and using httpimport for such purposes can be found here.

Further minification can be achieved by python-minifier, also available in PyPI. So a minified version can be obtained as follows:

pip install python-minifer    # the "pyminify" command
curl https://raw.githubusercontent.com/operatorequals/httpimport/master/httpimport.py | sed 's#log.*#pass#g' | grep -v "import pass" | pyminify - > httpimport_min.py

size reduction:

# Original Size Count
$ curl https://raw.githubusercontent.com/operatorequals/httpimport/0.7.1/httpimport.py |  wc 
[...]
504    1914   18876
# Minified Size Count
$ curl https://raw.githubusercontent.com/operatorequals/httpimport/0.7.1/httpimport.py | sed 's#log.*#pass#g' | grep -v "import pass" | pyminify - | wc 
[...]
177     936   12141

Contributors

  • ldsink - The RELOAD flag and Bug Fixes
  • lavvy - the load() function
  • superloach - Deprecation of imp module in Python3 in favour of importlib
  • yanliakos - Bug Fix
Comments
  • Fixes nested relative package module imports/Fixes incorrect module __package__ attribute

    Fixes nested relative package module imports/Fixes incorrect module __package__ attribute

    This is a fix for #40, This fix essentially starts at the name of the module being imported and walks backwards looking in sys.modules where sys.modules[path].__package__ == path, and then uses that as the package since it would be the nearest level. This has an additional benefit of fixing nested relative package module imports as __package__ is what python uses to determine where to import from when presented with a relative path.

    opened by rkbennett 19
  • adds proxy support

    adds proxy support

    This PR would add support for proxied web requests, which should address #18 . This is done by initializing an OpenerDirector if PROXY is defined. The PROXY object must be a dictionary object with an http and/or https key with the value being the upstream proxy. Here is an example use of the PROXY attribute

    import httpimport
    httpimport.INSECURE=True
    httpimport.PROXY={'http':'http://127.0.0.1:8080'}
    with httpimport.remote_repo('http://192.168.3.72:8000/site-packages'):
      import foo.bar
    
    opened by rkbennett 9
  • New version 0.9.2 breaks loading of joblib pickled model

    New version 0.9.2 breaks loading of joblib pickled model

    Firstly, thank you for the project - I think it's amazing and shall be advertised wider. It's part of my secret sauce to deploy AI/ML models into distributed systems. I used version 0.7.2 to load a pickled pre-trained Automata (Trie structure)

    import httpimport
    with httpimport.remote_repo(['utils'], "https://raw.githubusercontent.com/applied-knowledge-systems/the-pattern-automata/main/automata/"):
        import utils
    from utils import loadAutomata, find_matches
    

    with cryptic stack trace:

    [!] 'nt' not found in HTTP repository. Moving to next Finder.
    Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
      File "/home/alex/anaconda3/envs/thepattern_3.7/lib/python3.7/site-packages/httpimport.py", line 232, in load_module
        exec(module_src, mod.__dict__)
      File "<string>", line 36, in <module>
      File "<string>", line 5, in loadAutomata
      File "/home/alex/anaconda3/envs/thepattern_3.7/lib/python3.7/site-packages/joblib/__init__.py", line 113, in <module>
        from .memory import Memory, MemorizedResult, register_store_backend
      File "/home/alex/anaconda3/envs/thepattern_3.7/lib/python3.7/site-packages/joblib/memory.py", line 15, in <module>
        import pathlib
      File "/home/alex/anaconda3/envs/thepattern_3.7/lib/python3.7/pathlib.py", line 4, in <module>
        import ntpath
      File "/home/alex/anaconda3/envs/thepattern_3.7/lib/python3.7/ntpath.py", line 257, in <module>
        from nt import _getvolumepathname
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 640, in _load_backward_compatible
    KeyError: 'nt'
    

    I went on a path debugging joblib, but actual loading works:

    import ahocorasick 
    import joblib
    Automata=joblib.load("automata_fresh_semantic.pkl.lzma")
    

    full code for loading https://github.com/applied-knowledge-systems/the-pattern-automata/blob/main/automata/utils.py` Code for creating automata is simple and hosted in the same repo: https://github.com/applied-knowledge-systems/the-pattern-automata

    I am reverting to 0.7.2, but any suggestions for uplifting are welcome.

    opened by AlexMikhalev 5
  • "pip_load" function and PyPI support

    Given that the module will gain support for tar.* files (Issue #16), a function can be implemented that directly fetches tarballs from pypi.org, visiting the imported module's page, such as https://pypi.org/project//#files. This page contains download links for all versions of module, that are not statically constructed. These links can be followed to download the tarball and later import it.

    So a function pip_load can have the below signature:

    def pip_load(module, version="latest"):
    [...]
    
    

    Additionally, a context can be created, named pip() or pip_repo, directly importing to memory from PyPI, with the below usage:

    with pip():
      import module_in_pip
    

    Finally, a function can be created that can parse requirements.txt files and directly load the dependencies using calls to pip_load or translating to pip() context commands.

    opened by operatorequals 5
  • How to disable own httpimport logging? (or raise its level)

    How to disable own httpimport logging? (or raise its level)

    My first use case for httpimport was a logging library common to several scripts:

    # toconsole.py
    
    import logging
    import os
    
    log = logging.getLogger(__name__)
    log.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(asctime)s %(message)s')
    handler_console = logging.StreamHandler()
    level = logging.DEBUG if 'DEV' in os.environ else logging.INFO
    handler_console.setLevel(level)
    handler_console.setFormatter(formatter)
    log.addHandler(handler_console)
    
    # disable httpimport logging except for errors+
    logging.getLogger('httpimport').setLevel(logging.ERROR)
    

    A simple usage such as

    import httpimport
    
    httpimport.INSECURE = True
    with httpimport.remote_repo(['githublogging'], 'http://localhost:8000/') :
        from toconsole import log
    
    log.info('yay!')
    

    gives the following output

    [!] Using non HTTPS URLs ('http://localhost:8000//') can be a security hazard!
    2019-08-25 13:56:48,671 yay!
    yay!
    

    The second (bare) yay! must be coming from httpimport, namely from its logging setup.

    How can I disable httpimport logging, or better - raise its level so that only errors+ are logged? The logging.getLogger('httpimport').setLevel(logging.ERROR) I tried did not work.

    opened by wsw70 5
  • What does modules parameter is used for?

    What does modules parameter is used for?

    https://github.com/operatorequals/httpimport/blob/47786966477c03b12298fd6f23fd8ce9d23b9140/httpimport.py#L88

    For my case, the codes below also work though I didn't specify modules

    import httpimport
    url = "https://gist.githubusercontent.com/zhqu1148980644/435304b90d1511099b070414c760e968/raw/e388a5ba1e3580eb9f4cb9e3061ab1f47210cf94"
    with httpimport.remote_repo([], url):
           import task
    task.task1("asdasd")
    
    opened by zhqu1148980644 4
  • No module named 'somePython' when using remote_repo

    No module named 'somePython' when using remote_repo

    I can't seem to get remote_repo to work. I've tried accessing modules in my private Gitlab instance and an example module in Github. I keep getting "No module named x" error. I assume it has something to do with my code but I've tried a few different iterations with no luck. It would be nice to see a working example in the readme that pulls from a publicly available python package. The load() method also can't seem to find the module.

    Here's a snippet.

    #!/usr/bin/env python3
    from httpimport import remote_repo
    import httpimport
    with remote_repo(['myPackage'], 'https://github.com/BillMills/python-package-example/blob/master/myPackage/'):
        import somePython
    
    opened by BrandonsAccount 4
  • Httpimport as a class

    Httpimport as a class

    I have tried to rewrite this module as a class but with no luck. But somehow i believe it would be possible. If the module can be converted to a class it would more awesome. E. G.
    a = httpimport() b = a.import(foo) c = b(new_func)

    opened by lavvy 4
  • uses of httpimport

    uses of httpimport

    Hi! First of all thank you for your library. John can you please confirm that httpimport works with remote libraries and packages only if:

    • these remote libraries/packages are full (inside the folder 'master' user finds all the external required libraries) or

    • all the dependencies (external required libraries) are already installed properly in the python environment?

    An other question is: if I want to import a remote library/package named "A" that requires some external packages not available inside the 'master' folder of "A" (for example the one I sent you, fipy), can I create an alternative library/package named "A_full" with inside all the external required libraries/packages (pure-python or not-pure python like *.dll, *.so, *.a, *.lib, ... ) in order to be able to import all without doing 'pip install ...' before using httpimport with lib "A"?

    A simpler example: if remote lib "A" requires a remote lib "B" with a different url from "A", httpimport can't import "A" because httpimport can't know where to search for "B" in internet. But if I add lib "B" inside the master folder of "A" creating a github clone of the lib "A" + lib "B", is it possible to use httpimport with the cloned lib "A"?

    I do mostly scientific computation with Python and sometimes I use a remote server that offers a full python environment with a lot of useful math packages (https://sagecell.sagemath.org/). Sometimes I need some packages not installed in the remote server, so it would be very useful to import temporary these packages with a remote importer via web (user can't install with pip any library in the server, user has only RAM and CPU time for each calculation).

    Thank you! Regards Matteo

    question 
    opened by MatteoLM 4
  • Added an example for gist import

    Added an example for gist import

    As this is a nice use case of httpimport. I positioned it at this point of the readme because it is a very easy and copy-past-able example with only one hello world function. As other examples are more abstract, I think it's a good approach to go from easy to abstract.

    opened by kolibril13 3
  • How to import a gist

    How to import a gist

    Coming from this StackOverflow question, how can I import a hello() function from this gist: https://gist.github.com/kolibril13/fc84c6940a8aeab8071c5d54d4df3a7b ? My idea would be something like:

    import httpimport
    with httpimport.load("https://gist.githubusercontent.com/kolibril13/fc84c6940a8aeab8071c5d54d4df3a7b/raw/bedba99860d301fdc20edac5291b52359a46d1e3/"):
        import hello
    
    

    I am grateful for any help 👍🏼

    opened by kolibril13 3
  • Add

    Add "VERIFY" to allow for self signed certs

    This feature should operate in a similar fashion to httpimport.INSECURE = True but instead httpimport.VERIFY = False to allow self signed certificates.

    For example:

    import httpimport
    
    httpimport.VERIFY = False
    
    with httpimport.remote_repo(['lib'], 'https://127.0.0.1'):
      from lib import thing
    
    opened by wetw0rk 0
  • Add pure logging for HTTP/S requests

    Add pure logging for HTTP/S requests

    This is quite self explanatory. It is quite useful to have a log of all the requests made by this module, maybe by a different logger than the httpimport one:

    req_logger = logging.getLogger("httpimport.requests")
    

    so it can have all kinds of controls like, log to file, colors, etc.

    When debugging, or when working with network issues this could be a useful tool.

    opened by operatorequals 0
Owner
John Torakis
It is all about what puzzles we prefer to delve into
John Torakis
The dynamic code loading framework used in LocalStack

localstack-plugin-loader localstack-plugin-loader is the dynamic code loading framework used in LocalStack. Install pip install localstack-plugin-load

LocalStack 5 Oct 9, 2022
Using Python to parse through email logs received through several backup systems.

outlook-automated-backup-control Backup monitoring on a mailbox: In this mailbox there will be backup logs. The identification will based on the follo

Connor 2 Sep 28, 2022
Package pyVHR is a comprehensive framework for studying methods of pulse rate estimation relying on remote photoplethysmography (rPPG)

Package pyVHR (short for Python framework for Virtual Heart Rate) is a comprehensive framework for studying methods of pulse rate estimation relying on remote photoplethysmography (rPPG)

PHUSE Lab 261 Jan 3, 2023
This speeds up PyCharm's package index processes and avoids CPU & memory overloading

This speeds up PyCharm's package index processes and avoids CPU & memory overloading

null 1 Feb 9, 2022
A Python library to simulate a Zoom H6 recorder remote control

H6 A Python library to emulate a Zoom H6 recorder remote control Introduction This library allows you to control your Zoom H6 recorder from your compu

Matias Godoy 68 Nov 2, 2022
PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standard Library.

PyPIContents is an application that generates a Module Index from the Python Package Index (PyPI) and also from various versions of the Python Standar

Collage Labs 10 Nov 19, 2022
A test repository to build a python package and publish the package to Artifact Registry using GCB

A test repository to build a python package and publish the package to Artifact Registry using GCB. Then have the package be a dependency in a GCF function.

null 1 Feb 9, 2022
A python script developed to process Windows memory images based on triage type.

Overview A python script developed to process Windows memory images based on triage type. Requirements Python3 Bulk Extractor Volatility2 with Communi

CrowdStrike 245 Nov 24, 2022
python's memory-saving dictionary data structure

ConstDict python代替的Dict数据结构 若字典不会增加字段,只读/原字段修改 使用ConstDict可节省内存 Dict()内存主要消耗的地方: 1、Dict扩容机制,预留内存空间 2、Dict也是一个对象,内部会动态维护__dict__,增加slot类属性可以节省内容 节省内存大小

Grenter 1 Nov 3, 2021
Library for Memory Trace Statistics in Python

Memory Search Library for Memory Trace Statistics in Python The library uses tracemalloc as a core module, which is why it is only available for Pytho

Memory Search 1 Dec 20, 2021
Holographic Declarative Memory for Python ACT-R

HDM This is the repository for the Holographic Declarative Memory (HDM) module for Python ACT-R. This repository contains: documentation: a paper, con

Carleton Cognitive Modeling Lab 1 Jan 17, 2022
Find the remote website version based on a git repository

versionshaker Versionshaker is a tool to find a remote website version based on a git repository This tool will help you to find the website version o

Orange Cyberdefense 110 Oct 23, 2022
Remote execution of a simple function on the server

FunFetch Remote execution of a simple function on the server All types of Python support objects.

Decave 4 Jun 30, 2022
Remote Worker

Remote Worker Separation of Responsibilities There are several reasons to move some processing out of the main code base for security or performance:

V2EX 69 Dec 5, 2022
Backup dc registry - A simple POC that abuses Backup Operator privileges to remote dump SAM, SYSTEM, and SECURITY

Backup Operator Registry Backup to Domain Compromise A simple POC that abuses Ba

Horizon 3 AI Inc 57 Dec 18, 2022
A pypi package details search python module

A pypi package details search python module

Fayas Noushad 5 Nov 30, 2021
carrier.py is a Python package/module that's used to save time when programming

carrier.py is a Python package/module that's used to save time when programming, it helps with functions such as 24 and 12 hour time, Discord webhooks, etc

Zacky2613 2 Mar 20, 2022
Demo of using DataLoader to prevent out of memory

Demo of using DataLoader to prevent out of memory

null 3 Jun 25, 2022
Simple utlity for sniffing decrypted HTTP/HTTPS traffic on a jailbroken iOS device into an HAR format.

Description iOS devices contain a hidden feature for sniffing decrypted HTTP/HTTPS traffic from all processes using the CFNetwork framework into an HA

null 83 Dec 25, 2022