packethost / packet-python

A Python client for the Equinix Metal API
http://metal.equinix.com/
GNU Lesser General Public License v3.0
40 stars 50 forks source link

Equinix Metal Python (via rename or new module) #106

Open displague opened 3 years ago

displague commented 3 years ago

We would like to replace the use of the packet pypi module with a module that reflects Equinix Metal branding. In doing so, we can not break existing projects that depend on thepacket package.

Outline the steps that will be taken to move this project ahead with an Equinix Metal focus.

Some questions to consider:

displague commented 3 years ago

What are our alternatives? What drawbacks and benefits do these offer?

One alternative would be to use a generated client from the Equinix Metal API Spec: https://github.com/displague/metal-python

This is my preferred approach but we need some investigation into how usable this client is. We should be able to overcome any limitations through API spec improvements (including migrating to OpenAPI v3).

pnhowe commented 3 years ago

If you do rename the client, might I suggest python-metal, this more closely matches the naming use by packaging systems, ie: python3-werkzeug, https://pypi.org/project/python-twitter/, etc.
moving to a generated client would also save you some effort when the API changes, I have used https://swagger.io/docs/open-source-tools/swagger-codegen/ in the past and found it to work well enough for my needs.

displague commented 1 year ago

https://peps.python.org/pep-0423/#overview has a section on namespacing (Top-level namespace). Perhaps equinix-labs/equinix.metal or github.com/equinix-labs/python-equinix and pypi equinix (from equinix import metal)?

https://peps.python.org/pep-0423/#how-to-rename-a-project

t0mk commented 1 year ago

@displague I like python-equinix best, but I think that if we generate Python SDKs from OpenAPI spec, we should keep separate packages per service (Metal, Fabric, Network Edge). So that new features in Fabric won't trigger version bump in a project that's using only Metal. Not sure if I explained that correctly. Also, it would be a bit messy to generate one Python package from more than one API docs.

I would go with python-equinixmetal, python-equinixedge, ...

ctreatma commented 1 year ago

The generated Python SDK is now at https://github.com/equinix-labs/metal-python, and as of v0.2.0 it has support for the full Equinix Metal API. We should deprecate this SDK in favor of that one, and add the appropriate notices in this project's README.