Based on the updated structure of your library, here's a revised README:
NewsAPI Python Client
Description
This project provides a Python client for accessing the NewsAPI. It simplifies the process of integrating news search capabilities into your applications. Whether you're building a news aggregation service, a stock trading platform that needs financial news, or a social media app that wants to display relevant news to users, this library is here to assist.
Features
- Intuitive Python interface for NewsAPI.
- Leverages the
requestslibrary for HTTP requests. - Employs an object-oriented model for both requests and responses.
- Supports all parameters of the NewsAPI, including advanced search queries and filtering.
- Designed for flexibility and extensibility, allowing for customization as needed.
Installation
pip install newsapi-python-client
Usage
First, you need to initialize the NewsAPIService with your NewsAPI key.
import os
from newsApi.service import NewsAPIService
news_api_service = NewsAPIService(os.environ.get('NEWS_API_KEY'))
Then you can use the service to make requests. Here is an example for retrieving news about finance:
from newsApi.models.request import EverythingRequestModel
request_model = EverythingRequestModel(
q='finance',
)
response = news_api_service.everything(request_model)
for article in response.articles:
print(f"Title: {article.title}")
print(f"URL: {article.url}")
print("---")
Note: Remember to replace placeholder values in the EverythingRequestModel with actual values.
Requirements
- Python 3.6 or later
requestspackage
Future Plans
- Enhance error handling and validation.
- Include more examples and use cases.
- Develop comprehensive documentation.
Contributing
Contributions from the community are welcome. Please refer to the CONTRIBUTING.md file for more details.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Metadata
Release files for newsapi-python-client 0.2.4
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 |
|---|---|---|---|---|
| newsapi-python-client-0.2.4.tar.gz | 5.8 kB | Without provenance | Details for newsapi-python-client-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| newsapi_python_client-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for newsapi_python_client-0.2.4-py3-none-any.whl |
Total release size: 12.4 kB
Release files / newsapi-python-client-0.2.4.tar.gz
| Download URL | newsapi-python-client-0.2.4.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1055f0d31ebacf99bcc56936996b4b0bd01cfe8dc9cd6b2013cfc8a71ccff215
|
|
BLAKE2b-256 checksum How to use checksums |
3dcd3a9a79a8c20a57dd5f3fb392712b22f16bbc0c0c3790dc34f71ea62a08c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Release files / newsapi_python_client-0.2.4-py3-none-any.whl
| Download URL | newsapi_python_client-0.2.4-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1c14dc8c18bb2a7cd7c59884dca9156cd7b62471646951297a25dec8804252a
|
|
BLAKE2b-256 checksum How to use checksums |
432ad18af2150aa38d93b85b228d68818735887c9ce6ce967b38f45c7c13da3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Security for newsapi-python-client 0.2.4
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.