Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python libraries on framework.dev #751

Open
kenslachtajr opened this issue Mar 21, 2023 · 0 comments
Open

Add support for Python libraries on framework.dev #751

kenslachtajr opened this issue Mar 21, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@kenslachtajr
Copy link
Contributor

kenslachtajr commented Mar 21, 2023

Description

  • Python is not supported out of the box and a research spike was conducted to determine the best way to add support for Python libraries on framework.dev. This ticket involves and adding support for comparing different Python libraries based on certain properties. At the end of this text you can see some suggested properties for comparison which we can use.

  • Adding badges for Python libraries is an additional need for this ticket. We are able to make use of the the same properties in implementing badge functionality as well. Please refer to the original spike ticket for more context: SPIKE: Investigate fixing comparison tool #577

Python

PyPI is the official package index for Python, and there is also pypistats.org for download statistics.

Downloads can be retrieved from the following endpoint: https://pypistats.org/api/packages/[package-name]/recent

For Django (https://pypistats.org/api/packages/django/recent):

// GET https://pypistats.org/api/packages/django/recent

{
  "data": {
    "last_day": 394453,
    "last_month": 8557361,
    "last_week": 1963861
  },
  "package": "django",
  "type": "recent_downloads"
}

Other package information can be retrieved directly from PyPI via the https://pypi.org/pypi/[package-name]/json endpoint. For example:

// GET https://pypi.org/pypi/django/json

{
  "info": {
    "author": "Django Software Foundation",
    "author_email": "foundation@djangoproject.com",
    "bugtrack_url": null,
    "classifiers": [
      "Development Status :: 5 - Production/Stable",
      "Environment :: Web Environment",
      "Framework :: Django",
      "Intended Audience :: Developers",
      "License :: OSI Approved :: BSD License",
      "Operating System :: OS Independent",
      "Programming Language :: Python",
      "Programming Language :: Python :: 3",
      "Programming Language :: Python :: 3 :: Only",
      "Programming Language :: Python :: 3.10",
      "Programming Language :: Python :: 3.11",
      "Programming Language :: Python :: 3.8",
      "Programming Language :: Python :: 3.9",
      "Topic :: Internet :: WWW/HTTP",
      "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
      "Topic :: Internet :: WWW/HTTP :: WSGI",
      "Topic :: Software Development :: Libraries :: Application Frameworks",
      "Topic :: Software Development :: Libraries :: Python Modules"
    ],
    "description": "======\nDjango\n======\n\nDjango is a high-level Python web framework that encourages rapid development\nand clean, pragmatic design. Thanks for checking it out.\n\nAll documentation is in the \"``docs``\" directory and online at\nhttps://docs.djangoproject.com/en/stable/. If you're just getting started,\nhere's how we recommend you read the docs:\n\n* First, read ``docs/intro/install.txt`` for instructions on installing Django.\n\n* Next, work through the tutorials in order (``docs/intro/tutorial01.txt``,\n  ``docs/intro/tutorial02.txt``, etc.).\n\n* If you want to set up an actual deployment server, read\n  ``docs/howto/deployment/index.txt`` for instructions.\n\n* You'll probably want to read through the topical guides (in ``docs/topics``)\n  next; from there you can jump to the HOWTOs (in ``docs/howto``) for specific\n  problems, and check out the reference (``docs/ref``) for gory details.\n\n* See ``docs/README`` for instructions on building an HTML version of the docs.\n\nDocs are updated rigorously. If you find any problems in the docs, or think\nthey should be clarified in any way, please take 30 seconds to fill out a\nticket here: https://code.djangoproject.com/newticket\n\nTo get more help:\n\n* Join the ``#django`` channel on ``irc.libera.chat``. Lots of helpful people\n  hang out there. See https://web.libera.chat if you're new to IRC.\n\n* Join the django-users mailing list, or read the archives, at\n  https://groups.google.com/group/django-users.\n\nTo contribute to Django:\n\n* Check out https://docs.djangoproject.com/en/dev/internals/contributing/ for\n  information about getting involved.\n\nTo run Django's test suite:\n\n* Follow the instructions in the \"Unit tests\" section of\n  ``docs/internals/contributing/writing-code/unit-tests.txt``, published online at\n  https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests\n\nSupporting the Development of Django\n====================================\n\nDjango's development depends on your contributions. \n\nIf you depend on Django, remember to support the Django Software Foundation: https://www.djangoproject.com/fundraising/\n\n\n",
    "description_content_type": "",
    "docs_url": null,
    "download_url": "",
    "downloads": {
      "last_day": -1,
      "last_month": -1,
      "last_week": -1
    },
    "home_page": "https://www.djangoproject.com/",
    "keywords": "",
    "license": "BSD-3-Clause",
    "maintainer": "",
    "maintainer_email": "",
    "name": "Django",
    "package_url": "https://pypi.org/project/Django/",
    "platform": null,
    "project_url": "https://pypi.org/project/Django/",
    "project_urls": {
      "Documentation": "https://docs.djangoproject.com/",
      "Funding": "https://www.djangoproject.com/fundraising/",
      "Homepage": "https://www.djangoproject.com/",
      "Release notes": "https://docs.djangoproject.com/en/stable/releases/",
      "Source": "https://github.com/django/django",
      "Tracker": "https://code.djangoproject.com/"
    },
    "release_url": "https://pypi.org/project/Django/4.1.5/",
    "requires_dist": [
      "asgiref (<4,>=3.5.2)",
      "sqlparse (>=0.2.2)",
      "backports.zoneinfo ; python_version < \"3.9\"",
      "tzdata ; sys_platform == \"win32\"",
      "argon2-cffi (>=19.1.0) ; extra == 'argon2'",
      "bcrypt ; extra == 'bcrypt'"
    ],
    "requires_python": ">=3.8",
    "summary": "A high-level Python web framework that encourages rapid development and clean, pragmatic design.",
    "version": "4.1.5",
    "yanked": false,
    "yanked_reason": null
  },

The above response retrieves GitHub repository URL, so this could be used to retrieve GitHub stars.

For framework.dev, we might consider:

  • Last month downloads
  • Classifiers / Development Status (all possible values are available here here)
  • Classifiers / Environment (all possible values are available here here)
  • GitHub stars
@kenslachtajr kenslachtajr added the help wanted Extra attention is needed label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant