Skip to main content

Python wrapper over HackerNews Firebase API

Project description

Build Status Coverage Status Version License

Unofficial Python wrapper over Hacker News’ official Firebase API.

Install

> pip install hntop

Usage Examples

Get Item

>>> from hnapi import HnApi
>>> con = HnApi()
>>> item = con.get_item(8863)
>>> item.get('title')
u'My YC app: Dropbox - Throw away your USB drive'
>>> item.get('by')
u'dhouston'

Get User

>>> from hnapi import HnApi
>>> user = HnApi().get_user('pg')
>>> user.get('about')
u'Bug Fixer.'
>>> user.get('karma')
155046
>>> user.type
u'user'

Top Stories

>>> from hnapi import HnApi
>>> top = HnApi().get_top()
>>> top
[8959672, 8960995, 8961086, 8960029, 8960773, 8959207, 8960504, 8960280, 8960486, 8959875, 8955426, 8958731, 8961438, 8961093, 8959138]

Max Item

>>> from hnapi import HnApi
>>> con = HnApi()
>>> max_item_id = con.get_max_item()
>>> max_item_id
8967822
>>> max_item = con.get_item(max_item_id)
>>> max_item.get('type')
u'comment'
>>> max_item.get('text')
u'Interesting. Being partially colour blind I would have thought that the original was much greener, while the re-release is a lot bluer and..'

Documentation

Documentation

License

Apache

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hntop-0.0.10.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hntop-0.0.10-py2-none-any.whl (22.8 kB view details)

Uploaded Python 2

File details

Details for the file hntop-0.0.10.tar.gz.

File metadata

  • Download URL: hntop-0.0.10.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hntop-0.0.10.tar.gz
Algorithm Hash digest
SHA256 d325d360e67faf78d89011891fec36bf09a9d6039786296130a02e1f49d52b0b
MD5 e7c741dd3f1388e3db4212dea07b431f
BLAKE2b-256 63e056c09363d6fedf177b3331864e3a9b4341f52067c75d04c39fe580a48041

See more details on using hashes here.

File details

Details for the file hntop-0.0.10-py2-none-any.whl.

File metadata

File hashes

Hashes for hntop-0.0.10-py2-none-any.whl
Algorithm Hash digest
SHA256 f0b980927588bf3c2f90c1256b08bb9c7913462492dedfe2f468db59fd13ddba
MD5 4003fdb1fda97b4ac1e1ff48944c6742
BLAKE2b-256 4c3f1d6f51e2ac83ee8debe2c574f21a08e9c150904b756b7de84669eb391e0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page