Skip to main content
##StackExchange

[![Build Status](https://travis-ci.org/plasmashadow/stackexchange.svg?branch=master)](https://travis-ci.org/plasmashadow/stackexchange)
[![PyPI version](https://badge.fury.io/py/stackexchange.svg)](http://badge.fury.io/py/stackexchange)
[![PyPI](https://img.shields.io/pypi/dm/stackexchange.svg)](https://pypi.python.org/pypi/stackexchange)

##Description
A Friendly wrapper for stackexchange public api used to harvest information about Questions, Answers
and even search for questions.

##Installation:

you can install stackexchange from its official pypi repository.

```python
pip install stackexchange

```

##Usage

###searching

We can use the stackexchange search api to search in various titles

```python

from stackexchange import search

g = search("python", site="stackoverflow", order="desc")

for item in g:
print item.title
# will help you to see all properties it contains
print dir(item)

```

### answers

Let's look at the answer api now.

```python

from stackexchange import Answer

a = Answer()
g = a.get_all_answer(site="stackoverflow", order="desc", page=1)

for item in g:
answer_id = item.answer_id
ans = a.get_by_id(answer_id)
comments = a.get_comments(answer_id)
print comments
```

###questions

On Questions api

```python

from stackexchange import Question

q = Question()

g = q.get_all_questions(site="stackoverflow", order="desc")

for item in g:
question_id = item.question_id
ques = q.get_by_id(question_id)

#for getting unanswered questions

g = q.get_unanswered()

#for getting featured questions

g = q.get_featured()

```


##License

<h4> MIT </h4>

Metadata

Release files for stackexchange 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stackexchange 0.5.0
File Size Uploaded Provenance Actions
stackexchange-0.5.0.tar.gz 3.7 kB Without provenance Details for stackexchange-0.5.0.tar.gz

Release files / stackexchange-0.5.0.tar.gz

Download URL stackexchange-0.5.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ef38574485cf807a729dfe14571249a38e2378c35121d06f09b9eb891d57f2aa
BLAKE2b-256 checksum
How to use checksums
ef619797c7b1bae882a2265fe7fcdd98ba358e34fb66ba2809e3addb5d286248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for stackexchange 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file No provenance

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page