semvec/pypi-packages huggingface dataset:
dtm-pyapi 0.0.13
Consumindo APIs facilmente com Python
License: MIT

# pyAPI

É um pacote desenvolvido em Python que busca tornar simples o consumo de APIs, possibilitando consultá-las ou mesmo salvar os dados em diferentes formatos e bancos de dados.

## Instalação e atualização
Use o gerenciador de pacotes [pip](https://pip.pypa.io/en/stable/) para instalar o pyAPI. Rode este comando para instalar atualizações do pacote também.
```bash
pip install 
```

## Glossário
- Consumer Key: 
- Consumer Secret:
- Access Token:
- Access Token Secret: 
- Request Token:
- Request Token Secret:
- Request Token URL:
- Authorize URL:
- Request Access Token URL:
- Base URL:
- Endpoint/Resource:
- Redirect URI:
- Authentication:
- Authorization:
- HTTP Header:

## Uso
```python
import json
import os
from dotenv import load_dotenv
from pyAPI import app
from pyAPI import auth
from pyAPI import utils
import requests
from config.paths import ROOT_DIR

# Configurações
load_dotenv(os.path.join(ROOT_DIR, 'config', 'conf', 'dev', '.env'))
request_access_token_url = os.environ.get('OA2_REQUEST_ACCESS_TOKEN_URL')
client_key = os.environ.get('OA2_CLIENT_KEY')
client_secret = os.environ.get('OA2_CLIENT_SECRET')
username = os.environ.get('OA2_USERNAME')
password = os.environ.get('OA2_PASSWORD')

# Obtendo o HTTP Header com Token de Acesso e URL da instância
base_url, auth_header = auth.auth_oauth2_salesforce(
    request_access_token_url=request_access_token_url,
    client_key=client_key,
    client_secret=client_secret,
    username=username,
    password=password
)

# Instanciando a API
salesforce = app.SetupAPI(base_url)

# Passando a parte de Authorization para o HTTP Header do objeto
salesforce.config_header(auth_header)

# Construindo a URL com endpoint para consumo
url = salesforce.build_url('services/data')

# Passando o Payload necessário para o POST e acrescentando o HTTP
#   Header de Content-Type: application/json
salesforce.config_header(Content_Type='application/json')
data = {
    "NewReg": False
}

# Consumindo a API
request = requests.post(url, headers=salesforce.headers, data=json.dumps(data))

# Printando informações sobre o objeto configurado até aqui
salesforce.info()

# Criando pandas.DataFrame e contando os registros
df = utils.json_to_df(request.json())
print(df.count())
```


## Contribuições
Pull requests são bem-vindos. Para grandes alterações, por favor, abra um Issue primeiro para discussão sobre o que você gostaria de mudar no projeto.

## Referências
- [Requests](https://docs.python-requests.org/en/latest/)
- [Rauth](https://rauth.readthedocs.io/en/latest/)
- [Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content](https://www.rfc-editor.org/rfc/rfc7231)
- [HTTP|MDN](https://developer.mozilla.org/pt-BR/docs/Web/HTTP)

## Lincença
[MIT](https://choosealicense.com/licenses/mit/)
longtrends 0.6
Download long-term Google Trends
License: MIT

# longtrends

A package to download long-term Google Trends.

## Introduction

[Google Trends](https://trends.google.com/trends), downloadable by API using [pytrends](https://pypi.org/project/pytrends/), limits the time period which can be downloaded using a single request. Each request is scaled between 0 and 100, making comparison between different time periods difficult. This package automatically downloads overlapping trends and rescales them, providing trend data across a long-term period.

## Installation

`pip install longtrends`

## Requirements

Requires [pytrends](https://pypi.org/project/pytrends/), installed automatically with `pip`.

## Quick Start

```
from longtrends import LongTrend
from datetime import datetime

keyword = 'suncream'

# Create LongTrend object
longtrend = LongTrend(
                      keyword=keyword,
                      start_date=datetime(2018, 1, 1),
                      end_date=datetime(2022, 3, 31))        # use verbose=True for print output
# Build long-term trends
lt_built = longtrend.build()

# Plot
lt_built.plot(title=f"Google Trends: {longtrend.keyword}", figsize=(15, 3))
```
![suncream.png](/assets/images/suncream.png)
## Under the hood
First, longtrends downloads overlapping trends.
```
from longtrends import rescale_overlaps, get_overlapping_trends, rescaled_longtrend
import pandas as pd

overlapping = get_overlapping_trends(
                                keyword=keyword,
                                start_date=datetime(2018, 1, 1),
                                end_date=datetime(2022, 3, 31),
                                verbose=True)

pd.concat(overlapping, axis=1).plot(figsize=(15,3), legend=False)
```
![overlapping_trends.png](/assets/images/overlapping_trends.png)
Next, i+1th overlap is rescaled to ith overlap.
```
rescaled = rescale_overlaps(overlapping)
pd.concat(rescaled, axis=1).plot(figsize=(15,3), legend=False)
```
![overlaps_rescaled.png](/assets/images/overlaps_rescaled.png)
Finally, a single long-term trend is picked.
```
rescaled = rescaled_longtrend(rescaled)
rescaled.plot(figsize=(15,3), title='Rescaled long-term trend')
```
![rescaled_longtrend.png](/assets/images/rescaled_longtrend.png)

## Disclaimer

This is not an official or supported product. It is provided without warranty under MIT license.
django-xdi 0.4.2
xdi dependency injection adapter for django
License: MIT
Requires Python: >=3.9,<4.0
Keywords: dependency-injector,dependency-injection,inversion-of-control,django-dependency-injection,inversion-of-control-container,IoC-Container,service-injector,injector,django-xdi,IoC,DI,XDI

# Django XDI


[![PyPi version][pypi-image]][pypi-link]
[![Supported Python versions][pyversions-image]][pyversions-link]
[![Build status][ci-image]][ci-link]
[![Coverage status][codecov-image]][codecov-link]


`XDI` is a [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) library for Python.



## Installation

Install from [PyPi](https://pypi.org/project/django-xdi/)

```
pip install django-xdi
```

## Documentation

Full documentation is available [here][docs-link].



## Production

__This package is still in active development and should not be used in production environment__




[docs-link]: https://pyxdi.github.io/django-xdi/
[pypi-image]: https://img.shields.io/pypi/v/django-xdi.svg?color=%233d85c6
[pypi-link]: https://pypi.python.org/pypi/django-xdi
[pyversions-image]: https://img.shields.io/pypi/pyversions/django-xdi.svg
[pyversions-link]: https://pypi.python.org/pypi/django-xdi
[ci-image]: https://github.com/pyxdi/django-xdi/actions/workflows/workflow.yaml/badge.svg?event=push&branch=master
[ci-link]: https://github.com/pyxdi/django-xdi/actions?query=workflow%3ACI%2FCD+event%3Apush+branch%3Amaster
[codecov-image]: https://codecov.io/gh/pyxdi/django-xdi/branch/master/graph/badge.svg
[codecov-link]: https://codecov.io/gh/pyxdi/django-xdi


See this release on GitHub: [v0.4.2](https://github.com/pyxdi/django-xdi/releases/tag/0.4.2)