2

This is a generic question, but for example, I found pyxser and I want to know if it's going to work with Python 3 or not. I wasted 15-20 minutes earlier today finding out the 'Gnosis' was not.

I see the date on this particular package is March 2011, so I'm guessing it's not.

Is everything on pypi.org ancient? Is there a better site to use?

Basically, we all do a Google search for something like "xml serializer for Python" and we get a mix of Python 2 and 3 libraries.

Here is a similar question with no answer: Determining for which python version a library is designed

But the point is we need have a technique to find out for any library what releases it is compatible with.

NealWalters
  • 17,197
  • 42
  • 141
  • 251

2 Answers2

3

Is everything on pypi.org ancient?

No.

Is there a better site to use?

No.

But the point is we need have a technique to find out for any library what releases it is compatible with.

There’s no such technique for any library, but many libraries will have:

  • language classifiers on PyPI – specifically, the ones that start with “Programming Language :: Python ::” are helpful here, with “Programming Language :: Python :: 3” indicating Python 3 support and “Programming Language :: Python :: 2 :: Only” indicating a lack of it. (See the sidebar of https://pypi.org/project/lxml/ for an example.)

  • python_requires, which PyPI also displays

  • wheels with an indication of Python versions in the “Download files” page. cp3x is a wheel for CPython 3.x, again indicating Python 3 support. (Example for this at https://pypi.org/project/lxml/#files.)

Ry-
  • 218,210
  • 55
  • 464
  • 476
  • Thanks, same comment to other answer: Hmmm. Gnosis doesn't have any of those, but link to pyxser I included has a lot - including versions of Python under "Programming Languages" under "Classifiers". I guess it's up to each author to correctly classify his or her own code library. Guessing the old ones like Gnosis don't, or that feature wasn't available back then. – NealWalters Jun 26 '20 at 23:26
1

pypi.org has a small section on the left called requirements. Check that and It should show which version of python you need.

When your searching for a package you can also filter by ones that will only run on Python 3.

masonCherry
  • 894
  • 6
  • 14
  • Hmmm. Gnosis doesn't have any of those, but link to pyxser I included has a lot - including versions of Python under "Programming Languages" under "Classifiers". I guess it's up to each author to correctly classify his or her own code library. Guessing the old ones like Gnosis don't, or that feature wasn't available back then. – NealWalters Jun 26 '20 at 23:26
  • Yeah. Just like with any software the documentation is up to the vendors. there is not system in place to enforce versioning (maybe they should be...) – masonCherry Jun 26 '20 at 23:28
  • Do you have one that shows "Requirements", I checked a few. Or did you mean classifiers/languages? – NealWalters Jun 26 '20 at 23:31
  • I think I saw it in Flask.. I just realized It must be something that's added manually. So again, It's not enforced. Although when using libraries made for python 2 there should be dead give-aways like the `print` function. Most newer libraries should support some version of python 3. – masonCherry Jun 26 '20 at 23:34