Skip to main content

Move Python things to other modules, mostly for backward-compatibility

Project description

pyjar

Move Python things to other modules, mostly for backward-compatibility, such as when you want to refactor your code but still need old pickles to be loadable, or particularly if you need the new pickles to be byte-for-byte-identical to the old ones.

installation

😄

You can pip install pyjar if you really want to, but you can also just copy this public-domain code from src/jar/__init__.py directly into your own project. You can even give it a name you like better.

usage

from pyjar import jar


@jar('.old_module_name)
def my_function_that_i_moved_here():
    ...

The function (or class, or whatever) will still be importable from its new location, but it will pickle as though it lives in the old location. And as long as the module that defines the function itself has been imported, old pickles pointing to the old location will successfully unpickle.

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

pyjar-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

pyjar-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pyjar-0.1.0.tar.gz.

File metadata

  • Download URL: pyjar-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyjar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d008eeac4f40ba9175f6a88bb384e547ad1014def0be2a3ceb4085684a2d4224
MD5 a71c04000952ea0c4ec4494f8141533f
BLAKE2b-256 d347a802bd15196a6ce61fa048ed6c7547a546a060a508bf3a089a557bb96a2c

See more details on using hashes here.

File details

Details for the file pyjar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyjar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pyjar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3bcea4df2cd12c8f5bb758156371be170cf3b2a1e1508431d057f47dde8b4e3
MD5 c21526ea1a4ecba3c3d207e49c93503e
BLAKE2b-256 2f6eafb85bf374aba037c30f3634043c40fc0189de3c9ffebe2577ad356ea0c4

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