
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Pymarket is a simple python library for the Marketstack API. It’s a requirement to have a valid API token, the free version or a paid alternative, see Pricing. Needless to say, this is not an official library.
The different features marketstack supports can be found on marketstack’s documentation.
Gets the stock data after the market has closed. Supports 3 alternatives:
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
from pymarketstack import EndOfDay, download
query = EndOfDay.query(token="your api token")
data, failed = download(query, "AAPL", "XEL", ...)
Here the first line will just create the request with the appropriate fields, the download function will return a tuple with a Response object and a list of strings corresponding to failed tickers. The query function has several options such as the usage of HTTPS, etc. If you want to check how much quota downloading the symbols will take, you can use the quota function as follows:
from pymarketstack import EndOfDay, quota
query = EndOfDay.query(token="your api token")
q: int = quota(query, "AAPL", "XEL", ...)
An end of data request will return 2 things, a Pagination
object and a list of Data
objects. Both of which are wrapped
in a Response
object.
class Response:
pagination: Pagination
data: List[Data]
The data field is overall the most interesting one and contains a single date of data for each ticker. The fields include things like date, symbol, open, close, high, low, among others. All the fields are listed in the documentation.
In case of an error the library will raise an exception corresponding to the common API error codes. An example API response could be:
{
"pagination": {
"limit": 100,
"offset": 0,
"count": 100,
"total": 9944
},
"data": [
{
"open": 129.8,
"high": 133.04,
"low": 129.47,
"close": 132.995,
"volume": 106686703.0,
"adj_high": 133.04,
"adj_low": 129.47,
"adj_close": 132.995,
"adj_open": 129.8,
"adj_volume": 106686703.0,
"split_factor": 1.0,
"dividend": 0.0,
"symbol": "AAPL",
"exchange": "XNAS",
"date": "2021-04-09T00:00:00+0000"
},
[...]
]
}
which would be equivalent to
Response(
pagination = Pagination(limit=100, offset=0, count=100, total=9944),
data = [
Data(
open=129.8,
high=133.04,
low=129.47,
close=132.995,
volume=106686703.0,
adj_high=133.04,
adj_low=129.47,
adj_close=132.995,
adj_open=129.8,
adj_volume=106686703.0,
split_factor=1.0,
dividend=0.0,
symbol="AAPL",
exchange="XNAS",
date=datetime.datetime(2021, 4, 29)
),
...
]
)
due to the usage of dataclasses-json, Response, Pagination, and Data are serializable to/from dicts and json strings.
The dependencies used are listed in the requirements.txt package file but the main ones are:
Apache 2.0, see the LICENSE file for more details.
FAQs
A python library for the marketstack API
We found that pymarketstack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.