Skip to main content

Python common task, general purpose library (serialization, networking, etc.).

Project description

iogp

Python common task, general purpose library (serialization, networking, etc.). Note: this project used to be called iolib - it was renamed for PyPI.

iogp.net

  • provides the download() function
    • automatic caching of downloads
    • supports cookies, authentication, etc.
    • can spoof user agents (or the entire GET request) - see the USER_AGENTS dict in net/net.py
    • examples:
      • text = iogp.net.download('https://google.com')
      • info = {}; iogp.net.download('https://1.1.1.1', info=info, cache=0) => info['code'] == 200, info['headers']['Content-Type'], etc.

iogp.db

  • provides a persistence / caching / storage object DataCache that can store e.g. the results from a downloaded URL
    • use DataStore to also get in-memory caching of values

    • ObjCache() wraps DataCache to generate the storage filename automatically

    • usage:

      from iogp.db import DataCache
      
      fn = 'objects.db'
      
      db = DataCache(fn)
      db['key1'] = {'some':['serializable', 'object', 0]}
      db['some-other-key'] = 0
      db.close()
      
      db = DataCache(fn)
      print(db['key1'])
      print('key2' in db, 'some-other-key' in db)
      

iogp.win

  • ctypes wrapper over some Windows-specific functions

  • example - iterating all windows and retrieving the window title for each one:

    import iogp.win as win
    
    def callback(hwnd, lparam):
        size = 512
        buf = win.unicode_buffer(size)
        win.GetWindowText(hwnd, buf, size)
        print(f'[-] Handle: {hwnd}, title: {buf.value}')
        return 1  # 0 to stop
        
    win.EnumWindows(win.WNDENUMPROC(callback), 0)
    

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

iogp-1.0.4.tar.gz (53.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iogp-1.0.4-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file iogp-1.0.4.tar.gz.

File metadata

  • Download URL: iogp-1.0.4.tar.gz
  • Upload date:
  • Size: 53.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for iogp-1.0.4.tar.gz
Algorithm Hash digest
SHA256 5a55f9b0212ab3ba3e93c12751b368989a1ca02831a76b9d90e8db2c95928816
MD5 44b7a0ccfd0ec04c54866090f4a4a0c5
BLAKE2b-256 9655ec9a5518be1f0c6f5053c48e1e3f1571d75e3a620ddb5a5365aefee3921b

See more details on using hashes here.

File details

Details for the file iogp-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: iogp-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for iogp-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bf3ac2549b68cf3e71cd402aee09f4a004e20a75e41163e0e0b8870875d4c714
MD5 4becb2e26ba7dac205f9869f45784232
BLAKE2b-256 4cc32bd2ac25c8f15769c7340d640aa65f62d4149a65005f35fd5a8e3fd3cf60

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