Skip to main content

Dynamic python object access & manipulation across threads/processes.

Project description

shareable

Dynamic python object access & manipulation across threads/processes

(This package is not close to being usable, though the examples below will work)

Example:

from shareable import Shareable


# make a test class:
class Test:
    def __init__(self, name, age):
        self.name = name
        self.age = age

# in terminal 1
>>> from shareable import Shareable
>>> test = Test('DB Cooper', 50)
>>> s = Shareable(t)
>>> s
{'name': 'DB Cooper', 'age', 50}

# in terminal 2: 
>>> from shareable import Shareable
>>> s = Shareable()
'Connection established'
>>> s['name']
'DB Cooper'
>> > s['name'] = 'new name'

# back in terminal 1:
'Connection established'
>>> s['name']
'new name'
>>> s
{'name': 'new name', 'age', 50}

Support for complex objects:

>>> import pandas as pd
>>> import numpy as np
>>> df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
>>> s = Sharedable(df)
>>> s['info']()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 100 entries, 0 to 99
Data columns (total 4 columns):
 #   Column  Non-Null Count  Dtype
---  ------  --------------  -----
 0   A       100 non-null    int64
 1   B       100 non-null    int64
 2   C       100 non-null    int64
 3   D       100 non-null    int64
dtypes: int64(4)
memory usage: 3.2 KB

# terminal 2:
>>> s = Shareable()
'Connection established'
>>> s['columns']
Index(['A', 'B', 'C', 'D'], dtype='object')

Gracefully handles resources on keyboard or explicit exit:

>>> s = Shareable()
>>> exit()
'Destroyed shared resources'
'Killed all child processes'

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

shareable-0.1a0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

shareable-0.1a0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file shareable-0.1a0.tar.gz.

File metadata

  • Download URL: shareable-0.1a0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for shareable-0.1a0.tar.gz
Algorithm Hash digest
SHA256 bab960882176476ef0a9dbce5b3eb5d39d98924be8110b0ee4c4366657ff6afa
MD5 cba7b656608c58d5c469bdde826dbc34
BLAKE2b-256 c0e8fe067fe4b90782c2aef319fc3a9e33fdfaf629b6455bb4b7288d7ab3f2fc

See more details on using hashes here.

File details

Details for the file shareable-0.1a0-py3-none-any.whl.

File metadata

  • Download URL: shareable-0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for shareable-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 418894a51ad47adab28819622eeefe81ac7dcae58ea903bade8d6ddc3e0fee06
MD5 f74ce7f5329d0c85b0ddcf845a45cdc3
BLAKE2b-256 a77d7d698898896e69fe3f09a4dec626978e2abc602ca9915407173e1f96184e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page