README.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. PycURL: Python interface to libcurl
  2. ====================================
  3. .. image:: https://api.travis-ci.org/pycurl/pycurl.png
  4. :target: https://travis-ci.org/pycurl/pycurl
  5. PycURL is a Python interface to `libcurl`_. PycURL can be used to fetch objects
  6. identified by a URL from a Python program, similar to the `urllib`_ Python module.
  7. PycURL is mature, very fast, and supports a lot of features.
  8. Overview
  9. --------
  10. - libcurl is a free and easy-to-use client-side URL transfer library, supporting
  11. FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP,
  12. SMTP, POP3 and RTSP. libcurl supports SSL certificates, HTTP POST, HTTP PUT,
  13. FTP uploading, HTTP form based upload, proxies, cookies, user+password
  14. authentication (Basic, Digest, NTLM, Negotiate, Kerberos4), file transfer
  15. resume, http proxy tunneling and more!
  16. - libcurl is highly portable, it builds and works identically on numerous
  17. platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX, IRIX,
  18. AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOs, Mac OS X,
  19. Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS and more...
  20. - libcurl is `free`_, `thread-safe`_, `IPv6 compatible`_, `feature rich`_,
  21. `well supported`_, `fast`_, `thoroughly documented`_ and is already used by
  22. many known, big and successful `companies`_ and numerous `applications`_.
  23. .. _free: http://curl.haxx.se/docs/copyright.html
  24. .. _thread-safe: http://curl.haxx.se/libcurl/features.html#thread
  25. .. _`IPv6 compatible`: http://curl.haxx.se/libcurl/features.html#ipv6
  26. .. _`feature rich`: http://curl.haxx.se/libcurl/features.html#features
  27. .. _`well supported`: http://curl.haxx.se/libcurl/features.html#support
  28. .. _`fast`: http://curl.haxx.se/libcurl/features.html#fast
  29. .. _`thoroughly documented`: http://curl.haxx.se/libcurl/features.html#docs
  30. .. _companies: http://curl.haxx.se/docs/companies.html
  31. .. _applications: http://curl.haxx.se/libcurl/using/apps.html
  32. Requirements
  33. ------------
  34. - Python 2.4 through 2.7 or 3.1 through 3.4.
  35. - libcurl 7.19.0 or better.
  36. Installation
  37. ------------
  38. Please see INSTALL.rst for installation instructions. If installing from
  39. a Git checkout, please follow instruction in the "Git Checkout" section
  40. in INSTALL.rst.
  41. Documentation
  42. -------------
  43. Documentation for the most recent PycURL release is available on
  44. `PycURL website <http://pycurl.sourceforge.net/doc/>`_.
  45. To build documentation from source, run ``make docs``.
  46. Building documentation requires `Sphinx <http://sphinx-doc.org/>`_ to
  47. be installed, as well as pycurl extension module built as docstrings are
  48. extracted from it. Built documentation is stored in ``build/doc``
  49. subdirectory.
  50. Support
  51. -------
  52. For support questions, please use `curl-and-python mailing list`_.
  53. `Mailing list archives`_ are available for your perusal as well.
  54. Although not an official support venue, `Stack Overflow`_ has been quite
  55. popular with PycURL users as well.
  56. Bugs can be reported `via GitHub`_. Please only use GitHub issues when you are
  57. certain you have found a bug in PycURL. If you do not have a patch to fix
  58. the bug, or at least a specific code fragment in PycURL that you believe is
  59. the cause, you should instead post your inquiry to the mailing list.
  60. .. _curl-and-python mailing list: http://cool.haxx.se/mailman/listinfo/curl-and-python
  61. .. _Stack Overflow: http://stackoverflow.com/questions/tagged/pycurl
  62. .. _Mailing list archives: http://curl.haxx.se/mail/list.cgi?list=curl-and-python
  63. .. _via GitHub: https://github.com/pycurl/pycurl/issues
  64. Automated Tests
  65. ---------------
  66. PycURL comes with an automated test suite. To run the tests, execute::
  67. make test
  68. The suite depends on packages `nose`_ and `bottle`_, as well as `vsftpd`_.
  69. Some tests use vsftpd configured to accept anonymous uploads. These tests
  70. are not run by default. As configured, vsftpd will allow reads and writes to
  71. anything the user running the tests has read and write access. To run
  72. vsftpd tests you must explicitly set PYCURL_VSFTPD_PATH variable like so::
  73. # use vsftpd in PATH
  74. export PYCURL_VSFTPD_PATH=vsftpd
  75. # specify full path to vsftpd
  76. export PYCURL_VSFTPD_PATH=/usr/local/libexec/vsftpd
  77. These instructions work for Python 2.5 through 2.7 and 3.1 through 3.4.
  78. .. _nose: https://nose.readthedocs.org/
  79. .. _bottle: http://bottlepy.org/
  80. .. _vsftpd: http://vsftpd.beasts.org/
  81. Test Matrix
  82. -----------
  83. The test matrix is a separate framework that runs tests on more esoteric
  84. configurations. It supports:
  85. - Testing against Python 2.4, which bottle does not support.
  86. - Testing against Python compiled without threads, which requires an out of
  87. process test server.
  88. - Testing against locally compiled libcurl with arbitrary options.
  89. To use the test matrix, first you need to start the test server from
  90. Python 2.5+ by running::
  91. python -m tests.appmanager
  92. Then in a different shell, and preferably in a separate user account,
  93. run the test matrix::
  94. # run ftp tests, etc.
  95. export PYCURL_VSFTPD_PATH=vsftpd
  96. # create a new work directory, preferably not under pycurl tree
  97. mkdir testmatrix
  98. cd testmatrix
  99. # run the matrix specifying absolute path
  100. python /path/to/pycurl/tests/matrix.py
  101. The test matrix will download, build and install supported Python versions
  102. and supported libcurl versions, then run pycurl tests against each combination.
  103. To see what the combinations are, look in
  104. `tests/matrix.py <tests/matrix.py>`_.
  105. Contribute
  106. ----------
  107. For smaller changes:
  108. #. Fork `the repository`_ on Github.
  109. #. Create a branch off **master**.
  110. #. Make your changes.
  111. #. Write a test which shows that the bug was fixed or that the feature
  112. works as expected.
  113. #. Send a pull request.
  114. #. Check back after 10-15 minutes to see if tests passed on Travis CI.
  115. PycURL supports old Python and libcurl releases and their support is tested
  116. on Travis.
  117. For larger changes:
  118. #. Join the `mailing list`_.
  119. #. Discuss your proposal on the mailing list.
  120. #. When consensus is reached, implement it as described above.
  121. Please contribute binary distributions for your system to the
  122. `downloads repository`_.
  123. License
  124. -------
  125. ::
  126. Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
  127. Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
  128. Copyright (C) 2013-2014 by Oleg Pudeyev <oleg at bsdpower.com>
  129. All rights reserved.
  130. PycURL is dual licensed under the LGPL and an MIT/X derivative license
  131. based on the cURL license. A full copy of the LGPL license is included
  132. in the file COPYING-LGPL. A full copy of the MIT/X derivative license is
  133. included in the file COPYING-MIT. You can redistribute and/or modify PycURL
  134. according to the terms of either license.
  135. .. _PycURL: http://pycurl.sourceforge.net/
  136. .. _libcurl: http://curl.haxx.se/libcurl/
  137. .. _urllib: http://docs.python.org/library/urllib.html
  138. .. _`the repository`: https://github.com/pycurl/pycurl
  139. .. _`mailing list`: http://cool.haxx.se/mailman/listinfo/curl-and-python
  140. .. _`downloads repository`: https://github.com/pycurl/downloads