semvec/pypi-packages huggingface dataset:
spotify-py-sdk 0.1.2
Python SDK for Spotify
Requires Python: >=3.9,<4.0

## Python SDK for Spotify Web API

> This library is still a work in progress.

This is a Python library for the [Spotify Web API](https://developer.spotify.com/web-api/). This SDK is very simple to use if you are already familiar with the [typescript SDK](https://github.com/spotify/spotify-web-api-ts-sdk) provided by Spotify. It takes a lot of help from there. 

### Endpoints currently available
- albums
- artists
- audiobooks
- browse
- chapters
- episodes
- markets
- playlists
- recommendations
- search
- shows
- tracks
- users

### Requirements

- python 3.9 or higher

### Using this in your project

> This library is yet not published on PyPI :) if you want to test the sdk out, you can clone this repo and follow the below mentioned steps to get results back. You can make changes in the already given example file or can simply run the tests using pytest to see if everything is working well or not.

### Running the example provided

First install the dependencies (make sure you have **poetry** installed):

```commandline
poetry install
```

Create a .env file in the root directory with your client_id and client_secret. Refer the `.env.example` file for reference.

```text
CLIENT_ID=
CLIENT_SECRET=
```

Now run the file to get results back from the web api:
```commandline
python example.py
```

### Create a client instance

Currently, we only have client credentials flow for authentication. If you're building a server side application, you should use Client Credentials Flow, and is the correct choice when you have both your Client ID and Client Secret available.

```python
from spotify-py-sdk import SpotifyApi, SdkConfig
from dotenv import load_dotenv
load_dotenv()

config = SdkConfig() # optional; can create custom methods
api: SpotifyApi = SpotifyApi(os.getenv("CLIENT_ID"), os.getenv("CLIENT_SECRET"), config)
```

Once you have an authenticated instance of the SDK, you can make requests to the Spotify Web API by using the methods exposed on the client instance of the API.

```python
api.search.execute("purpose", ["album"])
api.browse.get_categories()
```

### Running the tests

To run the tests, you need to have a Spotify account.

You will need to create a new app in the Spotify Developer portal, and add a redirect URI of http://localhost:3000.

You will need to add the following environment variables:
- `CLIENT_ID`
- `CLIENT_SECRET`

You can run the tests using `pytest`. We support `python-dotenv`, so you can add these to a `.env` file in the root of the repository.

To run all tests:
```python
pytest
```
To run a specific test.
```python
pytest tests/endpoints/test_albums.py
```
ttrace 0.1.13
Makes use of strace
Requires Python: >=3.10,<4.0

# ttrace - strace as a tree

Uses `strace` to trace a program call and displays what's going on in a human
friendly manner.


![Current screenshot](screenshot.png "Current screenshot")

[Project page](https://projects.om-office.de/frans/ttrace)


## Installation and Usage

Install `ttrace` via pip:
```
[<python executable> -m] pip install [-U] ttrace
```

A new executable is then provided which can be used instead of `strace`:
```
ttrace [<ARGS>] <CMD>
```
Note that you would'nt provide `strace` arguments since `ttrace` provides them
automatically.

Alternatively you can clone and use the current development tree, see below.


## Intended interface

The following commands and outputs reflect the current development plan:

```sh
ttrace <CMD|LOGFILE>
```
Prints annotated, pre-formatted and filtered output next to the process' original
`stdout` and `stderr`.

```sh
ttrace --attach <PID|NAME>
```
Attaches to the given process and displays all but `stdout` and `stderr` of the
process of course.

```sh
<CMD> | ttrace [<OTHER-ARGS>]
```
Same as with `attach` but using pipe semantics (limited due to the mixing of
`stderr` and `strace` output.


```sh
ttrace --grep <PATTERN> <CMD>
```
Applies pattern to the original `strace` output and only outputs the matching
content.

```sh
ttrace --tree <CMD>
```
Populates and displays a tree while the program is running.

```sh
ttrace --hybrid <CMD>
```
Not sure yet - plan is to have `ncurses` based split views for optionally any
of the following elements:

* tree output
* combined `stdout` and `stderr`
* alternatively split `stdout` and `stderr`
* strace console
* console with only warning character (whatever that means)

```sh
ttrace --timing <CMD>
```

### ToDo for v1.0

* trace process termination
* output growing process tree
* report / visualize abnormal process termination
* report / visualize file access
* optionally turn PIDs into PID counters for comparability
* optionally print timestamp, pid, line number
* no color
* logging


### Other ideas

* trace changes environment
* trace docker image usage
* highlight failed processes


## Development & Contribution

```
pip3 install -U poetry pre-commit
git clone --recurse-submodules https://projects.om-office.de/frans/ttrace.git
cd ttrace
pre-commit install
# if you need a specific version of Python inside your dev environment
poetry env use ~/.pyenv/versions/3.10.4/bin/python3
poetry install
```


## License

See `License.md`


## Read

* [The Difference Between fork(), vfork(), exec() and clone()](https://www.baeldung.com/linux/fork-vfork-exec-clone)
* [HN: The Magic of strace](https://news.ycombinator.com/item?id=7155799)
* [The Magic of strace (archive.org)](https://web.archive.org/web/20160116001752/http://chadfowler.com/blog/2014/01/26/the-magic-of-strace/)