articlealpha 0.1.0__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.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: articlealpha
3
+ Version: 0.1.0
4
+ Summary: Python client for ArticleAlpha Wikipedia-based market attention data.
5
+ Home-page: https://github.com/articlealpha/articlealpha
6
+ Author: ArticleAlpha
7
+ Author-email: info@articlealpha.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Office/Business :: Financial :: Investment
12
+ Requires-Python: >=3.6
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: pandas
15
+ Requires-Dist: requests
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # ArticleAlpha Python Client
27
+
28
+ The official Python wrapper for the [ArticleAlpha](https://articlealpha.com) API.
29
+
30
+ ArticleAlpha tracks investor curiosity by monitoring Wikipedia pageview trends for thousands of global stocks. This library allows data scientists and analysts to pull that "Attention Data" directly into Pandas for behavioral finance research.
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install articlealpha
36
+ ```
37
+
38
+ ### Usage
39
+
40
+ ```python
41
+ from articlealpha import ArticleAlpha
42
+
43
+ # Get daily time-series for all stocks
44
+ df = ArticleAlpha.get_timeseries()
45
+ print(df.head())
46
+
47
+ # Get deep details for a specific ticker
48
+ nvda = ArticleAlpha.get_ticker_details("NVDA")
49
+ ```
50
+
51
+ ## Data Source & Attribution
52
+
53
+ This project utilizes data from the **Wikimedia Metrics API**.
54
+
55
+ - **Source:** [Wikimedia API](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/concepts/page-views.html)
56
+ - **Trademark Notice:** Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. ArticleAlpha is an independent project and is not affiliated with or endorsed by the Wikimedia Foundation.
57
+
58
+ ## Disclaimer
59
+ This data is for informational purposes only. ArticleAlpha does not provide investment advice. Wikipedia pageviews represent public interest and curiosity, which may or may not correlate with market performance.
60
+
61
+ ## License
62
+ MIT
@@ -0,0 +1,37 @@
1
+ # ArticleAlpha Python Client
2
+
3
+ The official Python wrapper for the [ArticleAlpha](https://articlealpha.com) API.
4
+
5
+ ArticleAlpha tracks investor curiosity by monitoring Wikipedia pageview trends for thousands of global stocks. This library allows data scientists and analysts to pull that "Attention Data" directly into Pandas for behavioral finance research.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install articlealpha
11
+ ```
12
+
13
+ ### Usage
14
+
15
+ ```python
16
+ from articlealpha import ArticleAlpha
17
+
18
+ # Get daily time-series for all stocks
19
+ df = ArticleAlpha.get_timeseries()
20
+ print(df.head())
21
+
22
+ # Get deep details for a specific ticker
23
+ nvda = ArticleAlpha.get_ticker_details("NVDA")
24
+ ```
25
+
26
+ ## Data Source & Attribution
27
+
28
+ This project utilizes data from the **Wikimedia Metrics API**.
29
+
30
+ - **Source:** [Wikimedia API](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/concepts/page-views.html)
31
+ - **Trademark Notice:** Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. ArticleAlpha is an independent project and is not affiliated with or endorsed by the Wikimedia Foundation.
32
+
33
+ ## Disclaimer
34
+ This data is for informational purposes only. ArticleAlpha does not provide investment advice. Wikipedia pageviews represent public interest and curiosity, which may or may not correlate with market performance.
35
+
36
+ ## License
37
+ MIT
@@ -0,0 +1,4 @@
1
+ from .client import ArticleAlpha
2
+
3
+ __version__ = "0.1.0"
4
+ __all__ = ["ArticleAlpha"]
@@ -0,0 +1,75 @@
1
+ import pandas as pd
2
+ import requests
3
+ import io
4
+
5
+ class ArticleAlpha:
6
+ """Client for the ArticleAlpha Market Attention API."""
7
+
8
+ BASE_URL = "https://articlealpha.com/api/v1"
9
+
10
+ HEADERS = {
11
+ "User-Agent": "ArticleAlpha-Client/0.1 (Mozilla/5.0 compatible; DataScience/1.0)"
12
+ }
13
+
14
+ @classmethod
15
+ def _fetch(cls, endpoint):
16
+ """Internal helper to fetch URL with proper headers."""
17
+ url = f"{cls.BASE_URL}{endpoint}"
18
+ response = requests.get(url, headers=cls.HEADERS)
19
+
20
+ if response.status_code == 403:
21
+ raise ConnectionError(
22
+ "403 Forbidden"
23
+ "The server might be under high load or blocking scripts."
24
+ )
25
+ elif response.status_code != 200:
26
+ raise ConnectionError(f"API Error {response.status_code}: {url}")
27
+
28
+ return response
29
+
30
+ @classmethod
31
+ def get_timeseries(cls):
32
+ """
33
+ Fetches the bulk daily time-series for all tracked stocks.
34
+ Returns:
35
+ pd.DataFrame: Columns [Ticker, Date, Raw Views, Smoothed Views, Baseline, Multiplier, Edits]
36
+ """
37
+ try:
38
+ # 1. Fetch raw CSV text with headers
39
+ response = cls._fetch("/market/timeseries.csv")
40
+
41
+ # 2. Parse string into DataFrame
42
+ df = pd.read_csv(io.StringIO(response.text))
43
+
44
+ if 'Date' in df.columns:
45
+ df['Date'] = pd.to_datetime(df['Date'])
46
+ return df
47
+
48
+ except Exception as e:
49
+ raise ConnectionError(f"Failed to fetch data from ArticleAlpha API: {e}")
50
+
51
+ @classmethod
52
+ def get_summary(cls):
53
+ """
54
+ Fetches the latest market snapshot/heatmap data.
55
+ Returns:
56
+ pd.DataFrame: Latest metrics for all symbols.
57
+ """
58
+ try:
59
+ response = cls._fetch("/market/summary.json")
60
+ return pd.DataFrame(response.json())
61
+ except Exception as e:
62
+ raise ConnectionError(f"Failed to fetch summary from ArticleAlpha API: {e}")
63
+
64
+ @classmethod
65
+ def get_ticker_details(cls, symbol):
66
+ """
67
+ Fetches deep metadata and related pages for a specific stock.
68
+ Args:
69
+ symbol (str): The stock ticker (e.g., 'AAPL')
70
+ """
71
+ try:
72
+ response = cls._fetch(f"/ticker/{symbol.upper()}.json")
73
+ return response.json()
74
+ except:
75
+ return None
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: articlealpha
3
+ Version: 0.1.0
4
+ Summary: Python client for ArticleAlpha Wikipedia-based market attention data.
5
+ Home-page: https://github.com/articlealpha/articlealpha
6
+ Author: ArticleAlpha
7
+ Author-email: info@articlealpha.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Office/Business :: Financial :: Investment
12
+ Requires-Python: >=3.6
13
+ Description-Content-Type: text/markdown
14
+ Requires-Dist: pandas
15
+ Requires-Dist: requests
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ # ArticleAlpha Python Client
27
+
28
+ The official Python wrapper for the [ArticleAlpha](https://articlealpha.com) API.
29
+
30
+ ArticleAlpha tracks investor curiosity by monitoring Wikipedia pageview trends for thousands of global stocks. This library allows data scientists and analysts to pull that "Attention Data" directly into Pandas for behavioral finance research.
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install articlealpha
36
+ ```
37
+
38
+ ### Usage
39
+
40
+ ```python
41
+ from articlealpha import ArticleAlpha
42
+
43
+ # Get daily time-series for all stocks
44
+ df = ArticleAlpha.get_timeseries()
45
+ print(df.head())
46
+
47
+ # Get deep details for a specific ticker
48
+ nvda = ArticleAlpha.get_ticker_details("NVDA")
49
+ ```
50
+
51
+ ## Data Source & Attribution
52
+
53
+ This project utilizes data from the **Wikimedia Metrics API**.
54
+
55
+ - **Source:** [Wikimedia API](https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/concepts/page-views.html)
56
+ - **Trademark Notice:** Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. ArticleAlpha is an independent project and is not affiliated with or endorsed by the Wikimedia Foundation.
57
+
58
+ ## Disclaimer
59
+ This data is for informational purposes only. ArticleAlpha does not provide investment advice. Wikipedia pageviews represent public interest and curiosity, which may or may not correlate with market performance.
60
+
61
+ ## License
62
+ MIT
@@ -0,0 +1,9 @@
1
+ README.md
2
+ setup.py
3
+ articlealpha/__init__.py
4
+ articlealpha/client.py
5
+ articlealpha.egg-info/PKG-INFO
6
+ articlealpha.egg-info/SOURCES.txt
7
+ articlealpha.egg-info/dependency_links.txt
8
+ articlealpha.egg-info/requires.txt
9
+ articlealpha.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ pandas
2
+ requests
@@ -0,0 +1 @@
1
+ articlealpha
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="articlealpha",
5
+ version="0.1.0",
6
+ author="ArticleAlpha",
7
+ author_email="info@articlealpha.com",
8
+ description="Python client for ArticleAlpha Wikipedia-based market attention data.",
9
+ long_description=open("README.md").read(),
10
+ long_description_content_type="text/markdown",
11
+ url="https://github.com/articlealpha/articlealpha",
12
+ packages=find_packages(),
13
+ install_requires=[
14
+ "pandas",
15
+ "requests",
16
+ ],
17
+ classifiers=[
18
+ "Programming Language :: Python :: 3",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Topic :: Office/Business :: Financial :: Investment",
22
+ ],
23
+ python_requires='>=3.6',
24
+ )