Skip to content

Commit

Permalink
Add new funds: Rize ETFs (#265)
Browse files Browse the repository at this point in the history
* Update dependencies

* Add new Rize ETFs

* Update schemas

* Update Fund model

* Add new ETFs to readme

* Upgrade to python 3.12

* Bump version to v2.6.0
  • Loading branch information
frefrik authored May 9, 2024
1 parent 84705d4 commit fb6e26b
Show file tree
Hide file tree
Showing 9 changed files with 1,088 additions and 395 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.12

WORKDIR /code

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ Click here to see a list of ARK ETFs
- **IZRL** - ARK Israel Innovative Technology ETF
- ~~**CTRU** - ARK Transparency ETF~~

- Rize Index ETFs
- **CYBR** - Rize Cybersecurity and Data Privacy ETF
- **CYCL** - Rize Circular Economy Enablers UCITS ETF
- **FOOD** - Rize Sustainable Future of Food UCITS ETF
- **LIFE** - Rize Environmental Impact 100 UCITS ETF
- **LUSA** - Rize USA Environmental Impact UCITS ETF
- **NFRA** - Rize Global Sustainable Infrastructure UCITS ETF
- **PMNT** - Rize Digital Payments Economy UCITS ETF

- Other Funds
- **ARKVX** - ARK Venture Fund
</details>
Expand All @@ -60,6 +69,13 @@ The API contains data for trades, holdings and news from the following dates:
| ARKY | Digital Asset ETF | - | 2023-11-29 | 2023-11-17 |
| ARKZ | Digital Asset ETF | - | 2023-11-29 | 2023-11-16 |
| ARKVX | Venture Fund | - | 2023-10-31 | - |
| CYBR | Rize Index ETF | - | 2024-04-27 | - |
| CYCL | Rize Index ETF | - | 2024-04-27 | - |
| FOOD | Rize Index ETF | - | 2024-04-27 | - |
| LIFE | Rize Index ETF | - | 2024-04-27 | - |
| LUSA | Rize Index ETF | - | 2024-04-27 | - |
| NFRA | Rize Index ETF | - | 2024-04-27 | - |
| PMNT | Rize Index ETF | - | 2024-04-27 | - |

---

Expand Down
10 changes: 4 additions & 6 deletions app/api/v1/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class FundProfile(BaseModel):
class HoldingList(BaseModel):
company: str
ticker: Optional[str]
cusip: str
shares: int
market_value: float
cusip: Optional[str]
shares: Optional[int]
market_value: Optional[float]
weight: float
weight_rank: int

Expand Down Expand Up @@ -92,9 +92,7 @@ class FundOwnership(BaseModel):
symbol: str
date: Optional[datetime.date]
ownership: list[FundOwnershipList] = []
totals: create_model(
"totals", funds=(int, ...), shares=(int, ...), market_value=(float, ...)
)
totals: create_model("totals", funds=(int, ...), shares=(int, ...), market_value=(float, ...))


class StockTradesList(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions app/api/v2/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class V2_FundProfileData(BaseModel):
description: str
fund_type: str
inception_date: datetime.date
cusip: str
isin: str
cusip: str | None
isin: str | None
website: str

class Config:
Expand Down
9 changes: 8 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenAPI settings
OPENAPI_TITLE = "ARK Invest API"
OPENAPI_API_VERSION = "2.5.0"
OPENAPI_API_VERSION = "2.6.0"
OPENAPI_DESCRIPTION = "API for tracking ARK Invest fund holdings and trades. This site is not affiliated with Ark Invest."
OPENAPI_CONTACT = "[email protected]"
OPENAPI_SERVER_URL = "https://arkfunds.io/api"
Expand All @@ -25,6 +25,13 @@
"PRNT",
"IZRL",
"CTRU",
"CYBR",
"CYCL",
"FOOD",
"LIFE",
"LUSA",
"NFRA",
"PMNT",
]

# Example responses
Expand Down
4 changes: 2 additions & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class Fund(Base):
symbol = Column(String)
name = Column(String)
description = Column(String)
cusip = Column(String)
isin = Column(String)
cusip = Column(String, nullable=True)
isin = Column(String, nullable=True)
inception_date = Column(Date)
website = Column(String)
fund_type = Column(String)
Expand Down
1,414 changes: 1,043 additions & 371 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[tool.poetry]
name = "ark-invest-api"
version = "2.5.0"
version = "2.6.0"
description = "API for tracking holdings and trades of ARK Invest funds."
authors = ["Fredrik Haarstad <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.10"
fastapi = "^0.109.0"
python = "^3.12"
fastapi = "^0.111.0"
requests = "^2.31.0"
psycopg2-binary = "^2.9.9"
python-dateutil = "^2.8.2"
SQLAlchemy = "^2.0.25"
uvicorn = "^0.25.0"
python-dateutil = "^2.9.0.post0"
SQLAlchemy = "^2.0.30"
uvicorn = "^0.29.0"
yahooquery = "^2.3.7"

[tool.poetry.dev-dependencies]
black = "^23.12.1"
black = "^24.4.2"
isort = "^5.13.2"
pytest = "^7.4.4"
pytest = "^8.2.0"

[tool.poetry.group.dev.dependencies]
httpx = "^0.26.0"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_routes_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_etf_profile_inexistent_item(client):
response = client.get("/api/v1/etf/profile?symbol=ARK")
assert response.status_code == 404
assert response.json() == {
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU"
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU, CYBR, CYCL, FOOD, LIFE, LUSA, NFRA, PMNT"
}


Expand All @@ -34,7 +34,7 @@ def test_etf_holdings_inexistent_item(client):
response = client.get("/api/v1/etf/holdings?symbol=ARK")
assert response.status_code == 404
assert response.json() == {
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU"
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU, CYBR, CYCL, FOOD, LIFE, LUSA, NFRA, PMNT"
}


Expand All @@ -47,7 +47,7 @@ def test_etf_trades_inexistent_item(client):
response = client.get("/api/v1/etf/trades?symbol=ARK")
assert response.status_code == 404
assert response.json() == {
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU"
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU, CYBR, CYCL, FOOD, LIFE, LUSA, NFRA, PMNT"
}


Expand All @@ -60,7 +60,7 @@ def test_etf_news_inexistent_item(client):
response = client.get("/api/v1/etf/news?symbol=TSLA")
assert response.status_code == 404
assert response.json() == {
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU"
"detail": "symbol must be one of: ARKA, ARKB, ARKC, ARKD, ARKZ, ARKY, ARKK, ARKQ, ARKW, ARKG, ARKF, ARKX, ARKVX, PRNT, IZRL, CTRU, CYBR, CYCL, FOOD, LIFE, LUSA, NFRA, PMNT"
}


Expand Down

0 comments on commit fb6e26b

Please sign in to comment.