newsdataapi 0.1.25__tar.gz → 0.1.26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {newsdataapi-0.1.25/newsdataapi.egg-info → newsdataapi-0.1.26}/PKG-INFO +1 -1
  2. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/constants.py +2 -0
  3. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/newsdataapi_client.py +17 -0
  4. {newsdataapi-0.1.25 → newsdataapi-0.1.26/newsdataapi.egg-info}/PKG-INFO +1 -1
  5. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/setup.py +1 -1
  6. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/tests/test_newsdataapi.py +6 -3
  7. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/LICENSE +0 -0
  8. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/MANIFEST.in +0 -0
  9. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/README.md +0 -0
  10. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/__init__.py +0 -0
  11. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/helpers.py +0 -0
  12. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/newsdataapi_exception.py +0 -0
  13. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi/utils.py +0 -0
  14. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi.egg-info/SOURCES.txt +0 -0
  15. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi.egg-info/dependency_links.txt +0 -0
  16. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi.egg-info/requires.txt +0 -0
  17. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/newsdataapi.egg-info/top_level.txt +0 -0
  18. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/requirements.txt +0 -0
  19. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/setup.cfg +0 -0
  20. {newsdataapi-0.1.25 → newsdataapi-0.1.26}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsdataapi
3
- Version: 0.1.25
3
+ Version: 0.1.26
4
4
  Summary: Python library for newsdata client-API Call
5
5
  Home-page: https://github.com/newsdataapi/python-client
6
6
  Author: NewsData.io
@@ -15,6 +15,8 @@ CRYPTO_ENDPOINT = 'crypto'
15
15
 
16
16
  COUNT_ENDPOINT = 'count'
17
17
 
18
+ CRYPTO_COUNT_ENDPOINT = 'crypto/count'
19
+
18
20
  # Default request values
19
21
  DEFAULT_REQUEST_TIMEOUT = 300
20
22
  DEFAULT_MAX_RETRIES = 5
@@ -34,6 +34,7 @@ class NewsDataApiClient(FileHandler):
34
34
  self.crypto_url = urljoin(new_base_url,constants.CRYPTO_ENDPOINT)
35
35
  self.sources_url = urljoin(new_base_url,constants.SOURCES_ENDPOINT)
36
36
  self.count_url = urljoin(new_base_url,constants.COUNT_ENDPOINT)
37
+ self.crypto_count_url = urljoin(new_base_url,constants.CRYPTO_COUNT_ENDPOINT)
37
38
 
38
39
  def set_retries( self, max_retries:int, retry_delay:int)->None:
39
40
  """ API maximum retry and delay"""
@@ -323,6 +324,22 @@ class NewsDataApiClient(FileHandler):
323
324
  URL_parameters = self.__validate_parms(user_param=params)
324
325
  URL_parameters_encoded = urlencode(URL_parameters, quote_via=quote)
325
326
  return self.__get_feeds(url=f'{self.count_url}?{URL_parameters_encoded}')
327
+
328
+ def crypto_count_api(
329
+ self, q:Optional[str]=None, qInTitle:Optional[str]=None, qInMeta:Optional[str]=None,language:Optional[Union[str, list]]=None,
330
+ from_date:Optional[str]=None,to_date:Optional[str]=None,coin:Optional[str]=None,raw_query:Optional[str]=None
331
+ ) -> dict:
332
+ """
333
+ Sending GET request to the crypto count api
334
+ For more information about parameters and input, Please visit our documentation page: https://newsdata.io/documentation
335
+ """
336
+ params = {
337
+ 'q':q,'qInTitle':qInTitle,'language':language,'from_date':from_date,'to_date':to_date,'coin':coin,
338
+ 'apikey':self.apikey,'qInMeta':qInMeta,'raw_query':raw_query
339
+ }
340
+ URL_parameters = self.__validate_parms(user_param=params)
341
+ URL_parameters_encoded = urlencode(URL_parameters, quote_via=quote)
342
+ return self.__get_feeds(url=f'{self.crypto_count_url}?{URL_parameters_encoded}')
326
343
 
327
344
  def __del__(self):
328
345
  if isinstance(self.request_method,requests.Session):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsdataapi
3
- Version: 0.1.25
3
+ Version: 0.1.26
4
4
  Summary: Python library for newsdata client-API Call
5
5
  Home-page: https://github.com/newsdataapi/python-client
6
6
  Author: NewsData.io
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
6
6
 
7
7
  setup(
8
8
  name='newsdataapi',
9
- version='0.1.25',
9
+ version='0.1.26',
10
10
  packages=['newsdataapi'],
11
11
  description='Python library for newsdata client-API Call',
12
12
  long_description=long_description,
@@ -32,7 +32,10 @@ class test_newsdataapi(unittest.TestCase):
32
32
 
33
33
  self.assertEqual(response['status'], "success")
34
34
 
35
- # def test_count_api(self):
36
- # response = self.api.count_api(language='en')
35
+ def test_count_api(self):
36
+ response = self.api.count_api(language='en')
37
+ self.assertEqual(response['status'], "success")
37
38
 
38
- # self.assertEqual(response['status'], "success")
39
+ def test_crypto_count_api(self):
40
+ response = self.api.crypto_count_api(q='bitcoin',language='en')
41
+ self.assertEqual(response['status'], "success")
File without changes
File without changes
File without changes
File without changes