semvec/pypi-packages huggingface dataset:
legisweb-api 0.0.5
Cliente Python para a API Legisweb
Requires Python: >=3.7

# legisweb-api

Cliente Python para a API pÃºblica da LegisWeb, com suporte para mÃºltiplos endpoints fiscais como ICMS, IPI, PIS/COFINS, ST, II, CFOP, TIPI, pautas fiscais, entre outros.

## InstalaÃ§Ã£o

```bash
pip install legisweb-api
```

## Requisitos

- Python 3.7 ou superior
- Biblioteca `requests`

## Uso

```python
from legiswebapi.legisweb_client import LegiswebClient

client = LegiswebClient(token="SEU_TOKEN", codigo_cliente="SEU_CODIGO")

# Exemplo: Consulta ICMS
resposta = client.consulta_icms(ncm="22030000", estado="SP")
print(resposta)

# Exemplo: Consulta PIS/COFINS
resposta = client.consulta_piscofins(ncm="22030000", regime=1, atividade=1)
print(resposta)
```

## Endpoints Suportados

- `consulta_icms(ncm, estado)`
- `consulta_ipi(ncm)`
- `consulta_ii(ncm)`
- `consulta_st_interna(ncm, estado)`
- `consulta_st_interestadual(ncm, uf_origem, uf_destino, destinacao)`
- `consulta_piscofins(ncm, regime, atividade)`
- `consulta_piscofins_importacao(ncm)`
- `consulta_tipi(ncm)`
- `consulta_cfop(codigo)`
- `consulta_ptax(moeda, data)`
- `consulta_agenda_tributaria(data, estado)`
- `consulta_aliquota_padrao(estado)`
- `consulta_nve(ncm)`
- `consulta_defesa_comercial(ncm)`
- `consulta_preferencia_tarifaria(codigo, operacao, pais)`
- `consulta_tratamento_adm_importacao(ncm)`
- `consulta_tratamento_adm_exportacao(ncm)`
- `consulta_produto_ssn(ncm)`
- `consulta_correlacao_ncm(codigo, de, para)`
- `consulta_empresa(cnpj)`
- `consulta_beneficio_fiscal(descricao, estado, categoria)`
- `consulta_pauta_fiscal(estado, busca)`

## LicenÃ§a

MIT
freetubedb 1.0.1
Python library for interacting with FreeTube's playlists.db file
Requires Python: >=3.10

# freetubedb

[![PyPI - Version](https://img.shields.io/pypi/v/freetubedb.svg)](https://pypi.org/project/freetubedb)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/freetubedb.svg)](https://pypi.org/project/freetubedb)

Python library for interacting with [FreeTube](https://freetubeapp.io/)'s playlists.db file 

-----

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

```console
pip install freetubedb
```

## Usage

### `FreetubePlaylist`
```python
@dataclass(frozen=True)
class FreetubePlaylist:
    """
    FreetubePlaylist class. Contains all the information stored about a playlist.
    """

    id: str
    name: str
    description: str
    protected: bool
    videos: list[FreetubeVideo] = field(default_factory=list[FreetubeVideo])
```

### `FreetubeVideo`
```python
@dataclass(frozen=True)
class FreetubeVideo:
    """
    FreetubeVideo class. Contains all the information stored about a video in a FreetubePlaylist.
    """

    id: str
    title: str

    author_id: str
    author_name: str

    length: int  # seconds
    date_published: int  # unix timestamp
    date_added: int  # unix timestamp

    playlist_item_id: str
```

### Example
```python
from pathlib import Path
from freetubedb import parse_playlists_file, FreetubePlaylist

# uses default FreeTube path based on operating system
playlists: list[FreetubePlaylist] = parse_playlists_file()

# alternatively, you can supply your own custom path:
# playlists: list[FreetubePlaylist] = parse_playlists_file(Path("./playlists.db"))


for playlist in playlists:
    print(f"Playlist: {playlist.name} (ID: {playlist.id})")
    print(f"Description: {playlist.description}")
    print(f"Number of videos: {len(playlist.videos)}")

    for video in playlist.videos:
        print(f"  - {video.title} by {video.author_name}")
        print(f"    Video ID: {video.id}")
        print(f"    Length: {video.length} seconds")
        print(f"    Published: {video.date_published} (unix timestamp)")
        print(f"    Added to playlist: {video.date_added} (unix timestamp)")
```

## License

`freetubedb` is distributed under the terms of the [GPL-3.0](https://spdx.org/licenses/GPL-3.0.html) license.