Debian Codegraph @

PKG-INFO

raw
1 Metadata-Version: 2.1
2 Name: prawcore
3 Version: 2.3.0
4 Summary: Low-level communication layer for PRAW 4+.
5 Home-page: https://github.com/praw-dev/prawcore
6 Author: Bryce Boe
7 Author-email: [email protected]
8 License: Simplified BSD License
9 Description: .. _main_page:
10
11 prawcore
12 ========
13
14 .. image:: https://img.shields.io/pypi/v/prawcore.svg
15 :alt: Latest prawcore Version
16 :target: https://pypi.python.org/pypi/prawcore
17
18 .. image:: https://travis-ci.org/praw-dev/prawcore.svg?branch=main
19 :target: https://travis-ci.org/praw-dev/prawcore
20
21 .. image:: https://coveralls.io/repos/github/praw-dev/prawcore/badge.svg?branch=main
22 :target: https://coveralls.io/github/praw-dev/prawcore?branch=main
23
24 prawcore is a low-level communication layer used by PRAW 4+.
25
26 Installation
27 ------------
28
29 Install prawcore using ``pip`` via:
30
31 .. code-block:: console
32
33 pip install prawcore
34
35 Execution Example
36 -----------------
37
38 The following example demonstrates how to use prawcore to obtain the list of trophies
39 for a given user using the script-app type. This example assumes you have the
40 environment variables ``PRAWCORE_CLIENT_ID`` and ``PRAWCORE_CLIENT_SECRET`` set to the
41 appropriate values for your application.
42
43 .. code-block:: python
44
45 #!/usr/bin/env python
46 import os
47 import pprint
48 import prawcore
49
50 authenticator = prawcore.TrustedAuthenticator(
51 prawcore.Requestor("YOUR_VALID_USER_AGENT"),
52 os.environ["PRAWCORE_CLIENT_ID"],
53 os.environ["PRAWCORE_CLIENT_SECRET"],
54 )
55 authorizer = prawcore.ReadOnlyAuthorizer(authenticator)
56 authorizer.refresh()
57
58 with prawcore.session(authorizer) as session:
59 pprint.pprint(session.request("GET", "/api/v1/user/bboe/trophies"))
60
61 Save the above as ``trophies.py`` and then execute via:
62
63 .. code-block:: console
64
65 python trophies.py
66
67 Additional examples can be found at:
68 https://github.com/praw-dev/prawcore/tree/main/examples
69
70 Depending on prawcore
71 ---------------------
72
73 prawcore follows `semantic versioning <http://semver.org/>`_ with the exception that
74 deprecations will not be preceded by a minor release. In essense, expect only major
75 versions to introduce breaking changes to prawcore's public interface. As a result, if
76 you depend on prawcore then it is a good idea to specify not only the minimum version of
77 prawcore your package requires, but to also limit the major version.
78
79 Below are two examples of how you may want to specify your prawcore dependency:
80
81 setup.py
82 ~~~~~~~~
83
84 .. code-block:: python
85
86 setup(..., install_requires=["prawcore >=0.1, <1"], ...)
87
88 requirements.txt
89 ~~~~~~~~~~~~~~~~
90
91 .. code-block:: text
92
93 prawcore >=1.5.1, <2
94
95 Keywords: praw reddit api
96 Platform: UNKNOWN
97 Classifier: Development Status :: 5 - Production/Stable
98 Classifier: Intended Audience :: Developers
99 Classifier: License :: OSI Approved :: BSD License
100 Classifier: Operating System :: OS Independent
101 Classifier: Natural Language :: English
102 Classifier: Programming Language :: Python
103 Classifier: Programming Language :: Python :: 3
104 Classifier: Programming Language :: Python :: 3.6
105 Classifier: Programming Language :: Python :: 3.7
106 Classifier: Programming Language :: Python :: 3.8
107 Classifier: Programming Language :: Python :: 3.9
108 Requires-Python: ~=3.6
109 Provides-Extra: ci
110 Provides-Extra: lint
111 Provides-Extra: test
112 Provides-Extra: dev