Re: API for uploading packages to PyPI
Ronald Oussoren <[email protected]> Fri, 22 Mar 2013 10:04:24 +0100
| Newsgroups | gmane.comp.python.catalog |
|---|---|
| Message-ID | <[email protected]> |
--===============1854063750== Content-Type: multipart/alternative; boundary="Apple-Mail=_2D8ED921-D824-45DF-B6A5-7061479BB474" --Apple-Mail=_2D8ED921-D824-45DF-B6A5-7061479BB474 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 22 Mar, 2013, at 9:58, anatoly techtonik <[email protected]> wrote: > On Fri, Mar 22, 2013 at 11:16 AM, Ronald Oussoren = <[email protected]> wrote: >=20 > On 22 Mar, 2013, at 8:37, anatoly techtonik <[email protected]> = wrote: >=20 >> Hi, >>=20 >> I understand that this will make PyPI a potential target for = automated spam bots, but still it will be awesome to have an API to = upload packages to PyPI. >>=20 >> For example, I have a code that extract all necessary meta data for = the package from the source file itself. It is even able to generate = setup.py from this data. https://bitbucket.org/techtonik/astdump The = next logical step in this chain is to teach it to upload stuff to PyPI. >>=20 >> Now I thought that this setup.py is an unnecessary complication. What = I need, ideally is just upload single .py file, or a JSON and a .tar.gz = FWIW. Is there a straightforward API for things like that?=20 >=20 > Several APIs are documented on pages linked directly from the PyPI = homepage (the Infrastructure box) >=20 > Thanks for the pointer. >=20 > Some links are broken. I added redirects for wiki pages, but it will = be better to fix links too. The OAuth link appears to be broken, and that's likely part of the = fallout of the wiki.python.org breakin. > https://bitbucket.org/loewis/pypi/pull-request/4 >=20 > Among those it seems that only OAuth API can be used to upload stuff. I haven't looked at the code yet, but that's unlikely as distutils uses = the HTTP API to upload files and AFAIK distutils doesn't implement = OAuth. IIRC OAuth was added fairly recently to make it possible for = users to delegate some permissions to external web applications (such as = pythonpackages.com) without storing their password in those = applications. Ronald --Apple-Mail=_2D8ED921-D824-45DF-B6A5-7061479BB474 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 22 Mar, 2013, at 9:58, anatoly techtonik <<a href="mailto:[email protected]">[email protected]</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 22, 2013 at 11:16 AM, Ronald Oussoren <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div class="h5"> <div>On 22 Mar, 2013, at 8:37, anatoly techtonik <<a href="mailto:[email protected]" target="_blank">[email protected]</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div>I understand that this will make PyPI a potential target for automated spam bots, but still it will be awesome to have an API to upload packages to PyPI.</div> <div><br></div> <div>For example, I have a code that extract all necessary meta data for the package from the source file itself. It is even able to generate setup.py from this data. <a href="https://bitbucket.org/techtonik/astdump" target="_blank">https://bitbucket.org/techtonik/astdump</a> The next logical step in this chain is to teach it to upload stuff to PyPI.</div> <div><br></div><div>Now I thought that this setup.py is an unnecessary complication. What I need, ideally is just upload single .py file, or a JSON and a .tar.gz FWIW. Is there a straightforward API for things like that? </div> </div></blockquote><div><br></div></div></div>Several APIs are documented on pages linked directly from the PyPI homepage (the Infrastructure box)</div></div></blockquote><div class="gmail_quote" style=""><br></div><div class="gmail_quote" style=""> Thanks for the pointer.</div><div class="gmail_quote" style=""><br></div><div class="gmail_quote" style="">Some links are broken. I added redirects for wiki pages, but it will be better to fix links too.</div></div></div></div></blockquote><div>The OAuth link appears to be broken, and that's likely part of the fallout of the <a href="http://wiki.python.org">wiki.python.org</a> breakin.</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><a href="https://bitbucket.org/loewis/pypi/pull-request/4">https://bitbucket.org/loewis/pypi/pull-request/4</a><br> <div class="gmail_extra"><br></div><div class="gmail_extra">Among those it seems that only OAuth API can be used to upload stuff.<br clear="all"></div></div></div></div></blockquote><div><br></div>I haven't looked at the code yet, but that's unlikely as distutils uses the HTTP API to upload files and AFAIK distutils doesn't implement OAuth. IIRC OAuth was added fairly recently to make it possible for users to delegate some permissions to external web applications (such as <a href="http://pythonpackages.com">pythonpackages.com</a>) without storing their password in those applications.</div><div><br></div><div>Ronald</div><div><br></div></body></html> --Apple-Mail=_2D8ED921-D824-45DF-B6A5-7061479BB474-- --===============1854063750== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Catalog-SIG mailing list [email protected] http://mail.python.org/mailman/listinfo/catalog-sig --===============1854063750==--