nytimesarticle
===========
nytimesarticle is a fully-functional Python wrapper for the New York Times Article Search API.
Installation
=========
With pip::
$ pip install nytimesarticle
or easy_install::
$ easy_install nytimesarticle
Dependencies
=========
nytimesarticle requires the `requests <https://pypi.python.org/pypi/requests>`_ package.
Usage
=========
Simply import and initialize the API with your developer key::
$ from nytimesarticle import articleAPI
$ api = articleAPI('*Your Key*')
And call the 'search' function with your desired search parameters/values::
$ articles = api.search( q = 'Obama', fq = {'headline':'Obama', 'source':['Reuters','AP', 'The New York Times']}, begin_date = 20111231, facet_field = ['source','day_of_week'], facet_filter = True )
The search function returns a dictionary of the search results.
You can specify multiple filters by using a dictionary::
fq = {'headline':'Obama', 'source':['Reuters','AP', 'The New York Times']}
And multiple values by using a list::
facet_field = ['source','day_of_week']
More examples::
$ articles = api.search( q = 'Obama' )
$ articles = api.search( q = 'Obama', begin_date = 20111231, page=2 )
For a complete overview of the available search parameters, please refer to the NYTimes Article Search API `Documentation <http://developer.nytimes.com/docs/read/article_search_api_v2>`_.
Metadata
Release files for nytimesarticle 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nytimesarticle-0.1.0.tar.gz | 3.2 kB | Without provenance | Details for nytimesarticle-0.1.0.tar.gz |
Release files / nytimesarticle-0.1.0.tar.gz
| Download URL | nytimesarticle-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddda8e843f7ae63df9f6352bcb3ac5775543bc8518abc7140ca9be5b4fc9d21d
|
|
BLAKE2b-256 checksum How to use checksums |
7f5039166f22eef593bae07415d11976c2c4e7bc6fdfcbc6bdf2d42b4a088b7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for nytimesarticle 0.1.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.