Skip to main content

Podigee Connector for Podcast Data

Project description

Podigee Connector

Docs

OpenPodcast Banner

This is a simple library for connecting to the Podigee API.
It can be used to export data from your dashboard at https://app.podigee.com/analytics

Supported Endpoints

  • /podcasts/{podcast_id}/analytics
  • /podcasts/{podcast_id}/overview (with optional scope parameter for totals)
  • /podcasts/{podcast_id}/analytics/episodes
  • /episodes/{episode_id}/analytics

See __main__.py for all endpoints.

Credentials

This API supports three authentication methods:

  1. Using the official API token. This option is preferred, but only available if you have a professional account.
  2. Using Podigee username and password. Use this only if you don't have access to the API through your account.
  3. Using a session cookie that you need to extract manually from your browser.

If possible, use option 1, the official API token, as it is the most secure and officially supported authentication method. Find more information on the different authentication methods below.

Using the official API token

from podigeeconnector import PodigeeConnector

connector = PodigeeConnector(
   base_url=BASE_URL,
   podigee_access_token=PODIGEE_ACCESS_TOKEN,
)

Using the session token

Alternatively, you can use a session token to log in:

from podigeeconnector import PodigeeConnector

connector = PodigeeConnector(
   base_url=BASE_URL,
   podigee_session_v5=PODIGEE_SESSION_V5,
)

Using username and password

Finally, you can also call the login endpoint with your username and password to log in:

from podigeeconnector import PodigeeConnector

connector = PodigeeConnector.from_credentials(
   base_url=BASE_URL,
   podcast_id=PODCAST_ID,
   username=USERNAME,
   password=PASSWORD,
)

Installation

pip install podigeeconnector

Usage as a library

from podigeeconnector import PodigeeConnector

connector = PodigeeConnector(
   base_url=BASE_URL,
   podigee_access_token=PODIGEE_ACCESS_TOKEN,
)

end = datetime.now()
start = end - timedelta(days=30)

podcast_analytics = connector.podcast_analytics(podcast_id, start, end)
logger.info("Podcast Analytics = {}", json.dumps(podcast_analytics, indent=4))

# Get totals with listeners and subscribers count
podcast_totals = connector.podcast_totals(podcast_id, start, end)
logger.info("Total Downloads: {}", podcast_totals.get("total_downloads"))
logger.info("Unique Listeners: {}", podcast_totals.get("unique_listeners_number"))

# Get total downloads for a specific episode
episode_total = connector.episode_total_downloads(episode_id, start, end)
logger.info("Episode Total Downloads: {}", episode_total)

See __main__.py for all endpoints.

Development

We use Pipenv for virtualenv and dev dependency management. With Pipenv installed:

  1. Install your locally checked out code in development mode, including its dependencies, and all dev dependencies into a virtual environment:
pipenv sync --dev
  1. Create an environment file and fill in the required values:
cp .env.sample .env
  1. Run the script in the virtual environment, which will automatically load your .env:
pipenv run podigeeconnector

To add a new dependency for use during the development of this library:

pipenv install --dev $package

To add a new dependency necessary for the correct operation of this library, add the package to the install_requires section of ./setup.py, then:

pipenv install

To publish the package:

python setup.py sdist bdist_wheel
twine upload dist/*

or

make publish

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

podigeeconnector-0.4.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

podigeeconnector-0.4.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file podigeeconnector-0.4.0.tar.gz.

File metadata

  • Download URL: podigeeconnector-0.4.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.22

File hashes

Hashes for podigeeconnector-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ca68f1cdd8e2fa3516711261874c9d41eab78970507bd6cc07e82ab97447b6a9
MD5 ac964aa4e30de50b523b2936735e377e
BLAKE2b-256 75c5c9d7536a4d5f8d666818e9b982d19f1152ef92be5403831b8506d4bfdee1

See more details on using hashes here.

File details

Details for the file podigeeconnector-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for podigeeconnector-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65c33f8fbe8d0f8fa5c68989b5aaaf68acb276a271b9e1a569b518b55b3e7bb7
MD5 21c9df636591799f8f2f2d3cb0de9b24
BLAKE2b-256 2e65059516733f7f5d7845c67e5365ab2b1c3dfd62c6b3fcfd9138074c6f5c64

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