semvec/pypi-packages huggingface dataset:
django-requests-logger 1.0.0
A django integration for requests.
License: MIT
Requires Python: >=3.7,<4.0

# django-requests-logger

django-requests-logger is a Django application used as a hook for [Requests](http://docs.python-requests.org/en/master/).

It logs every request made using the Requests library to the database and provides basic data masking for sensitive information.

You can access the logs in the Django admin site.

## Installing
```
pip install django-requests-logger
```

Add `django_requests_logger` in INSTALLED_APPS.

Run `python manage.py migrate`

## Usage
```
import requests
from django_requests_logger.callbacks import logger as requests_logger
from functools import partial

# If you want to capture only errors (HTTP 4XX client errors and 5XX server errors), then pass only_errors argument set to True.

hooks = {"response": partial(requests_logger, only_errors=True)}
requests.get('https://httpbin.org/', hooks=hooks)
```

## TODO
Integrate this application in the Django logging as a handler.

## Requirements
* [Django](https://github.com/django/django)
* [requests](https://github.com/requests/requests)

#### If you want to add yourself some functionality to the application:
1. Fork it ( https://github.com/GearPlug/django-requests-logger )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Adds my new feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
django-llm 0.1.3
A LLM (Large Language Model) app for Django
License: MIT
Requires Python: >=3.11

[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3112/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# Django LLM
An app for Django to aid development of large language model (LLM) workflows.

Have you ever wanted to store ChatGPT queries in your database? Now you can.

Powered by [langchain](https://github.com/hwchase17/langchain)


* [Wiki](https://github.com/mikrl/django-llm/wiki)
* [Sample Project](https://github.com/mikrl/django-llm-sample)

# Information
Configure your LLM workflow from Django.

Build a business layer for your LLM application.

## Install latest binary
```bash
pip install django-llm
```

## Build and install from source
```bash
./build.sh
pip install dist/*.whl
```

# Tests (Stabilizing)
```bash
pip install -r static.txt
./static.sh
pytest tests/
```

# Features
## Run ChatGPT queries through Django shell and model code
```bash
docker build -t django_llm .  
docker run -it django_llm 
>>> from llm.models.prompts import Prompt
>>> prompt = Prompt(template = "Give a bombastic and raucous 'Hello, {name}' to the user")
>>> prompt.save()
>>> Prompt.objects.all()
<QuerySet [<Prompt: Prompt object (1)>]>
>>> Prompt.objects.all()[0].template
"Give a bombastic and raucous 'Hello, {name}' to the user"
>>> from llm.models import ModelProviderAPI
>>> openai = ModelProviderAPI(service = 'OpenAI', api_key = '<<<YOUR OPENAI API KEY>>>')
>>> openai.save()
>>> openai.service
'OpenAI'
>>> from llm.models.queries import OpenAIChatQuery
>>> query = OpenAIChatQuery(prompt = prompt, api = openai)
>>> query.do_query(name="World")
"HELLO WORLD! WELCOME TO THE MIGHTY REALM OF TECHNOLOGY AND INNOVATION! PREPARE TO BE ASTOUNDED AND DAZZLED BY THE POWER OF CODE AND THE ENDLESS POSSIBILITIES OF THE DIGITAL AGE! LET'S ROCK AND ROLL!"
>>>
```

## More
* Model to configure and execute ChatGPT query
* Model to hold prompt and determine prompt variables
* Model to store API keys for various services
airtable-python 0.1.1
API wrapper for Airtable written in Python
License: MIT
Requires Python: >=3.7,<4.0

![](https://img.shields.io/badge/version-0.1.0-success) ![](https://img.shields.io/badge/code-Python-4B8BBE?logo=python&logoColor=white)
# airtable-python

*airtable-python* is an API wrapper for Airtable, written in Python
- Use this library if you are interested in Oauth authentication and webhook notifications.

## Installing
```
pip install airtable-python
```
## Usage
```
from airtable.client import Client
client = Client(client_id, client_secret, redirect_uri, code_verifier)
```
*Note: If you already have an access token, you can initiate Client without any parameters and directly set token with the access token you have as a dictionary client.set_token({"access_token": token})*
### Get access_token
To get the access token using Oauth2 follow the next steps.
Check https://airtable.com/developers/web/api/oauth-reference for more info:

1. Get authorization URL to receive code
```
url = client.authorization_url(state)
```
2. Get access token using code
```
token = client.token_creation(code)
```
3. Set access token
```
client.set_token(access_token)
```
If your access token expired, you can get a new one using refresh_token:
```
response = client.refresh_access_token(refresh_token)
```
And then set access token again...  

### Get current user
```
user = client.get_current_user()
```
### List Bases
```
bases = client.list_bases()
```
### List Tables
```
tables = client.list_base_tables(baseId)
```
### List records
```
records = client.list_records(
    baseId, 
    tableId, 
    pageSize=None, 
    maxRecords=None, 
    filter_field=None, 
    filter_value=None, 
    sort_field=None, 
    sort_direction=None
)
# baseId and tableId are required
# sort_direction options are 'desc' or 'asc'
```
### Create Records
```
records = [
    {
        "fields": {
          "Projects": "Project from python",
          "Status": "In progress",
          "Complete?": False
        }
    },
]
records = client.create_records(baseId, tableId, records)
```
### Update Record
```
data = {
    "Status": "Complete",
    "Complete?": True
}
record = client.update_record(baseId, tableId, recordId, data)
```
### Update Multiple Records
```
records = [
    {
        "id": "recB4UscNECOHnT7y",
        "fields": {
            "Number": 10000,
        },
    },
    {
        "id": "recFkktx671jlvyj8",
        "fields": {
            "Number": 20000,
        },
    },
]
updated_records = client.update_record(baseId, tableId, records)
```
### List Collaborators (needs enterprise scopes access)
```
collabs = client.list_collaborators(baseId)
```
batchbook-python 0.1.1
API wrapper for Batchbook written in Python
License: MIT
Requires Python: >=3.7,<4.0

# Batchbook-python
Batchbook API wrapper written in python.

## Installing
```
pip install batchbook-python
```

## Usage
### Simple access with API KEY
```
from batchbool.client import Client

client = Client('API_KEY')
```

Get Contacts
```
client.get_contacts()
```

Get an specific contact
```
client.get_contact(contact_id)
```
## Requirements

```
-Requests
-Urllib
```

## TODO
- Companies
- Custom Fields
- Users
- Roles
- Communications
agilecrm-python 0.1.5
API wrapper for Agile CRM written in Python
License: MIT
Requires Python: >=3.7,<4.0

# agilecrm-python

agilecrm is an API wrapper for Agile CRM written in Python

## Installing
```
pip install agilecrm-python
```

## Usage
```
from agilecrm.client import Client

client = Client('API_KEY', 'EMAIL', 'DOMAIN')
```

Create contact
```
contact_data = {
    "star_value": "4",
    "lead_score": "92",
    "tags": [
        "Lead",
        "Likely Buyer"
    ],
    "properties": [
        {
            "type": "SYSTEM",
            "name": "first_name",
            "value": "Los "
        },
        {
            "type": "SYSTEM",
            "name": "last_name",
            "value": "Bruikheilmer"
        },
        {
            "type": "SYSTEM",
            "name": "company",
            "value": "steady.inc"
        },
        {
            "type": "SYSTEM",
            "name": "title",
            "value": "VP Sales"
        },
        {
            "type": "SYSTEM",
            "name": "email",
            "subtype": "work",
            "value": "akrambakram@yabba.com"
        },
        {
            "type": "SYSTEM",
            "name": "address",
            "value": "{\"address\":\"225 George Street\",\"city\":\"NSW\",\"state\":\"Sydney\",\"zip\":\"2000\",\"country\":\"Australia\"}"
        },
        {
            "type": "CUSTOM",
            "name": "My Custom Field",
            "value": "Custom value"
        }
    ]
}

response = client.create_contact(contact_data)
```

Get contact by id
```
response = client.get_contact_by_id('5685265389584384')
```

Get contact by email
```
response = client.get_contact_by_email('akrambakram@yabba.com')
```

Update contact
```
update_contact_data = {
    "id": "5685265389584384",
    "properties": [
        {
            "type": "SYSTEM",
            "name": "last_name",
            "value": "Chan"
        },
        {
            "type": "CUSTOM",
            "name": "My Custom Field",
            "value": "Custom value chane"
        }
    ]
}
response = client.update_contact(update_contact_data)
```

Search contacts
```
import json

myjson = {
    "rules": [{"LHS": "created_time", "CONDITION": "BETWEEN", "RHS": 1510152185.779954, "RHS_NEW": 1510238585.779877}],
    "contact_type": "PERSON"}
    
response = client.search(
    {'page_size': 25,
    'global_sort_key': '-created_time',
    'filterJson': json.dumps(myjson)
})
```


## Requirements
- requests

## Tests
```
python tests/test_client.py
```
buffer-python-lib 0.1.1
API wrapper for Buffer written in Python
License: MIT
Requires Python: >=3.7,<4.0

# Buffer-python

Buffer-python is an API wrapper for the API v1 of Buffer written in Python

## Installing
```
pip install buffer-python-lib
```

## Usage
```
from buffer.client import Client

client = Client('CLIENT_ID', 'CLIENT_SECRET')
```

Get authorization url
```
url = client.get_authorization_url('REDIRECT_URL')
```

Exchange the code for an access token
```
token = client.exchange_code('REDIRECT_URL', 'CODE')
```

Set the access token
```
client.set_token('TOKEN')
```

Get user information
```
account = client.get_user_info()
```

Get user registered profiles
```
profiles = client.get_user_profiles()
```

Get specific user profile
```
profile = client.get_specific_profile('PROFILE_ID')
```

Get leads given the form
```
posting_schedules = client.get_posting_schedules('PROFILE_ID')
```

Get sent posts
```
sent_posts = client.get_sent_post('PROFILE_ID')
```

Get specific post
```
specific_post = client.get_specific_post('POST_ID')
```

New post or update
```
post = client.new_post('PROFILE_ID', 'TEXT', True)
```

## Requirements
- requests

## TODO
- unittest

## Contributing
We are always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.
#### You can report any bug you find or suggest new functionality with a new [issue](https://github.com/GearPlug/buffer-python/issues).
#### If you want to add yourself some functionality to the wrapper:
1. Fork it ( https://github.com/GearPlug/buffer-python )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Adds my new feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request