Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
|PyPI version| |PyPi downloads| |Build Status| |License| |Bitdeli Badge|
The simplest (and tastiest) way to write one program that runs on both Python 2.6+ and Python 3.
Installing pies
::
pip install pies
or if you prefer:
::
easy_install pies
Pies is a Python2 & 3 Compatibility layer with the philosophy that all code should be Python3 code. Starting from this viewpoint means that when running on Python3 pies adds virtually no overhead.
Instead of providing a bunch of custom methods (leading to Python code that looks out of place on any version) pies aims to back port as many of the Python3 api calls, imports, and objects to Python2 - Relying on special syntax only when absolutely necessary.
Pies is significantly smaller and simpler than six because it assumes for everything possible the developer is using the Python 3 compatible versions included with Python 2.6+, whereas six tries to maintain compatibility with Python 2.4 - leading to many more overrides and further into different language territory. Additionally, as stated above, where possible pies tries to enable you to not have to change syntax at all.
Using and integrating pies into an existing Python 3+ code base (to achieve Python 2 & 3 dual support) couldn't be simpler:
::
from __future__ import absolute_import, division, print_function, unicode_literals
from pies.overrides import *
Then simply write standard Python3 code, and enjoy Python2 Support.
The best part of Pies is how much Python3 code works unchanged in Python2
Functions:
Types:
Imports:
Some Python3 Modules have moved around so much compared to their Python2 counterpart, that I found it necessary to create special versions of them to obtain the Python3 naming on both environments. Since these modules exist already in Python2 allowing them to be imported by the Python3 module name directly is not possible. Instead, you must import these modules from pies.
Example:
::
from pies import pickle
Full List:
Sadly, there is still special syntax that is present for corner cases.
I'm pretty sure a bunch. If you run into any problems or have any ideas please don't hesitate to file a bug, submit a pull request, or email me at timothy.crosley@gmail.com.
Thanks and I hope you enjoy pies!
~Timothy Crosley
.. |Pies| image:: https://raw.github.com/timothycrosley/pies/develop/logo.png .. |PyPI version| image:: https://badge.fury.io/py/pies.png :target: http://badge.fury.io/py/pies .. |PyPi downloads| image:: https://pypip.in/d/pies/badge.png :target: https://crate.io/packages/pies/ .. |Build Status| image:: https://travis-ci.org/timothycrosley/pies.png?branch=develop :target: https://travis-ci.org/timothycrosley/pies .. |License| image:: https://pypip.in/license/pies/badge.png :target: https://pypi.python.org/pypi/pies/ .. |Bitdeli Badge| image:: https://d2weczhvl823v0.cloudfront.net/timothycrosley/pies/trend.png :target: https://bitdeli.com/free
FAQs
The simplest way to write one program that runs on both Python 2 and Python 3.
We found that pies demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.