Skip to main content

Parseltongue is a library that lets Python programs execute methods on objects inside a GemStone Smalltalk server.

See also

Sessions

Log in by creating a session. You can choose between an RPCSession or a LinkedSession:

linked_session = LinkedSession('DataCurator', 'swordfish')

assert linked_session.is_logged_in
assert not linked_session.is_remote
assert linked_session.is_current_session

linked_session.log_out()

Multiple RPCSessions can exist simultaneously, but only a single instance of a LinkedSession is allowed per process.

Resolving objects

Looking up a Smalltalk symbol from the usual symbol dictionaries results in a GemObject object being returned which represents that object in Python:

date_class = session.resolve_symbol('Date')
assert isinstance(date_class, GemObject)

Calling methods

A GemObject object forwards method calls to its counterpart in the Gem. It returns other GemObject objects (and if the method takes arguments, those must also be GemObject objects):

today = date_class.today()
assert isinstance(today, GemObject)
assert today.isKindOf(date_class)

Transferring basic objects

Some basic objects can be transferred between GemStone and Python. These include unicode strings, various numbers and booleans:

gem_number = session.from_py(1)
long_ago = date_class.fromDays(gem_number)

long_ago_string = long_ago.asString()
python_string = long_ago_string.to_py

assert python_string == '1901/01/02'

Automatic translation of arguments

Some arguments to Gemstone method calls can be turned into GemObject instances automatically:

long_ago = date_class.fromDays(1)

long_ago_string = long_ago.asString()
python_string = long_ago_string.to_py

assert python_string == '1901/01/02'

Method name mapping

In Python, method names are spelt differently. Each ‘:’ in a Smalltalk method symbol is replaced with a ‘_’ in Python. When calling such a method, you must pass the correct number of arguments as Python positional arguments:

user_globals = session.resolve_symbol('UserGlobals')
some_key = session.new_symbol('akey')
gem_number = session.from_py(123)

user_globals.at_put(some_key, gem_number)

License

Parseltongue is licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).

This means you can:

  • Use Parseltongue in commercial applications

  • Modify Parseltongue privately

  • Distribute Parseltongue as part of your applications

If you modify Parseltongue itself, you must distribute those modifications under the terms of the LGPL.

For the full license text, see the LICENSE file or visit: https://www.gnu.org/licenses/lgpl-3.0.html

Metadata

Release files for reahl-parseltongue 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reahl-parseltongue 3.1.1
File Size Uploaded
reahl_parseltongue-3.1.1.tar.gz 34.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reahl-parseltongue 3.1.1
File Interpreter ABI Platform
reahl_parseltongue-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 75.6 kB

Release files / reahl_parseltongue-3.1.1.tar.gz

Download URL reahl_parseltongue-3.1.1.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4c22fdf74aa722a722490def8415cc41bd1bb2552e2378aba001041cd0e57eba
BLAKE2b-256 checksum
How to use checksums
f353ecb38c0fc2d3a4347a4dc944b972d90da145d723fd7d52a88f85c655e67e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / reahl_parseltongue-3.1.1-py3-none-any.whl

Download URL reahl_parseltongue-3.1.1-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e70fcbf72cf392e4e61dffe97e1d76532426ced63d0a8e17f17dd02ca00c95be
BLAKE2b-256 checksum
How to use checksums
d253b73191351c58814e132ed2a4a1ee6e91bef5ec9355de05222edaae35c4b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

3.1.1 This release

2 release files

3.1.0

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page