artemis-py


Nameartemis-py JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/MattMaximo/artemis_py
SummaryA package to interact with the Artemis API. Visit artemis.xyz for more.
upload_time2024-07-11 19:10:15
maintainerNone
docs_urlNone
authorMatt Maximo
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Artemis Analytics Python API

## Overview

The `ArtemisAPI` class provides a convenient interface for interacting with the Artemis API to fetch asset data, metrics, and developer activity information. It allows users to retrieve data in the form of pandas DataFrames and visualize it using Plotly.

Visit artemis.xyz to explore their data and get an 'API Key'

## Features

- Fetch a list of supported assets.
- Fetch available metrics for a specific asset.
- Retrieve specific metric data for assets.
- List supported ecosystems.
- Fetch weekly commit data for ecosystems.
- Fetch weekly active developer data for ecosystems.
- Plot data using Plotly.

## Installation

### Prerequisites

- Python 3.6 or higher
- Required Python packages:
  - pandas
  - requests
  - plotly

### Install Required Packages

You can install the required packages using `pip`:

```bash
pip install pandas requests plotly
```

## Usage

### Initialization

To use the `ArtemisAPI` class, you need to instantiate it with your API key:

```python
from artemis_api import ArtemisAPI

api_key = "your_api_key_here"
api = ArtemisAPI(api_key)
```

### Fetching Assets

To fetch a list of supported assets:

```python
assets = api.get_assets()
print(assets)
```

### Fetching Asset Metrics

To fetch available metrics for a specific asset:

```python
asset_id = "bitcoin"
metrics = api.get_asset_metrics(asset_id)
print(metrics)
```

### Fetching Metric Data for Assets

To fetch data for a specific metric of an asset:

```python
asset_id = "bitcoin"
start_date = "2023-01-01"
metric = "price"
data = api.get_data(asset_id, start_date, metric)
print(data)
```

### Fetching Data for Multiple Metrics and/or Assets

To fetch data for a set metrics for one or more assets:

```python
api = ArtemisAPI(api_key="api_key_here")
asset_ids = ["bitcoin", "ethereum"]
metrics = ["price", "mc"]
start_date = "2023-06-01"
end_date = "2023-06-10"

data = api.get_data(asset_ids, metrics, start_date, end_date)
```

### Listing Supported Ecosystems

To list supported ecosystems:

```python
ecosystems = api.list_ecosystems()
print(ecosystems)
```

### Fetching Weekly Commits for Ecosystems

To fetch weekly commits data for ecosystems:

```python
commits = api.query_weekly_commits_for_ecosystem()
print(commits)
```

To fetch weekly commits data for a specific ecosystem:

```python
ecosystem = "Uniswap"
commits = api.query_weekly_commits_for_ecosystem(ecosystem=ecosystem)
print(commits)
```

### Fetching Weekly Active Developers for Ecosystems

To fetch weekly active developer data for ecosystems:

```python
active_devs = api.query_active_devs_for_ecosystem()
print(active_devs)
```

To fetch weekly active developer data for a specific ecosystem:

```python
ecosystem = "Uniswap"
active_devs = api.query_active_devs_for_ecosystem(ecosystem=ecosystem)
print(active_devs)
```

### Plotting Data

To plot data using Plotly:

```python
data = api.get_data("bitcoin", "2023-01-01", "price")
fig = api.plot_data(data, "Bitcoin Price Data")
fig.show()
```

To plot weekly data with performance annotations:

```python
weekly_data = api.query_weekly_commits_for_ecosystem(ecosystem="Uniswap")
fig = api.plot_weekly_data(weekly_data, "Uniswap Weekly Commits")
fig.show()
```

## Error Handling

The class includes basic error handling for HTTP errors and other exceptions. Errors are logged using the `logging` module.

## Logging

Logging is configured to the INFO level by default. You can change the logging level as needed:

```python
import logging
logging.basicConfig(level=logging.DEBUG)
```

## Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MattMaximo/artemis_py",
    "name": "artemis-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Matt Maximo",
    "author_email": "matt@pioneerdigital.org",
    "download_url": "https://files.pythonhosted.org/packages/92/46/769156cbe7c54586eea59a57e4e07f82aec9662e68e3767882263a28e837/artemis_py-0.2.4.tar.gz",
    "platform": null,
    "description": "\n# Artemis Analytics Python API\n\n## Overview\n\nThe `ArtemisAPI` class provides a convenient interface for interacting with the Artemis API to fetch asset data, metrics, and developer activity information. It allows users to retrieve data in the form of pandas DataFrames and visualize it using Plotly.\n\nVisit artemis.xyz to explore their data and get an 'API Key'\n\n## Features\n\n- Fetch a list of supported assets.\n- Fetch available metrics for a specific asset.\n- Retrieve specific metric data for assets.\n- List supported ecosystems.\n- Fetch weekly commit data for ecosystems.\n- Fetch weekly active developer data for ecosystems.\n- Plot data using Plotly.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.6 or higher\n- Required Python packages:\n  - pandas\n  - requests\n  - plotly\n\n### Install Required Packages\n\nYou can install the required packages using `pip`:\n\n```bash\npip install pandas requests plotly\n```\n\n## Usage\n\n### Initialization\n\nTo use the `ArtemisAPI` class, you need to instantiate it with your API key:\n\n```python\nfrom artemis_api import ArtemisAPI\n\napi_key = \"your_api_key_here\"\napi = ArtemisAPI(api_key)\n```\n\n### Fetching Assets\n\nTo fetch a list of supported assets:\n\n```python\nassets = api.get_assets()\nprint(assets)\n```\n\n### Fetching Asset Metrics\n\nTo fetch available metrics for a specific asset:\n\n```python\nasset_id = \"bitcoin\"\nmetrics = api.get_asset_metrics(asset_id)\nprint(metrics)\n```\n\n### Fetching Metric Data for Assets\n\nTo fetch data for a specific metric of an asset:\n\n```python\nasset_id = \"bitcoin\"\nstart_date = \"2023-01-01\"\nmetric = \"price\"\ndata = api.get_data(asset_id, start_date, metric)\nprint(data)\n```\n\n### Fetching Data for Multiple Metrics and/or Assets\n\nTo fetch data for a set metrics for one or more assets:\n\n```python\napi = ArtemisAPI(api_key=\"api_key_here\")\nasset_ids = [\"bitcoin\", \"ethereum\"]\nmetrics = [\"price\", \"mc\"]\nstart_date = \"2023-06-01\"\nend_date = \"2023-06-10\"\n\ndata = api.get_data(asset_ids, metrics, start_date, end_date)\n```\n\n### Listing Supported Ecosystems\n\nTo list supported ecosystems:\n\n```python\necosystems = api.list_ecosystems()\nprint(ecosystems)\n```\n\n### Fetching Weekly Commits for Ecosystems\n\nTo fetch weekly commits data for ecosystems:\n\n```python\ncommits = api.query_weekly_commits_for_ecosystem()\nprint(commits)\n```\n\nTo fetch weekly commits data for a specific ecosystem:\n\n```python\necosystem = \"Uniswap\"\ncommits = api.query_weekly_commits_for_ecosystem(ecosystem=ecosystem)\nprint(commits)\n```\n\n### Fetching Weekly Active Developers for Ecosystems\n\nTo fetch weekly active developer data for ecosystems:\n\n```python\nactive_devs = api.query_active_devs_for_ecosystem()\nprint(active_devs)\n```\n\nTo fetch weekly active developer data for a specific ecosystem:\n\n```python\necosystem = \"Uniswap\"\nactive_devs = api.query_active_devs_for_ecosystem(ecosystem=ecosystem)\nprint(active_devs)\n```\n\n### Plotting Data\n\nTo plot data using Plotly:\n\n```python\ndata = api.get_data(\"bitcoin\", \"2023-01-01\", \"price\")\nfig = api.plot_data(data, \"Bitcoin Price Data\")\nfig.show()\n```\n\nTo plot weekly data with performance annotations:\n\n```python\nweekly_data = api.query_weekly_commits_for_ecosystem(ecosystem=\"Uniswap\")\nfig = api.plot_weekly_data(weekly_data, \"Uniswap Weekly Commits\")\nfig.show()\n```\n\n## Error Handling\n\nThe class includes basic error handling for HTTP errors and other exceptions. Errors are logged using the `logging` module.\n\n## Logging\n\nLogging is configured to the INFO level by default. You can change the logging level as needed:\n\n```python\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package to interact with the Artemis API. Visit artemis.xyz for more.",
    "version": "0.2.4",
    "project_urls": {
        "Homepage": "https://github.com/MattMaximo/artemis_py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f917d4034380b24226cb8220e694e87d99b4478e8bba5bc02f50dd5eb605113",
                "md5": "9c8b4e801f64eacbaf5f97177cb40c19",
                "sha256": "a76e7ab637c1f223e1936521c7a48372cc0d573c79f3ab44f0c982541fe87bd6"
            },
            "downloads": -1,
            "filename": "artemis_py-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c8b4e801f64eacbaf5f97177cb40c19",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4584,
            "upload_time": "2024-07-11T19:10:14",
            "upload_time_iso_8601": "2024-07-11T19:10:14.437794Z",
            "url": "https://files.pythonhosted.org/packages/1f/91/7d4034380b24226cb8220e694e87d99b4478e8bba5bc02f50dd5eb605113/artemis_py-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9246769156cbe7c54586eea59a57e4e07f82aec9662e68e3767882263a28e837",
                "md5": "984153968c5c5bf97b2430bcb4b65e5a",
                "sha256": "042501e549295beb152860c827a5bcbcefbbe4717cc25d49e29b96680d6da4b0"
            },
            "downloads": -1,
            "filename": "artemis_py-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "984153968c5c5bf97b2430bcb4b65e5a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4277,
            "upload_time": "2024-07-11T19:10:15",
            "upload_time_iso_8601": "2024-07-11T19:10:15.927955Z",
            "url": "https://files.pythonhosted.org/packages/92/46/769156cbe7c54586eea59a57e4e07f82aec9662e68e3767882263a28e837/artemis_py-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-11 19:10:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MattMaximo",
    "github_project": "artemis_py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "artemis-py"
}
        
Elapsed time: 0.30411s