Skip to content

Repository files navigation

csvbase logo

csvbase-client

The command line client and pandas integration for csvbase.

Status

Semantic versioning is followed, see the changelog.

Usage

Get a table

In pandas:

>>>importpandasaspd>>>pd.read_csv("csvbase://meripaterson/stock-exchanges")
csvbase_row_idContinentCountryNameMICLastchanged01AfricaLesothoHYBSENaN2019-03-2512AsiaKazakhstanAstanaInternationalFinancialCentreAIXK2018-11-1823AfricaSouthAfricaZARXZARX2018-11-1834SouthAmericaArgentinaBolsasyMercadosArgentinosNaN2018-04-0245NorthAmericaUnitedStatesofAmericaDelawareBoardofTradeNaN2018-04-02
.. ... ... ... ... ... ...
246247NorthAmericaUnitedStatesofAmericaLong-TermStockExchangeLTSE2020-09-14247248NorthAmericaUnitedStatesofAmericaMiamiInternationalSecuritiesExchangeMIHI2020-09-24248249NorthAmericaUnitedStatesofAmericaMembers' ExchangeNaN2020-09-24249250AfricaZimbabweVictoriaFallsStockExchangeNaN2020-11-01250251AsiaChinaBeijingStockExchangeNaN2021-12-27
[251rowsx6columns]

From the command line

csvbase-client table get meripaterson/stock-exchanges
csvbase_row_id,Continent,Country,Name,MIC,Last changed
1,Africa,Lesotho,HYBSE,,2019-03-25
2,Asia,Kazakhstan,Astana International Financial Centre,AIXK,2018-11-18
3,Africa,South Africa,ZAR X,ZARX,2018-11-18
[ full file omitted ]

Set (aka "upsert") a table:

csvbase-client table set meripaterson/stock-exchanges stock-exchanges.csv

Nothing is output upon success and exit code is 0.

Installing

Executable

Download these from the github release page.

Pip + PyPI

pip install csvbase-client

Docker

docker pull calpaterson/csvbase-client

Then when you run:

# mount your own xdg-cache directory as a volume inside the container
docker run -v "${XDG_CACHE_HOME:-$HOME/.cache}":/root/.cache calpaterson/csvbase-client

About

A cli client for csvbase

Resources

Stars

46 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages