semvec/pypi-packages huggingface dataset:
soundcloud-dl 0.1.26
A tool to download tracks from soundcloud.com
Keywords: Downloader,Python,soundcloud

# soundcloud-dl
[![Downloads](https://pepy.tech/badge/soundcloud-dl)](https://pepy.tech/project/soundcloud-dl)

A small command-line program to download tracks from soundcloud.com
You'll need to get an API key since there are rate limits on streams

## Installation

#### Using Pip
* Run `pip install soundcloud_dl`

#### From Source
* Clone the repo or download the zip
* Make sure you have pip installed
* `cd` to the folder
* `pip install -r "requirements.txt"`

### Getting an API key
* SoundCloud has stopped registering apps so the only way to get an API key is from the dev console 
  Navigate to soundcloud.com and check for any XHR request params to find a `client_id` that can be used
* Use `sc-dl --set-api-key <CLIENT_ID>` to set the API key

## Usage
![usage](https://i.imgur.com/Vm8Hirx.gif)
#### Options

    usage: soundcloud_dl.py [-h] [-t | -n | -u [URL]] [--set-api-key SET_API_KEY]
                            [-s] [-d DIR] [-a] [-l] [-e EXCLUDE [EXCLUDE ...]]
                            [-i INCLUDE [INCLUDE ...]] [--limit LIMIT]
                            [-r RANGE RANGE] [-g [GENRE]]

    optional arguments:
      -h, --help            show this help message and exit
      -t, --top             Downloads the top 10 tracks across all genres
      -n, --new             Downloads 10 new tracks across all genres
      -u [URL], --url [URL]
                            URL to download tracks from
      --set-api-key SET_API_KEY
                            sets the soundcloud API key
      -s, --similar         Downloads 10 tracks similar to the track in the URL
      -d DIR, --dir DIR     Directory to save tracks in. Defaults to current
                            working directory
      -a, --all             Download all tracks (Uploads and likes)
      -l, --likes           Download only liked tracks.
      -e EXCLUDE [EXCLUDE ...], --exclude EXCLUDE [EXCLUDE ...]
                            Enter track numbers to exclude.
      -i INCLUDE [INCLUDE ...], --include INCLUDE [INCLUDE ...]
                            Enter track numbers to include
      --limit LIMIT         Maximum number of tracks to download
      -r RANGE RANGE, --range RANGE RANGE
                            Enter range of tracks to download.
      -g [GENRE], --genre [GENRE]
                            use with --top to get top tracks from a specific genre


* sc-dl can be used instead of soundcloud-dl
* `--top`, `--new` and `--url` arguments are mutually exclusive
* The url can be a link to a user, a track or a user's playlists. Downloads a user's uploads unless --all or --likes options are given
* Adding the --include option overrides the --exclude option
* Example : `sc-dl https://soundcloud.com/aaasrith --dir D:\Music`
* Example : `sc-dl https://soundcloud.com/aaasrith --dir D:\Music --exclude 1 2 3`
* Example : `sc-dl https://soundcloud.com/aaasrith/closurewithaclause -s`

### Contributions
If you want to add features, improve them, or report issues, feel free to send a pull request!
bright-django-statsd 0.1.1
Django Library to monitor and send django application metrics to Statsd.
Keywords: django statsd monitoring

## Build and Install

Checkout the code and run the following command inside the folder
``` 
python setup.py install 
```

## Usage

In your settings.py:

```
INSTALLED_APPS = [
      'django_statsd',
]

MIDDLEWARE = [
   'django_statsd.middlewares.DjangoStatsDMetricsBeforeMiddleware',
    . . . . . . . 
    . . . . . . . 
    . . . . . . .
    'django_statsd.middlewares.DjangoStatsdMetricsAfterMiddleware',
]

STATSD_EXPORTER_HOST = ‘YOUR_STATSD_EXPORTER_HOST’
STATSD_EXPORTER_PORT = ‘YOUR_STATSD_EXPORTER_UDP_PORT’
STATSD_EXPORT_MIGRATIONS = True/False #True - if you want to monitor migrations
```

## Monitoring your models

You may want to monitor the creation/deletion/update rate for your model. This can be done by adding a mixin to them. This is safe to do on existing models also (it does not require a migration).
If your model is:
```
Class Hero(models.Model):
    name = models.CharField(max_length=100, unique=True)
    address = models.CharField(max_length=100, blank=True, null=True)
    age = models.PositiveIntegerField(blank=True, null=True)
```

Just add the CustomModelMixinExporter(model_name) as such:

```
from django_statsd.models import CustomModelMixinExporter

Class Hero(CustomModelMixinExporter('hero'), models.Model):
    name = models.CharField(max_length=100, unique=True)
    address = models.CharField(max_length=100, blank=True, null=True)
    age = models.PositiveIntegerField(blank=True, null=True)
    
 ```
    
This will export 3 metrics, ``` django_model_inserts_total{model="hero"}, django_model_updates_total{model="hero"} and django_model_deletes_total{model="hero"}```.
Note that the exported metrics are counters of creations, modifications and deletions done in the current process. They are not gauges of the number of objects in the model.

## Monitoring Migrations:

By default, migrations are monitored. Two gauges are exported, ```django_migrations_applied_by_connection and django_migrations_unapplied_by_connection```. You may want to alert if there are unapplied migrations.
If you want to disable the Django migration metrics, set the **STATSD_EXPORT_MIGRATIONS** setting to False in your settings file


## Adding Custom Metrics

In your python file
```
from django_statsd.custom_metrics import CustomMetricsToStatsd

# Counter metrics
CustomMetricsToStatsd.addCustomCounterMetric('metrics_name', tags=[ 'label_1:%s' % label_1_value,
                'label_2:%s' % label_2_value ]) 

# Histogram Metrics
CustomMetricsToStatsd.addCustomHistogramMetric('metrics_name', time, tags=[ 'label_1:%s' % label_1_value,
                'label_2:%s' % label_2_value ]) #here the value is similar to Histogram.observe(value) in prometheus
                
#Gauge Metrics
CustomMetricsToStatsd.addCustomGaugeMetrics('metrics_name', value, sample_rate, tags=[ 'label_1:%s' % label_1_value,
                'label_2:%s' % label_2_value ]) #here the value is similar to Histogram.observe(value) in prometheus

```

#### Other type of metrics will be implemented soon based on requirements and priority