Skip to main content

Qiita

Python wrapper for Qiita API v1.

https://secure.travis-ci.org/heavenshell/py-qiita.png

Installation

$ virtualenv --distribute qiita_sample
$ source qiita_sample/bin/activate
$ cd qiita_sample
$ pip install qiita

Qiita depends on Requests.

Usage

Get user’s items

# -*- coding: utf-8 -*-
from qiita import Items

client = Items()
items = client.user_items('heavenshell')

Get tag’s items

# -*- coding: utf-8 -*-
from qiita import Tags

client = Tags()
items = client.tag_items('python')

Get a specified item with comments and raw markdown content

# -*- coding: utf-8 -*-
from qiita import Items

client = Items()
item_uuid = '1234567890abcdefg'
items = client.item(item_uuid)

Authenticated requests

Login with “username & password” or “token”

# -*- coding: utf-8 -*-
from qiita import Client

client = Client(url_name='heavenshell', password='mysecret')
token = client.token # => contains token
# or
client = Client(token='myauthtoken')

Get my items

# -*- coding: utf-8 -*-
from qiita import Items

client = Client(token='myauthtoken')
items = client.user_item()

Post/Update/Delete an item

# -*- coding: utf-8 -*-
from qiita import Items

client = Client(token='myauthtoken')
params = {
  'title': 'Hello',
  'body': 'markdown text',
  'tags': [{name: 'python', versions: ['2.6', '2.7']}],
  'private': False
}
# post
item = client.post_item(params)

# update
params['title'] = 'modified'
client.update_item(item['uuid'], params)

# delete
client.delete_item(item['uuid'])

Stock/Unstock item

# -*- coding: utf-8 -*-
from qiita import Items

client = Items(token='myauthtoken')
item_uuid = '1489e2b291fed74713b2'
# Stock
client.stock_item(item_uuid)

# Unstock
client.unstock_item(item_uuid)

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am ‘Add some feature’)

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request

Release files for qiita 0.1.1

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

Source distribution (sdist)

Source distribution for qiita 0.1.1
File Size Uploaded
qiita-0.1.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qiita 0.1.1
File Interpreter ABI Platform
qiita-0.1.1-py2.7.egg Legacy Egg format - - Details

Total release size: 25.2 kB

Release files / qiita-0.1.1.tar.gz

Download URL qiita-0.1.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b24ef39314f7e0529422726b7fab776dd68b8f9b6cd39e1c98d9bf954cedd3e7
BLAKE2b-256 checksum
How to use checksums
d5947aca80954a2a49bf76742070f42370876ae3c73ef646e1bf65d67287699f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / qiita-0.1.1-py2.7.egg

Download URL qiita-0.1.1-py2.7.egg
Size 11.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
eac6ca819334fe33dc3f18ae65a3b6b57dcf24c1723b483b3ef2b0baf12c29c9
BLAKE2b-256 checksum
How to use checksums
bef29d861e18599e682f95d3c38b6f3d3fdb8be9f694d8de664ff65bcc28b5bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

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