Commit | Line | Data |
---|---|---|
74edacee | 1 | ## Unofficial Python interface for Diaspora\* social network |
9cd5e2bd | 2 | |
dead87b6 MM |
3 | [![Diaspy on PyPI](https://badge.fury.io/py/diaspy-api.png)](https://pypi.python.org/pypi/diaspy-api) |
4 | ||
9cd5e2bd MM |
5 | `diaspy` is a set of modules which form an Python interface to the API of |
6 | Disapora\* social network. | |
f2eaa3c7 | 7 | |
c8b0cc01 MM |
8 | Test suite will cause problems when run with 2.x so testing should be done |
9 | using python3 interpreter. | |
f2eaa3c7 MM |
10 | |
11 | Object oriented design of `diaspy` makes it easily reusable by other | |
9cd5e2bd MM |
12 | developers who want to use only part of the interface and create derivative |
13 | works from it. | |
14 | ||
15 | Developrs who don't like the design of `diaspy` and want to create something better | |
16 | can use only `diaspy.connection.Connection()` object as it is capable of | |
17 | doing everything. Other modules are just layers that provide easier access to | |
18 | parts of the Diaspora\* API. | |
f2eaa3c7 | 19 | |
74edacee MM |
20 | ---- |
21 | ||
22 | ### Dependencies | |
23 | ||
24 | List of software `diaspy` requires to run. | |
25 | Versions used by maintainer are the ones available in stock Arch x86\_64 repositories. | |
26 | ||
27 | **`python`** | |
28 | ||
29 | Version: 3.3.3 | |
30 | [Website](https://www.python.org/) | |
31 | ||
32 | ||
33 | **`python-requests`** | |
34 | ||
35 | Version: 2.1.0 | |
36 | [Website](http://docs.python-requests.org/en/latest/) | |
37 | ||
38 | ||
f2eaa3c7 MM |
39 | ---- |
40 | ||
41 | #### Quick intro | |
42 | ||
43 | #### 1. Posting text to your stream | |
44 | ||
45 | You only need two objects to do this: `Stream()` and `Connection()`. | |
46 | ||
47 | >>> import diaspy | |
48 | >>> c = diaspy.connection.Connection(pod='https://pod.example.com', | |
49 | ... username='foo', | |
50 | ... password='bar') | |
51 | >>> c.login() | |
5c03fee4 | 52 | >>> stream = diaspy.streams.Stream(c) |
f2eaa3c7 MM |
53 | >>> stream.post('Your first post') |
54 | ||
74edacee | 55 | ---- |
f2eaa3c7 | 56 | |
9cd5e2bd MM |
57 | #### 2. Reference implementation |
58 | ||
59 | There is no official reference implementation of D\* client using `diaspy`. | |
60 | The `diaspy.client` module is no longer maintained and will be removed in the future. | |
f2eaa3c7 | 61 | |
9cd5e2bd MM |
62 | However, there is a small script written that uses `diaspy` as its backend. |
63 | Look for `diacli` in marekjm's repositories on GitHub. | |
f2eaa3c7 MM |
64 | |
65 | ---- | |
66 | ||
67 | To get more information about how the code works read | |
68 | documentation (`./doc/` directory) and manual (`./manual/` directory). |