Skip to main content

Library for fetching coin/token metrics data from the internet.

Project description

https://raw.githubusercontent.com/im-n1/karpet/master/assets/logo.png

Karpet

Karpet is a tiny library with just a few dependencies for fetching coins/tokens metrics data the internet.

It can provide following data:

  • coin/token historical price data (no limits)

  • google trends for the given list of keywords (longer period than official API)

What is upcoming?

  • Reddit metrics

  • Have a request? Open an issue ;)

Dependencies

Library uses a few nifty dependencies and is Python 3.6+ only:

  • pandas

  • numpy

  • coinmarketcap

  • pytrends

Usage

Install the library via pip.

~ pip install karpet

Import the library class first.

from karpet import Karpet

Symbol (ticker) -> coninmarketcap.com URL slug conversion.

c = Karpet(date(2019, 1, 1), date(2019, 5, 1))
c.get_coin_slug("BTC")  # bitcoin

Retrieving historical data.

c = Karpet(date(2019, 1, 1), date(2019, 5, 1))
df = c.fetch_crypto_historical_data(coin="bitcoin")  # Dataframe with historical data
df.head()
https://raw.githubusercontent.com/im-n1/karpet/master/assets/historical_data.png
c = Karpet(*get_last_week())
df = c.fetch_google_trends(kw_list=["bitcoin"])  # Dataframe with trends.
df.head()
https://raw.githubusercontent.com/im-n1/karpet/master/assets/trends.png

And with a few lines of code you can get a chart

df = df.set_index("date")
df.plot()
https://raw.githubusercontent.com/im-n1/karpet/master/assets/trends_chart.png

Credits

This is my personal library I use in my long-term project. I can pretty much guarantee it will live for a long time then. I will add new features over time and I more than welcome any help or bug reports. Feel free to open an issue or merge request.

The code is is licensed under MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

karpet-0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

karpet-0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file karpet-0.1.tar.gz.

File metadata

  • Download URL: karpet-0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for karpet-0.1.tar.gz
Algorithm Hash digest
SHA256 54344172365f385cad5d340c2db30415c2e546dbd43d4a5aadd4bf6f5ebd713b
MD5 1049ed0d8a03905b9f60a878049ca1f1
BLAKE2b-256 75e7300c513af577778846a9afe03f4c9eca92c7eb5b8078982adbd56e0be3a1

See more details on using hashes here.

File details

Details for the file karpet-0.1-py3-none-any.whl.

File metadata

  • Download URL: karpet-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for karpet-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05b9cc2bd1815d4a842d4aa8573f3326f01dcefc6630e144976f4d87cf65f6ae
MD5 857aa236f1e7c53752344f20138258ac
BLAKE2b-256 637106d5b2491b8fa2b002e1ebb22e23bcb4b5f93665459fd0495fbc0a6fbd25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page